compas-cem 0.7.0__py2.py3-none-any.whl → 0.8.2__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- compas_cem/__init__.py +1 -1
- compas_cem/diagrams/diagram.py +16 -0
- compas_cem/diagrams/topology/topology.py +6 -3
- compas_cem/equilibrium/__init__.py +1 -0
- compas_cem/equilibrium/force.py +9 -3
- compas_cem/equilibrium/force_numpy.py +9 -3
- compas_cem/ghpython/components/CompasCem_ConstraintEdgeDirection/code.py +17 -0
- compas_cem/ghpython/components/CompasCem_ConstraintEdgeDirection/icon.png +0 -0
- compas_cem/ghpython/components/CompasCem_ConstraintEdgeDirection/metadata.json +35 -0
- compas_cem/ghpython/components/CompasCem_ConstraintNodePolyline/code.py +16 -0
- compas_cem/ghpython/components/CompasCem_ConstraintNodePolyline/icon.png +0 -0
- compas_cem/ghpython/components/CompasCem_ConstraintNodePolyline/metadata.json +36 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ArtistColors.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ArtistForm.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ArtistTopology.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ConstrainedFormFinding.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ConstraintDeviationEdgeLength.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ConstraintEdgeDirection.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ConstraintNodeLine.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ConstraintNodePlane.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ConstraintNodePoint.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ConstraintNodePolyline.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ConstraintReactionForce.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ConstraintTrailEdgeForce.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_DisassembleForm.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_DisassembleTopology.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_EdgeDeviation.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_EdgeTrail.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_FormFinding.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_Info.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_JSONExportDiagram.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_JSONImportForm.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_JSONImportTopology.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_NodeLoad.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_NodeSupport.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_OriginNodesMove.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ParameterDeviationEdge.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ParameterNodeLoadX.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ParameterNodeLoadY.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ParameterNodeLoadZ.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ParameterNodeOriginX.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ParameterNodeOriginY.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ParameterNodeOriginZ.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ParameterTrailEdge.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_Proxy.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ResultsEdges.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_ResultsSupportNodes.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_SearchEdgeKey.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_SearchNodeKey.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_TopologyDiagram.ghuser +0 -0
- compas_cem/ghpython/components/ghuser/CompasCem_TrailsShift.ghuser +0 -0
- compas_cem/optimization/constraints/__init__.py +2 -0
- compas_cem/optimization/constraints/direction.py +191 -0
- compas_cem/optimization/constraints/polyline.py +149 -0
- compas_cem/optimization/optimizer.py +2 -2
- compas_cem/optimization/parameters/load.py +4 -2
- compas_cem/viewers/diagramobject.py +1 -0
- compas_cem-0.8.2.dist-info/AUTHORS.rst +41 -0
- {compas_cem-0.7.0.dist-info → compas_cem-0.8.2.dist-info}/METADATA +183 -189
- {compas_cem-0.7.0.dist-info → compas_cem-0.8.2.dist-info}/RECORD +63 -54
- {compas_cem-0.7.0.dist-info → compas_cem-0.8.2.dist-info}/WHEEL +1 -1
- compas_cem-0.7.0.dist-info/AUTHORS.rst +0 -41
- compas_cem-0.7.0.dist-info/entry_points.txt +0 -3
- {compas_cem-0.7.0.dist-info → compas_cem-0.8.2.dist-info}/LICENSE +0 -0
- {compas_cem-0.7.0.dist-info → compas_cem-0.8.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,149 @@
|
|
1
|
+
from compas.geometry import closest_point_on_segment
|
2
|
+
from compas.geometry._core.distance import closest_points_in_cloud_numpy
|
3
|
+
|
4
|
+
from compas.utilities import pairwise
|
5
|
+
|
6
|
+
from compas_cem.optimization.constraints import VectorConstraint
|
7
|
+
|
8
|
+
|
9
|
+
__all__ = ["PolylineConstraint"]
|
10
|
+
|
11
|
+
|
12
|
+
class PolylineConstraint(VectorConstraint):
|
13
|
+
"""
|
14
|
+
Pulls the xyz position of a node to a target polyline.
|
15
|
+
"""
|
16
|
+
def __init__(self, node=None, polyline=None, weight=1.0):
|
17
|
+
super(PolylineConstraint, self).__init__(node, polyline, weight)
|
18
|
+
|
19
|
+
def reference(self, data):
|
20
|
+
"""
|
21
|
+
The current xyz coordinates of the node.
|
22
|
+
"""
|
23
|
+
return data["node_xyz"][self.key()]
|
24
|
+
|
25
|
+
def target(self, reference):
|
26
|
+
"""
|
27
|
+
The closest point on the target polyline.
|
28
|
+
"""
|
29
|
+
polyline = self._target
|
30
|
+
return self._closest_point_on_polyline(reference, polyline)
|
31
|
+
|
32
|
+
@staticmethod
|
33
|
+
def _closest_point_on_polyline(point, polyline):
|
34
|
+
"""
|
35
|
+
The closest point on a polyline.
|
36
|
+
|
37
|
+
Notes
|
38
|
+
-----
|
39
|
+
This is a reimplementation of a compas method.
|
40
|
+
The compas method did not support autograd transforms.
|
41
|
+
"""
|
42
|
+
cloud = []
|
43
|
+
|
44
|
+
for segment in pairwise(polyline):
|
45
|
+
cloud.append(closest_point_on_segment(point, segment))
|
46
|
+
|
47
|
+
indices = closest_points_in_cloud_numpy([point], cloud, distances=False)
|
48
|
+
|
49
|
+
return cloud[indices[0]]
|
50
|
+
|
51
|
+
|
52
|
+
if __name__ == "__main__":
|
53
|
+
|
54
|
+
from math import fabs
|
55
|
+
from math import pi
|
56
|
+
from math import sin
|
57
|
+
from math import cos
|
58
|
+
|
59
|
+
from random import choice
|
60
|
+
from random import random
|
61
|
+
from random import seed
|
62
|
+
|
63
|
+
from compas.geometry import add_vectors
|
64
|
+
from compas.geometry import Point
|
65
|
+
from compas.geometry import Polyline
|
66
|
+
|
67
|
+
from compas_cem.diagrams import TopologyDiagram
|
68
|
+
|
69
|
+
from compas_cem.elements import Node
|
70
|
+
from compas_cem.elements import TrailEdge
|
71
|
+
|
72
|
+
from compas_cem.loads import NodeLoad
|
73
|
+
|
74
|
+
from compas_cem.supports import NodeSupport
|
75
|
+
|
76
|
+
from compas_cem.optimization import Optimizer
|
77
|
+
|
78
|
+
from compas_cem.optimization import PointConstraint
|
79
|
+
from compas_cem.optimization import NodeLoadXParameter
|
80
|
+
from compas_cem.optimization import NodeLoadYParameter
|
81
|
+
|
82
|
+
from compas_cem.plotters import Plotter
|
83
|
+
|
84
|
+
# set random seed
|
85
|
+
seed(0)
|
86
|
+
|
87
|
+
# create a topology diagram
|
88
|
+
topology = TopologyDiagram()
|
89
|
+
|
90
|
+
# add nodes
|
91
|
+
num_nodes = 7
|
92
|
+
for i in range(num_nodes):
|
93
|
+
topology.add_node(Node(i, [float(i), 0.0, 0.0]))
|
94
|
+
|
95
|
+
# add edges with negative values for a compression-only structure
|
96
|
+
length = -1.0
|
97
|
+
for i, j in pairwise(range(num_nodes)):
|
98
|
+
topology.add_edge(TrailEdge(i, j, length))
|
99
|
+
|
100
|
+
# add supports
|
101
|
+
topology.add_support(NodeSupport(int(num_nodes - 1)))
|
102
|
+
|
103
|
+
# add initial load
|
104
|
+
for i in range(1, num_nodes - 1):
|
105
|
+
topology.add_load(NodeLoad(i, [-0.1, 0.0, 0.0]))
|
106
|
+
|
107
|
+
# calculate trails
|
108
|
+
topology.build_trails()
|
109
|
+
|
110
|
+
# optimization
|
111
|
+
optimizer = Optimizer()
|
112
|
+
|
113
|
+
# create point constraints at random
|
114
|
+
radius = fabs(length)
|
115
|
+
pt = [0., 0., 0.]
|
116
|
+
points = []
|
117
|
+
for i in range(1, num_nodes):
|
118
|
+
theta = 0.5 * pi * random()
|
119
|
+
x = radius * cos(theta)
|
120
|
+
y = radius * sin(theta * choice([-1., 1.]))
|
121
|
+
pt = Point(*add_vectors(pt, [x, y, 0.]))
|
122
|
+
points.append(pt)
|
123
|
+
|
124
|
+
polyline = Polyline(points)
|
125
|
+
for i in range(1, num_nodes - 1):
|
126
|
+
optimizer.add_constraint(PolylineConstraint(i, polyline))
|
127
|
+
|
128
|
+
optimizer.add_constraint(PointConstraint(num_nodes - 1, points[-1]))
|
129
|
+
|
130
|
+
for i in range(num_nodes - 1):
|
131
|
+
optimizer.add_parameter(NodeLoadXParameter(i, 0.5, 0.5))
|
132
|
+
optimizer.add_parameter(NodeLoadYParameter(i, 0.5, 0.5))
|
133
|
+
|
134
|
+
# optimize
|
135
|
+
cform = optimizer.solve(topology, "SLSQP", iters=500, verbose=True)
|
136
|
+
|
137
|
+
# plot
|
138
|
+
plotter = Plotter(figsize=(16.0, 9.0))
|
139
|
+
|
140
|
+
plotter.add(polyline, linewidth=0.5, show_points=False)
|
141
|
+
|
142
|
+
for point in points:
|
143
|
+
plotter.add(point, facecolor=(1, 0.5, 0.05))
|
144
|
+
|
145
|
+
plotter.add(topology)
|
146
|
+
plotter.add(cform)
|
147
|
+
|
148
|
+
plotter.zoom_extents()
|
149
|
+
plotter.show()
|
@@ -37,8 +37,8 @@ class Optimizer(Data):
|
|
37
37
|
def __init__(self, **kwargs):
|
38
38
|
super(Optimizer, self).__init__(**kwargs)
|
39
39
|
|
40
|
-
self.parameters =
|
41
|
-
self.constraints =
|
40
|
+
self.parameters = {}
|
41
|
+
self.constraints = {}
|
42
42
|
|
43
43
|
self.x_opt = None
|
44
44
|
self.time_opt = None
|
@@ -77,7 +77,7 @@ if __name__ == "__main__":
|
|
77
77
|
topology = TopologyDiagram()
|
78
78
|
|
79
79
|
# add nodes
|
80
|
-
num_nodes =
|
80
|
+
num_nodes = 7
|
81
81
|
for i in range(num_nodes):
|
82
82
|
topology.add_node(Node(i, [float(i), 0.0, 0.0]))
|
83
83
|
|
@@ -99,6 +99,7 @@ if __name__ == "__main__":
|
|
99
99
|
radius = fabs(length)
|
100
100
|
pt = [0., 0., 0.]
|
101
101
|
points = []
|
102
|
+
|
102
103
|
for i in range(1, num_nodes):
|
103
104
|
theta = 0.5 * pi * random()
|
104
105
|
x = radius * cos(theta)
|
@@ -112,7 +113,7 @@ if __name__ == "__main__":
|
|
112
113
|
optimizer.add_parameter(NodeLoadYParameter(i, 0.5, 0.5))
|
113
114
|
|
114
115
|
# optimize
|
115
|
-
cform = optimizer.solve(topology, "
|
116
|
+
cform = optimizer.solve(topology, "SLSQP", iters=500, verbose=True)
|
116
117
|
|
117
118
|
# plot
|
118
119
|
plotter = Plotter(figsize=(16.0, 9.0))
|
@@ -121,6 +122,7 @@ if __name__ == "__main__":
|
|
121
122
|
for point in points:
|
122
123
|
plotter.add(point, facecolor=(1, 0.5, 0.05))
|
123
124
|
|
125
|
+
plotter.add(topology)
|
124
126
|
plotter.add(cform)
|
125
127
|
|
126
128
|
plotter.zoom_extents()
|
@@ -417,6 +417,7 @@ class DiagramObject(NetworkObject):
|
|
417
417
|
continue
|
418
418
|
edge_meshes = [meshes[edge] for edge in edges]
|
419
419
|
color = self.edge_color[edges[0]] # TODO: needs cleaner alternative
|
420
|
+
|
420
421
|
self.viewer.add(Collection(edge_meshes),
|
421
422
|
facecolor=color,
|
422
423
|
linecolor=color,
|
@@ -0,0 +1,41 @@
|
|
1
|
+
********************************************************************************
|
2
|
+
Citing
|
3
|
+
********************************************************************************
|
4
|
+
|
5
|
+
If you use **COMPAS CEM** for a project or research, please consider citing our journal paper:
|
6
|
+
|
7
|
+
.. code-block:: latex
|
8
|
+
|
9
|
+
@article{pastrana_constrainedformfinding_2022,
|
10
|
+
title = {Constrained {Form}-{Finding} of {Tension}–{Compression} {Structures} using {Automatic} {Differentiation}},
|
11
|
+
author = {Pastrana, Rafael and Ohlbrock, Patrick Ole and Oberbichler, Thomas and D’Acunto, Pierluigi and Parascho, Stefana},
|
12
|
+
journal = {Computer-Aided Design},
|
13
|
+
doi = {10.1016/j.cad.2022.103435},
|
14
|
+
volume = {155},
|
15
|
+
issn = {0010-4485},
|
16
|
+
url = {https://www.sciencedirect.com/science/article/pii/S0010448522001683},
|
17
|
+
month = feb,
|
18
|
+
year = {2022}}
|
19
|
+
|
20
|
+
And the code repository:
|
21
|
+
|
22
|
+
.. code-block:: latex
|
23
|
+
|
24
|
+
@software{compas_cem,
|
25
|
+
title={{COMPAS~CEM}: The {Combinatorial Equilibrium Modeling} framework for {COMPAS}},
|
26
|
+
author={Pastrana, Rafael and
|
27
|
+
Ohlbrock, Patrick Ole and
|
28
|
+
D'Acunto, Pierluigi and
|
29
|
+
Parascho, Stefana},
|
30
|
+
year={2021},
|
31
|
+
doi={10.5281/zenodo.5705740},
|
32
|
+
url={https://arpastrana.github.io/compas\_cem}}
|
33
|
+
|
34
|
+
|
35
|
+
Authors
|
36
|
+
=======
|
37
|
+
|
38
|
+
* Rafael Pastrana <arpastrana@princeton> `@arpastrana <https://github.com/arpastrana>`_
|
39
|
+
* Ole Ohlbrock <ohlbrock@arch.ethz.ch> `@OleOhlbrock <https://github.com/OleOhlbrock>`_
|
40
|
+
* Pierluigi D'Acunto <pierluigidacunto@tum.de> `@pierluigidacunto <https://github.com/pierluigidacunto>`_
|
41
|
+
* Stefana Parascho <stefana.parascho@epfl.ch> `@stefanaparascho <https://github.com/stefanaparascho>`_
|
@@ -1,189 +1,183 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: compas-cem
|
3
|
-
Version: 0.
|
4
|
-
Summary: The Combinatorial Equilibrium Modeling framework for COMPAS
|
5
|
-
Home-page: https://github.com/arpastrana/compas_cem
|
6
|
-
Author: Rafael Pastrana
|
7
|
-
Author-email: arpj@princeton.edu
|
8
|
-
License: MIT license
|
9
|
-
|
10
|
-
Classifier:
|
11
|
-
Classifier:
|
12
|
-
Classifier:
|
13
|
-
Classifier:
|
14
|
-
Classifier: Operating System ::
|
15
|
-
Classifier: Operating System ::
|
16
|
-
Classifier:
|
17
|
-
Classifier: Programming Language :: Python
|
18
|
-
Classifier: Programming Language :: Python :: 3
|
19
|
-
Classifier: Programming Language :: Python :: 3.
|
20
|
-
Classifier: Programming Language :: Python ::
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
Requires-Dist: compas
|
27
|
-
Requires-Dist:
|
28
|
-
Requires-Dist:
|
29
|
-
Requires-Dist:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
:
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
:
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
:
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
:
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
:
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
:
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
..
|
67
|
-
|
68
|
-
..
|
69
|
-
..
|
70
|
-
..
|
71
|
-
..
|
72
|
-
..
|
73
|
-
..
|
74
|
-
..
|
75
|
-
..
|
76
|
-
|
77
|
-
|
78
|
-
..
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
* **
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
* `COMPAS
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
License
|
185
|
-
=======
|
186
|
-
|
187
|
-
MIT
|
188
|
-
|
189
|
-
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: compas-cem
|
3
|
+
Version: 0.8.2
|
4
|
+
Summary: The Combinatorial Equilibrium Modeling framework for COMPAS
|
5
|
+
Home-page: https://github.com/arpastrana/compas_cem
|
6
|
+
Author: Rafael Pastrana
|
7
|
+
Author-email: arpj@princeton.edu
|
8
|
+
License: MIT license
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
10
|
+
Classifier: Intended Audience :: Developers
|
11
|
+
Classifier: Topic :: Scientific/Engineering
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
13
|
+
Classifier: Operating System :: Unix
|
14
|
+
Classifier: Operating System :: POSIX
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
16
|
+
Classifier: Programming Language :: Python
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
20
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
21
|
+
Requires-Python: >=3.8
|
22
|
+
Description-Content-Type: text/markdown
|
23
|
+
License-File: LICENSE
|
24
|
+
License-File: AUTHORS.rst
|
25
|
+
Requires-Dist: numpy==1.26.3
|
26
|
+
Requires-Dist: compas==1.17.10
|
27
|
+
Requires-Dist: trimesh==3.20.0
|
28
|
+
Requires-Dist: autograd==1.5
|
29
|
+
Requires-Dist: nlopt
|
30
|
+
|
31
|
+
********************************************************************************
|
32
|
+
COMPAS CEM
|
33
|
+
********************************************************************************
|
34
|
+
|
35
|
+
.. start-badges
|
36
|
+
|
37
|
+
.. image:: https://github.com/arpastrana/compas_cem/workflows/build/badge.svg
|
38
|
+
:target: https://github.com/arpastrana/compas_cem/actions
|
39
|
+
:alt: Github Actions Build Status
|
40
|
+
|
41
|
+
.. image:: https://img.shields.io/github/license/arpastrana/compas_cem.svg
|
42
|
+
:target: https://github.com/arpastrana/compas_cem/blob/main/LICENSE
|
43
|
+
:alt: License
|
44
|
+
|
45
|
+
.. image:: https://img.shields.io/pypi/v/compas-cem.svg
|
46
|
+
:target: https://pypi.python.org/pypi/compas-cem
|
47
|
+
:alt: PyPI Package latest release
|
48
|
+
|
49
|
+
.. image:: https://img.shields.io/pypi/pyversions/compas-cem
|
50
|
+
:target: https://pypi.org/project/compas-cem
|
51
|
+
:alt: Python versions
|
52
|
+
|
53
|
+
.. image:: https://img.shields.io/badge/arXiv-2111.02607-b31b1b.svg
|
54
|
+
:target: https://arxiv.org/abs/2111.02607
|
55
|
+
:alt: ArXiv paper
|
56
|
+
|
57
|
+
.. image:: https://zenodo.org/badge/278780552.svg
|
58
|
+
:target: https://zenodo.org/badge/latestdoi/278780552
|
59
|
+
:alt: Zenodo DOI
|
60
|
+
|
61
|
+
.. end-badges
|
62
|
+
|
63
|
+
.. _COMPAS: https://compas.dev/
|
64
|
+
.. _COMPAS CEM Docs: https://arpastrana.github.io/compas_cem/latest/index.html
|
65
|
+
.. _CEM Framework: https://doi.org/10.1016/j.cad.2022.103435
|
66
|
+
.. _Rafael Pastrana: https://pastrana.xyz/
|
67
|
+
.. _Princeton: https://soa.princeton.edu/
|
68
|
+
.. _Ole Ohlbrock: https://schwartz.arch.ethz.ch/Team/patrickoleohlbrock.php?lan=en
|
69
|
+
.. _Pierluigi D'Acunto: https://www.professoren.tum.de/en/dacunto-pierluigi
|
70
|
+
.. _Stefana Parascho: https://people.epfl.ch/stefana.parascho?lang=en
|
71
|
+
.. _Anaconda: https://www.anaconda.com/
|
72
|
+
.. _Rhino: https://www.rhino3d.com/
|
73
|
+
.. _Blender: https://www.blender.org/
|
74
|
+
.. _Grasshopper: https://grasshopper3d.com/
|
75
|
+
.. _metaverse: https://apnews.com/article/meta-facebook-explaining-the-metaverse-f57e01cd5739840945e89fd668b0fa27
|
76
|
+
|
77
|
+
|
78
|
+
.. figure:: ./docs/images/staircase_24_fps_128_colors.gif
|
79
|
+
:figclass: figure
|
80
|
+
:class: figure-img img-fluid
|
81
|
+
|
82
|
+
|
83
|
+
The `Combinatorial Equilibrium Modeling (CEM) <https://doi.org/10.1016/j.cad.2022.103435>`_ framework for `COMPAS`_.
|
84
|
+
|
85
|
+
The `CEM framework`_ is a numerical form-finding approach to generate forms in static equilibrium for spatial bar structures subjected to combinations of tension-compression forces and design constraints.
|
86
|
+
**COMPAS CEM** encapsulates the `CEM framework`_ into an open-source structural design tool that enables the formulation and the solution of constrained form-finding problems in plain and simple `Python <https://www.python.org/>`_ code.
|
87
|
+
|
88
|
+
|
89
|
+
Main features
|
90
|
+
=============
|
91
|
+
|
92
|
+
* **Mix tension and compression forces:** Explore a wider spectrum of structural typologies by combining internal tension and compression forces in the same structure. Design space frames, bridges, tensegrities, and staircases and go beyond the conventional catalog of compression-only shells and cable-nets!
|
93
|
+
|
94
|
+
* **Solve constrained form-finding problems efficiently via automatic differentiation:** Generate forms in static equilibrium that simultaneously meet a priori design constraints such as best-fitting a global target shape, restraining bar lengths, and controlling the reaction forces at the supports of a structure.
|
95
|
+
|
96
|
+
* **Usable across different 3D modeling software and operating systems:** COMPAS CEM runs on Windows, MacOS and Linux (perhaps one day in the `metaverse`_) and it does not depend on any CAD software to work. However, it provides the necessary interfaces to be seamlessly used inside popular design environments like `Rhino`_, `Blender`_, and `Grasshopper`_. As a `COMPAS`_ extension, COMPAS CEM offers native integration and data exchange with other extensions and plugins in the COMPAS ecosystem.
|
97
|
+
|
98
|
+
* **Move those sliders with the Grasshopper plugin:** Are you a `Grasshopper`_ person? Worry not. COMPAS CEM is also shipped as a precooked Grasshopper plugin to readily integrate our constrained form-finding engine into your next spaghetti pipeline 🍝.
|
99
|
+
|
100
|
+
|
101
|
+
Installation
|
102
|
+
============
|
103
|
+
|
104
|
+
|
105
|
+
These are succint instructions to install **COMPAS CEM** and its `Grasshopper`_ plugin.
|
106
|
+
For detailed guidance, please refer to the `COMPAS CEM Docs`_.
|
107
|
+
|
108
|
+
Install **COMPAS CEM** in a dedicated `Anaconda`_ environment via ``pip``:
|
109
|
+
|
110
|
+
::
|
111
|
+
|
112
|
+
pip install compas-cem
|
113
|
+
|
114
|
+
To double-check that everything is up and running, type the following in the
|
115
|
+
command line and hit enter:
|
116
|
+
|
117
|
+
::
|
118
|
+
|
119
|
+
python -c "import compas_cem"
|
120
|
+
|
121
|
+
If no errors show up, celebrate 🎉! You have a working installation of **COMPAS CEM**.
|
122
|
+
|
123
|
+
|
124
|
+
Grasshopper plugin
|
125
|
+
------------------
|
126
|
+
|
127
|
+
**Warning**: Note that `Grasshopper`_ plugin of **COMPAS CEM** is only supported in **Rhino 6** and **Rhino 7**.
|
128
|
+
|
129
|
+
Once **COMPAS CEM** was installed from the comment line, we can additionally link it to `Rhino`_ and use it as `Grasshopper`_ plugin:
|
130
|
+
|
131
|
+
::
|
132
|
+
|
133
|
+
python -m compas_rhino.install -v 7.0
|
134
|
+
|
135
|
+
The flag ``-v 7.0`` indicates that we will be installing **COMPAS CEM** and company in Rhino 7. If you are working with Rhino 6, replace that last bit with ``-v 6.0``.
|
136
|
+
|
137
|
+
|
138
|
+
First steps
|
139
|
+
===========
|
140
|
+
|
141
|
+
* `COMPAS CEM Docs`_
|
142
|
+
* `COMPAS CEM Examples <https://arpastrana.github.io/compas_cem/latest/examples.html>`_
|
143
|
+
* `COMPAS CEM API Reference <https://arpastrana.github.io/compas_cem/latest/api.html>`_
|
144
|
+
* `COMPAS Tutorials <https://compas.dev/compas/latest/tutorial.html>`_
|
145
|
+
* `COMPAS API Reference <https://compas.dev/compas/latest/api.html>`_
|
146
|
+
|
147
|
+
|
148
|
+
Are you a bug hunter?
|
149
|
+
=====================
|
150
|
+
|
151
|
+
If you find a bug or want to suggest a potential enhancement,
|
152
|
+
please help us tackle it by filing a `report <https://github.com/arpastrana/compas_cem/issues>`_.
|
153
|
+
|
154
|
+
|
155
|
+
Questions and feedback
|
156
|
+
======================
|
157
|
+
|
158
|
+
We encourage the use of the `COMPAS framework forum <https://forum.compas-framework.org/>`_ for questions and discussions.
|
159
|
+
|
160
|
+
|
161
|
+
Contributing
|
162
|
+
============
|
163
|
+
|
164
|
+
Pull requests are warmly welcome! Check the `Contributor's Guide <https://github.com/arpastrana/compas_cem/blob/main/CONTRIBUTING.md>`_
|
165
|
+
for more details.
|
166
|
+
|
167
|
+
|
168
|
+
Citing
|
169
|
+
======
|
170
|
+
|
171
|
+
If you use **COMPAS CEM** for a project or research, please cite us using these `references <https://arpastrana.github.io/compas_cem/latest/citing.html>`_.
|
172
|
+
|
173
|
+
|
174
|
+
Acknowledgements
|
175
|
+
================
|
176
|
+
|
177
|
+
This work has been supported in part by the U.S. National Science Foundation under grant OAC-2118201 and the `NSF Institute for Data Driven Dynamical Design <https://www.mines.edu/id4>`_.
|
178
|
+
|
179
|
+
|
180
|
+
License
|
181
|
+
=======
|
182
|
+
|
183
|
+
MIT
|