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

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_edgelabels

Clear all objects contained in the edgelabel collection.

clear_edges

Clear all objects contained in the edge collection.

clear_nodelabels

Clear all objects contained in the nodelabel collection.

clear_nodes

Clear all objects contained in the node collection.

draw

Draw the network.

draw_edgelabels

Draw labels for a selection of edges.

draw_edges

Draw a selection of edges.

draw_nodelabels

Draw labels for a selection nodes.

draw_nodes

Draw a selection of nodes.

Inherited Methods

build

Build an artist corresponding to the item type.

build_as

Build an artist with the given type.

clear

Clear the nodes and the edges of the network.

draw_collection

Drawing method for drawing an entire collection of objects.

redraw

Redraw the view.

register

Register an artist type to a data type.