compas_cem.elements
¤
The nodes and the trail and deviation edges a topology diagram is built from.
Classes¤
DeviationEdge
¤
An edge that carries a prescribed force between two trails.
Parameters:
-
u–The key of the first node of the edge.
-
v–The key of the second node of the edge.
-
force–The signed force in the edge. A negative value puts the edge in compression, and a positive value in tension.
Notes
A deviation edge is direct when both of its nodes belong to the same sequence, and indirect otherwise. That distinction is drawn from the topology diagram rather than from the edge itself.
Source code in src/compas_cem/elements/deviation.py
Edge
¤
The base class shared by trail and deviation edges.
Parameters:
-
u–The key of the first node of the edge.
-
v–The key of the second node of the edge.
-
attrs–The attributes to store on the edge.
Notes
A node key here may also be a set of coordinates. A diagram resolves those to an existing node, or creates one, when the edge is added.
Source code in src/compas_cem/elements/edge.py
Methods:¤
__iter__
¤
Iterates over the start and end nodes of an edge.
Yields:
-
key–The next node key.
from_line
classmethod
¤
Create an edge from a line described by two xyz coordinates.
Parameters:
-
line–The two end points of the line.
-
**kwargs–Extra keyword arguments passed to the constructor.
Returns:
-
edge–An edge whose two nodes are the end points of the line.
Source code in src/compas_cem/elements/edge.py
Node
¤
A point in space that a diagram can be built around.
Parameters:
-
key–The key to register the node under. If
None, the diagram assigns the next available key when the node is added. -
xyz–The coordinates of the node.
Source code in src/compas_cem/elements/node.py
Methods:¤
from_point
classmethod
¤
Create a node from a point described by its xyz coordinates.
Parameters:
-
point–The coordinates of the point.
-
*args–Additional arguments, ignored.
-
**kwargs–Extra keyword arguments, ignored.
Returns:
-
node–A node with no key, sitting at the given point.
Source code in src/compas_cem/elements/node.py
TrailEdge
¤
An edge that advances a trail by a prescribed length.
Parameters:
-
u–The key of the first node of the edge.
-
v–The key of the second node of the edge.
-
length–The signed length of the edge. A negative value puts the edge in compression, and a positive value in tension.
-
plane–A plane to intersect the trail with instead of advancing it by a fixed length.
Notes
A plane overrides the absolute length of the edge, but the sign of the length is preserved, so the combinatorial state survives the intersection.
TODO: add an explicit combinatorial state to the signature of the constructor.