compas_cem.viewers
¤
Three-dimensional viewing of topology and form diagrams.
Classes¤
DiagramObject
¤
DiagramObject(
nodetext=None,
edgetext=None,
loadscale=1.0,
loadtol=0.001,
residualscale=1.0,
residualtol=0.001,
show_loads=True,
show_residuals=True,
show_nodetext=False,
show_edgetext=False,
textsize=50,
textcolor=None,
**kwargs,
)
A scene object that draws a diagram in a viewer.
Parameters:
-
nodetext–A tag naming what to label the nodes with, or a mapping of nodes to labels.
-
edgetext–A tag naming what to label the edges with, or a mapping of edges to labels.
-
loadscale–The factor to scale the load vectors by.
-
loadtol–The smallest load magnitude worth drawing.
-
residualscale–The factor to scale the residual force vectors by.
-
residualtol–The smallest residual force magnitude worth drawing.
-
show_loads–Whether to draw the loads.
-
show_residuals–Whether to draw the residual forces.
-
show_nodetext–Whether to draw the node labels.
-
show_edgetext–Whether to draw the edge labels.
-
textsize–The height of the labels.
-
textcolor–The color of the labels.
Notes
The loads, the residual forces and the labels are added as children of this object, so they follow it when it is shown, hidden or removed.
Source code in src/compas_cem/viewers/scene_objects.py
Attributes¤
Methods:¤
draw
¤
Draw the diagram, its forces and its labels.
Source code in src/compas_cem/viewers/scene_objects.py
draw_edgetext
¤
Draw the labels of the edges.
Source code in src/compas_cem/viewers/scene_objects.py
draw_loads
¤
Draw the loads applied to the nodes as arrows.
Source code in src/compas_cem/viewers/scene_objects.py
draw_nodetext
¤
Draw the labels of the nodes.
Source code in src/compas_cem/viewers/scene_objects.py
draw_residuals
¤
Draw the residual forces at the nodes as arrows.
Source code in src/compas_cem/viewers/scene_objects.py
edge_colors
¤
The color of every edge.
Returns:
-
colors–A mapping of edges to colors.
edge_textlabel_formatters
¤
The supported edge label tags and the formatter of each.
Source code in src/compas_cem/viewers/scene_objects.py
edge_textlabels
¤
Build the labels to draw on the edges.
Parameters:
-
tag–A tag naming what to label the edges with, or a mapping of edges to labels, which is returned unchanged.
Returns:
-
labels–A mapping of edges to labels, or
Noneif the tag is unsupported.
Source code in src/compas_cem/viewers/scene_objects.py
node_colors
¤
The color of every node.
Returns:
-
colors–A mapping of nodes to colors.
node_textlabel_formatters
¤
The supported node label tags and the formatter of each.
Source code in src/compas_cem/viewers/scene_objects.py
node_textlabels
¤
Build the labels to draw on the nodes.
Parameters:
-
tag–A tag naming what to label the nodes with, or a mapping of nodes to labels, which is returned unchanged.
Returns:
-
labels–A mapping of nodes to labels, or
Noneif the tag is unsupported.
Source code in src/compas_cem/viewers/scene_objects.py
FormDiagramObject
¤
FormDiagramObject(
nodetext=None,
edgetext=None,
loadscale=1.0,
loadtol=0.001,
residualscale=1.0,
residualtol=0.001,
show_loads=True,
show_residuals=True,
show_nodetext=False,
show_edgetext=False,
textsize=50,
textcolor=None,
**kwargs,
)
A scene object that draws a form diagram in a viewer.
Source code in src/compas_cem/viewers/scene_objects.py
TopologyDiagramObject
¤
TopologyDiagramObject(
nodetext=None,
edgetext=None,
loadscale=1.0,
loadtol=0.001,
residualscale=1.0,
residualtol=0.001,
show_loads=True,
show_residuals=True,
show_nodetext=False,
show_edgetext=False,
textsize=50,
textcolor=None,
**kwargs,
)
A scene object that draws a topology diagram in a viewer.
Source code in src/compas_cem/viewers/scene_objects.py
Attributes¤
Methods:¤
edge_colors
¤
Color the edges by their type.
Notes
Direct and indirect deviation edges are told apart only once the trails have been built, because the distinction is drawn from the sequence the two end nodes belong to.
Source code in src/compas_cem/viewers/scene_objects.py
edge_textlabel_formatters
¤
The supported edge label tags and the formatter of each.
Source code in src/compas_cem/viewers/scene_objects.py
node_colors
¤
Color the support and the origin nodes apart from the rest.