NetworkArtist

class compas_blender.artists.NetworkArtist(item, **kwargs)[source]

Bases: BlenderArtist, NetworkArtist

Artist for drawing network data structures in Blender.

Parameters
  • network (Network) – A COMPAS network.

  • collection (str | bpy.types.Collection) – The name of the collection the object belongs to.

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.