NetworkArtist
- class compas_blender.artists.NetworkArtist(*args, **kwargs)[source]
Bases:
BlenderArtist
,NetworkArtist
Artist for drawing network data structures in Blender.
- Parameters
network (
compas.datastructures.Network
) – A COMPAS network.collection (str or bpy.types.Collection) – The name of the collection the object belongs to.
nodes (list[hashable], optional) – A list of node identifiers. Default is None, in which case all nodes are drawn.
edges (list[tuple[hashable, hashable]], optional) – A list of edge keys (as uv pairs) identifying which edges to draw. The default is None, in which case all edges are drawn.
nodecolor (rgb-tuple or dict[hashable, rgb-tuple], optional) – The color specification for the nodes.
edgecolor (rgb-tuple or dict[tuple[hashable, hashable]], rgb-tuple], optional) – The color specification for the edges.
show_nodes (bool, optional) – If True, draw the nodes of the network.
show_edges (bool, optional) – If True, draw the edges of the network.
- Attributes
nodecollection (bpy.types.Collection) – The collection containing the nodes.
edgecollection (bpy.types.Collection) – The collection containing the edges.
nodelabelcollection (bpy.types.Collection) – The collection containing the node labels.
edgelabelcollection (bpy.types.Collection) – The collection containing the edge labels.
Examples
Use the Blender artist explicitly.
import compas from compas.datastructures import Network from compas_blender.artists import NetworkArtist network = Network.from_obj(compas.get('lines.obj')) artist = NetworkArtist(network) artist.draw()
Or, use the artist through the plugin mechanism.
import compas from compas.datastructures import Network from compas.artists import Artist network = Network.from_obj(compas.get('lines.obj')) artist = Artist(network) artist.draw()
Methods
Clear all objects contained in the edgelabel collection.
Clear all objects contained in the edge collection.
Clear all objects contained in the nodelabel collection.
Clear all objects contained in the node collection.
Draw the network.
Draw labels for a selection of edges.
Draw a selection of edges.
Draw labels for a selection nodes.
Draw a selection of nodes.
Inherited Methods
Build an artist corresponding to the item type.
Build an artist with the given type.
Clear the nodes and the edges of the network.
Drawing method for drawing an entire collection of objects.
Redraw the view.
Register an artist type to a data type.