Skip to content

Commit a199c81

Browse files
committed
update to latest repo structure and package versions
1 parent 72f62b9 commit a199c81

38 files changed

+679
-625
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# COMPAS Formfinder for Rhino
22

33
> [!NOTE]
4-
> The current version of COMPAS-FormFinder on the Yak package server is `0.2.62`.
4+
> The current version of COMPAS-FormFinder on the Yak package server is `0.2.71`.
55
> Note that this is still a pre-release!
66
77
![COMPAS FormFinder](compas-FoFin.png)

plugin/FF.py renamed to commands/FF.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#! python3
2-
# venv: formfinder
3-
# r: compas>=2.4, compas_dr>=0.3, compas_fd>=0.5.2, compas_rui>=0.3, compas_session>=0.3
2+
# venv: brg-csd
43

54
import pathlib
65

@@ -10,8 +9,6 @@
109
import Rhino.UI # type: ignore
1110
import System # type: ignore
1211

13-
import compas_fofin
14-
1512
pluginfile = Rhino.PlugIns.PlugIn.PathFromId(System.Guid("5df3b821-822e-49e0-b24e-aebbe671c3d1"))
1613
shared = pathlib.Path(str(pluginfile)).parent / "shared"
1714

@@ -46,8 +43,8 @@ def show(self):
4643
return self.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow)
4744

4845

49-
def RunCommand(is_interactive):
50-
form = SplashForm(title=compas_fofin.title, url=str(shared / "index.html"))
46+
def RunCommand():
47+
form = SplashForm(title="FormFinder", url=str(shared / "index.html"))
5148
form.show()
5249

5350

@@ -56,4 +53,4 @@ def RunCommand(is_interactive):
5653
# =============================================================================
5754

5855
if __name__ == "__main__":
59-
RunCommand(True)
56+
RunCommand()

plugin/FF_anchors.py renamed to commands/FF_anchors.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! python3
2-
# venv: formfinder
3-
# r: compas>=2.4, compas_dr>=0.3, compas_fd>=0.5.2, compas_rui>=0.3, compas_session>=0.3
2+
# venv: brg-csd
3+
# r: compas_dr>=0.3, compas_fd>=0.5.2, compas_session>=0.4.5
44

55
import rhinoscriptsyntax as rs # type: ignore
66

@@ -9,16 +9,14 @@
99
from compas_fofin.solvers import AutoUpdateFD
1010

1111

12-
def RunCommand(is_interactive):
12+
def RunCommand():
1313
session = FoFinSession()
1414

1515
# =============================================================================
1616
# Load stuff from session
1717
# =============================================================================
1818

19-
scene = session.scene()
20-
21-
meshobj: RhinoCableMeshObject = scene.get_node_by_name(name="CableMesh")
19+
meshobj: RhinoCableMeshObject = session.scene.get_node_by_name(name="CableMesh")
2220
if not meshobj:
2321
return
2422

@@ -28,7 +26,7 @@ def RunCommand(is_interactive):
2826

2927
meshobj.clear_conduits()
3028

31-
meshobj.display_edges_conduit()
29+
meshobj.display_edges_conduit(thickness=session.settings.drawing.edge_thickness)
3230
meshobj.display_mesh_conduit()
3331

3432
# =============================================================================
@@ -53,15 +51,19 @@ def RunCommand(is_interactive):
5351
return
5452

5553
if option == "Add":
56-
selectable = list(meshobj.mesh.vertices())
57-
selected = meshobj.select_vertices(selectable)
54+
meshobj.show_vertices = list(meshobj.mesh.vertices())
55+
meshobj.redraw_vertices()
56+
57+
selected = meshobj.select_vertices()
5858

5959
if selected:
6060
meshobj.mesh.vertices_attribute("is_support", True, keys=selected)
6161

6262
elif option == "Remove":
63-
selectable = list(meshobj.mesh.vertices_where(is_support=True))
64-
selected = meshobj.select_vertices(selectable)
63+
meshobj.show_vertices = list(meshobj.mesh.vertices_where(is_support=True))
64+
meshobj.redraw_vertices()
65+
66+
selected = meshobj.select_vertices()
6567

6668
if selected:
6769
meshobj.mesh.vertices_attribute("is_support", False, keys=selected)
@@ -86,14 +88,14 @@ def RunCommand(is_interactive):
8688
meshobj.show_faces = False
8789
meshobj.draw()
8890
meshobj.display_forces_conduit(tmax=session.settings.display.tmax)
89-
meshobj.display_reactions_conduit()
91+
meshobj.display_reactions_conduit(scale=session.settings.drawing.scale_reactions)
9092

9193
else:
9294
meshobj.show_vertices = list(meshobj.mesh.vertices_where(is_support=True))
9395
meshobj.show_edges = False
9496
meshobj.show_faces = False
9597
meshobj.draw()
96-
meshobj.display_edges_conduit()
98+
meshobj.display_edges_conduit(thickness=session.settings.drawing.edge_thickness)
9799

98100
meshobj.display_mesh_conduit()
99101

@@ -110,4 +112,4 @@ def RunCommand(is_interactive):
110112
# =============================================================================
111113

112114
if __name__ == "__main__":
113-
RunCommand(True)
115+
RunCommand()

plugin/FF_anchors_constraints.py renamed to commands/FF_anchors_constraints.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! python3
2-
# venv: formfinder
3-
# r: compas>=2.4, compas_dr>=0.3, compas_fd>=0.5.2, compas_rui>=0.3, compas_session>=0.3
2+
# venv: brg-csd
3+
# r: compas_dr>=0.3, compas_fd>=0.5.2, compas_session>=0.4.5
44

55
import rhinoscriptsyntax as rs # type: ignore
66

@@ -14,16 +14,14 @@
1414
from compas_fofin.solvers import AutoUpdateFD
1515

1616

17-
def RunCommand(is_interactive):
17+
def RunCommand():
1818
session = FoFinSession()
1919

2020
# =============================================================================
2121
# Load stuff from session
2222
# =============================================================================
2323

24-
scene = session.scene()
25-
26-
meshobj: RhinoCableMeshObject = scene.find_by_name(name="CableMesh")
24+
meshobj: RhinoCableMeshObject = session.scene.find_by_name(name="CableMesh")
2725
if not meshobj:
2826
return
2927

@@ -33,7 +31,7 @@ def RunCommand(is_interactive):
3331

3432
meshobj.clear_conduits()
3533

36-
meshobj.display_edges_conduit()
34+
meshobj.display_edges_conduit(thickness=session.settings.drawing.edge_thickness)
3735
meshobj.display_mesh_conduit()
3836

3937
# =============================================================================
@@ -47,16 +45,20 @@ def RunCommand(is_interactive):
4745
return
4846

4947
if option == "Remove":
50-
selectable = list(meshobj.mesh.vertices_where(is_support=True))
51-
selected = meshobj.select_vertices(selectable)
48+
meshobj.show_vertices = list(meshobj.mesh.vertices_where(is_support=True))
49+
meshobj.redraw_vertices()
50+
51+
selected = meshobj.select_vertices()
5252

5353
if selected:
5454
for vertex in selected:
5555
meshobj.mesh.unset_vertex_attribute(vertex, "constraint")
5656

5757
elif option == "Add":
58-
selectable = list(meshobj.mesh.vertices())
59-
selected = meshobj.select_vertices(selectable)
58+
meshobj.show_vertices = list(meshobj.mesh.vertices())
59+
meshobj.redraw_vertices()
60+
61+
selected = meshobj.select_vertices()
6062

6163
if selected:
6264
meshobj.show_vertices = selected
@@ -86,7 +88,7 @@ def RunCommand(is_interactive):
8688
if not constraint:
8789
curve = compas_rhino.conversions.curveobject_to_compas(robj)
8890
constraint = Constraint(curve)
89-
sceneobject = scene.add(constraint, color=Color.cyan())
91+
sceneobject = session.scene.add(constraint, color=Color.cyan())
9092
sceneobject.draw()
9193

9294
robj = compas_rhino.objects.find_object(sceneobject.guids[0])
@@ -125,14 +127,14 @@ def RunCommand(is_interactive):
125127
meshobj.show_faces = False
126128
meshobj.draw()
127129
meshobj.display_forces_conduit(tmax=session.settings.display.tmax)
128-
meshobj.display_reactions_conduit()
130+
meshobj.display_reactions_conduit(scale=session.settings.drawing.scale_reactions)
129131

130132
else:
131133
meshobj.show_vertices = list(meshobj.mesh.vertices_where(is_support=True))
132134
meshobj.show_edges = False
133135
meshobj.show_faces = False
134136
meshobj.draw()
135-
meshobj.display_edges_conduit()
137+
meshobj.display_edges_conduit(thickness=session.settings.drawing.edge_thickness)
136138

137139
meshobj.display_mesh_conduit()
138140

@@ -149,4 +151,4 @@ def RunCommand(is_interactive):
149151
# =============================================================================
150152

151153
if __name__ == "__main__":
152-
RunCommand(True)
154+
RunCommand()

plugin/FF_anchors_move.py renamed to commands/FF_anchors_move.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! python3
2-
# venv: formfinder
3-
# r: compas>=2.4, compas_dr>=0.3, compas_fd>=0.5.2, compas_rui>=0.3, compas_session>=0.3
2+
# venv: brg-csd
3+
# r: compas_dr>=0.3, compas_fd>=0.5.2, compas_session>=0.4.5
44

55
import rhinoscriptsyntax as rs # type: ignore
66

@@ -9,16 +9,14 @@
99
from compas_fofin.solvers import AutoUpdateFD
1010

1111

12-
def RunCommand(is_interactive):
12+
def RunCommand():
1313
session = FoFinSession()
1414

1515
# =============================================================================
1616
# Load stuff from session
1717
# =============================================================================
1818

19-
scene = session.scene()
20-
21-
meshobj: RhinoCableMeshObject = scene.find_by_name(name="CableMesh")
19+
meshobj: RhinoCableMeshObject = session.scene.find_by_name(name="CableMesh")
2220
if not meshobj:
2321
return
2422

@@ -28,7 +26,7 @@ def RunCommand(is_interactive):
2826

2927
meshobj.clear_conduits()
3028

31-
meshobj.display_edges_conduit()
29+
meshobj.display_edges_conduit(thickness=session.settings.drawing.edge_thickness)
3230
meshobj.display_mesh_conduit()
3331

3432
# =============================================================================
@@ -42,8 +40,10 @@ def RunCommand(is_interactive):
4240
if not option:
4341
return
4442

45-
selectable = list(meshobj.mesh.vertices_where(is_support=True))
46-
selected = meshobj.select_vertices(selectable)
43+
meshobj.show_vertices = list(meshobj.mesh.vertices_where(is_support=True))
44+
meshobj.redraw_vertices()
45+
46+
selected = meshobj.select_vertices()
4747

4848
if selected:
4949
if option == "Free":
@@ -69,14 +69,14 @@ def RunCommand(is_interactive):
6969
meshobj.show_faces = False
7070
meshobj.draw()
7171
meshobj.display_forces_conduit(tmax=session.settings.display.tmax)
72-
meshobj.display_reactions_conduit()
72+
meshobj.display_reactions_conduit(scale=session.settings.drawing.scale_reactions)
7373

7474
else:
7575
meshobj.show_vertices = list(meshobj.mesh.vertices_where(is_support=True))
7676
meshobj.show_edges = False
7777
meshobj.show_faces = False
7878
meshobj.draw()
79-
meshobj.display_edges_conduit()
79+
meshobj.display_edges_conduit(thickness=session.settings.drawing.edge_thickness)
8080

8181
meshobj.display_mesh_conduit()
8282

@@ -89,8 +89,8 @@ def RunCommand(is_interactive):
8989

9090

9191
# =============================================================================
92-
# Run as main
92+
# Main
9393
# =============================================================================
9494

9595
if __name__ == "__main__":
96-
RunCommand(True)
96+
RunCommand()

plugin/FF_anchors_update.py renamed to commands/FF_anchors_update.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
#! python3
2-
# venv: formfinder
3-
# r: compas>=2.4, compas_dr>=0.3, compas_fd>=0.5.2, compas_rui>=0.3, compas_session>=0.3
2+
# venv: brg-csd
3+
# r: compas_dr>=0.3, compas_fd>=0.5.2, compas_session>=0.4.5
44

55
from compas_fofin.scene import RhinoCableMeshObject
66
from compas_fofin.scene import RhinoConstraintObject
77
from compas_fofin.session import FoFinSession
88
from compas_fofin.solvers import AutoUpdateFD
99

1010

11-
def RunCommand(is_interactive):
11+
def RunCommand():
1212
session = FoFinSession()
1313

1414
# =============================================================================
1515
# Load stuff from session
1616
# =============================================================================
1717

18-
scene = session.scene()
19-
20-
meshobj: RhinoCableMeshObject = scene.get_node_by_name(name="CableMesh")
18+
meshobj: RhinoCableMeshObject = session.scene.get_node_by_name(name="CableMesh")
2119
if not meshobj:
2220
return
2321

@@ -27,14 +25,14 @@ def RunCommand(is_interactive):
2725

2826
meshobj.clear_conduits()
2927

30-
meshobj.display_edges_conduit()
28+
meshobj.display_edges_conduit(thickness=session.settings.drawing.edge_thickness)
3129
meshobj.display_mesh_conduit()
3230

3331
# =============================================================================
3432
# Update Constraints
3533
# =============================================================================
3634

37-
for sceneobject in scene.objects:
35+
for sceneobject in session.scene.objects:
3836
if isinstance(sceneobject, RhinoConstraintObject):
3937
sceneobject.update_constraint_geometry()
4038

@@ -56,14 +54,14 @@ def RunCommand(is_interactive):
5654
meshobj.show_faces = False
5755
meshobj.draw()
5856
meshobj.display_forces_conduit(tmax=session.settings.display.tmax)
59-
meshobj.display_reactions_conduit()
57+
meshobj.display_reactions_conduit(scale=session.settings.drawing.scale_reactions)
6058

6159
else:
6260
meshobj.show_vertices = list(meshobj.mesh.vertices_where(is_support=True))
6361
meshobj.show_edges = False
6462
meshobj.show_faces = False
6563
meshobj.draw()
66-
meshobj.display_edges_conduit()
64+
meshobj.display_edges_conduit(thickness=session.settings.drawing.edge_thickness)
6765

6866
meshobj.display_mesh_conduit()
6967

@@ -80,4 +78,4 @@ def RunCommand(is_interactive):
8078
# =============================================================================
8179

8280
if __name__ == "__main__":
83-
RunCommand(True)
81+
RunCommand()

0 commit comments

Comments
 (0)