Skip to content

Commit 82c25a6

Browse files
WIP materialization text corrections.
1 parent 28795c0 commit 82c25a6

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

gitbook/next-steps/materialization.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The aim of this tutorial is to convert a RhinoVault session (a JSON file with a
1212

1313
<figure><img src="../.gitbook/assets/materialization_pattern.gif" alt=""><figcaption></figcaption></figure>
1414

15-
Before you start create a folder on your computer where you will store the `rhinovault_session.json` file as well as python example files. Then open Rhino Script Editor by command `ScriptEditor`. Add a new python file by clicking on the plus sign named `000.pattern.py`. Then copy-paste the code below that extracts the mesh pattern from the session file.
15+
Create a folder where you will store the `rhinovault_session.json` file as well as python example files. Then open Rhino Script Editor. Add a new python file named `000.pattern.py`. Then run the code below that extracts the 2D mesh pattern from the session file.
1616

1717
The session file employs the compas.scene data structure for storing: Pattern, FormDiagram, ThrustDiagram, and 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. The scene also helps to visualize COMPAS items (geometry & data structures).
1818

@@ -45,7 +45,7 @@ scene.add(rv_scene.find_by_name("Pattern").mesh)
4545
scene.draw()
4646
```
4747

48-
## Mesh from Thrust Diagram
48+
## Mesh from Thrust Diagram in Rhino Script Editor
4949

5050
<figure><img src="../.gitbook/assets/materialization_thrust_diagram.png" alt=""><figcaption></figcaption></figure>
5151

@@ -71,19 +71,17 @@ from compas.itertools import pairwise
7171
def break_boundary(mesh: Mesh, breakpoints: list[int]) -> tuple[list[list[int]], list[int]]:
7272

7373
# Get the list of vertices on the boundary (first boundary from the mesh)
74+
# If the first and last vertices in the boundary are the same, remove the last vertex (close loop)
7475
boundary: list[int] = mesh.vertices_on_boundaries()[0]
7576

76-
# If the first and last vertices in the boundary are the same, remove the last vertex (close loop)
7777
if boundary[0] == boundary[-1]:
7878
del boundary[-1]
7979

8080
# Sort the breakpoints based on their index in the boundary
81-
breakpoints = sorted(breakpoints, key=lambda s: boundary.index(s))
82-
8381
# Find the starting point in the boundary for the first breakpoint
84-
start = boundary.index(breakpoints[0])
85-
8682
# Rearrange the boundary to start from the first breakpoint
83+
breakpoints = sorted(breakpoints, key=lambda s: boundary.index(s))
84+
start = boundary.index(breakpoints[0])
8785
boundary = boundary[start:] + boundary[:start]
8886

8987
# Iterate over pairs of breakpoints and create sub-boundaries from the main boundary
@@ -123,8 +121,8 @@ thrustdiagram: FormDiagram = thrustobject.mesh
123121

124122
mesh: Mesh = thrustdiagram.copy(cls=Mesh)
125123

126-
# for face in list(mesh.faces_where(_is_loaded=False)):
127-
# mesh.delete_face(face)
124+
for face in list(mesh.faces_where(_is_loaded=False)):
125+
mesh.delete_face(face)
128126

129127
# =============================================================================
130128
# Mesh: Borders

0 commit comments

Comments
 (0)