MeshObject

class MeshObject[source]

Bases: ViewerSceneObject, MeshObject

Viewer scene object for displaying COMPAS Mesh geometry.

Parameters:
meshcompas.datastructures.Mesh

A COMPAS mesh.

vertexcolorUnion[Dict[Any, compas.colors.Color], compas.colors.Color]], optional

The vertex color. Defaults to the value of pointcolor in viewer.config.

edgecolorUnion[Dict[Any, compas.colors.Color], compas.colors.Color]], optional

The edge color. Defaults to the value of linecolor in viewer.config.

facecolorUnion[Dict[Any, compas.colors.Color], compas.colors.Color]], optional

The face color. Defaults to the value of surfacecolor in viewer.config.

hide_coplanaredgesbool, optional

True to hide the coplanar edges. Defaults to the value of hide_coplanaredges in viewer.config.

use_vertexcolorsbool, optional

True to use vertex color. Defaults to the value of use_vertexcolors in viewer.config.

**kwargsdict, optional

Additional options for the compas_viewer.scene.ViewerSceneObject and compas.scene.MeshObject.

Attributes:
meshcompas.datastructures.Mesh

The mesh data structure.

use_vertexcolorsbool

True to use vertex color. Defaults to False.

hide_coplanaredgesbool

True to hide the coplanar edges.

Methods

draw_edges

Draw the edges of the mesh.

draw_faces

Draw the faces of the mesh.

draw_vertices

Draw the vertices of the mesh.

Inherited Methods

ToString

Converts the instance to a string.

add

Add a child item to the scene object.

clear

The main clearing method.

clear_edges

Clear the edges of the mesh.

clear_faces

Clear the faces of the mesh.

clear_vertices

Clear the vertices of the mesh.

copy

Make an independent copy of the data object.

draw

Draw the object from its buffers

draw_instance

Draw the object instance for picking

draw_mesh

Draw the mesh of the mesh.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

init

Initialize the object

make_buffer_from_data

Create buffers from point/line/face data.

make_buffers

Create all buffers from object's data

remove

Remove a child node from this node.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

traverse

Traverse the tree from this node.

update

Update the object.

update_buffer_from_data

Update existing buffers from point/line/face data.

validate_data

Validate the data against the object's data schema.