Skip to content

Commit 8f1dd21

Browse files
WIP materialization tutorial.
1 parent a33e0b2 commit 8f1dd21

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed
431 KB
Loading
565 KB
Loading

gitbook/.gitbook/assets/rhinovault_session.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,44 @@
11
# Materialization
22

3+
## Aim
4+
5+
<figure><img src="../../.gitbook/assets/materialization_model_photo.png" alt=""><figcaption></figcaption></figure>
6+
7+
The aim of this tutorial is to convert RhinoVault data into solid geometry to facilitate the creation of simple physical models. Most often, this step is used for teaching purposes when models or small prototypes are built. The tutorial uses the Rhino ScriptEditor Python interface to extract data from a RhinoVault session file. Multiple mesh-based operations are then used to transform the geometry into solid blocks with shear keys and indices. Run the code below sequentially one-by-one because each step is serialized into a JSON file that is used as a starting point in the consecutive step.
8+
9+
{% file src="../../.gitbook/assets/rhinovault_session.json" %}
10+
11+
## RhinoVault Session
12+
13+
The session file is a JSON file of compas.scene with the following items: `Pattern`, `FormDiagram`, `ThrustDiagram`, `ForceDiagram`. It also stores general settings for drawing and thrust-network-analysis. We will use two attributes: `Pattern` and `ThrustDiagram` for mesh transformation into solid blocks.
14+
15+
There first three comments is specific to Python in Rhino indication a) `python3` language is used, b) code is written `brg-csd` environment, and c) `compas_rv` library must be installable from the python package index (PyPI).
16+
17+
The `scene` is used both for storing and visualising COMPAS items (geometry & datastructures).
18+
19+
20+
```python
21+
#! python3
22+
# venv: brg-csd
23+
# r: compas_rv
24+
25+
import pathlib
26+
import compas
27+
from compas.scene import Scene
28+
29+
# =============================================================================
30+
# Load data
31+
# =============================================================================
32+
IFILE = pathlib.Path(__file__).parent.parent / "data" / "shell_final.json"
33+
rv_session = compas.json_load(IFILE)
34+
rv_scene: Scene = rv_session["scene"]
35+
pattern = rv_scene.find_by_name("Pattern").mesh
36+
37+
# =============================================================================
38+
# Visualisation
39+
# =============================================================================
40+
scene = Scene()
41+
scene.clear_context()
42+
scene.add(rv_scene.find_by_name("Pattern").mesh)
43+
scene.draw()
44+

0 commit comments

Comments
 (0)