ViewerSceneObject

class ViewerSceneObject[source]

Bases: SceneObject

Base class for all Viewer scene objects which also includes the GL buffer creation and drawing methods.

Parameters:
viewercompas_viewer.viewer.Viewer

The viewer object.

is_selectedbool

Whether the object is selected.

is_lockedbool

Whether the object is locked.

is_visiblebool

Whether to show object.

show_pointsbool, optional

Whether to show points/vertices of the object. It will override the value in the config file.

show_linesbool, optional

Whether to show lines/edges of the object. It will override the value in the config file.

show_facesbool, optional

Whether to show faces of the object. It will override the value in the config file.

pointscolorUnion[compas.colors.Color, dict[Any, compas.colors.Color]], optional

The color or the dict of colors of the points. It will override the value in the config file.

linescolorUnion[compas.colors.Color, dict[Any, compas.colors.Color]], optional

The color or the dict of colors of the lines. It will override the value in the config file.

facescolorUnion[compas.colors.Color, dict[Any, compas.colors.Color]], optional

The color or the dict of colors the faces. It will override the value in the config file.

lineswidthfloat, optional

The line width to be drawn on screen. It will override the value in the config file.

pointssizefloat, optional

The point size to be drawn on screen. It will override the value in the config file.

opacityfloat, optional

The opacity of the object. It will override the value in the config file.

config: :class:`compas_viewer.configurations.scene_config.SceneConfig`.

The configuration of the scene object. Defaults to None. It should be assigned though the compas_viewer.viewer.Viewer.add method. Otherwise a exception will be raised.

**kwargsdict, optional

Additional visualization options for specific objects.

Attributes:
is_selectedbool

Whether the object is selected.

is_lockedbool

Whether the object is locked (selectable). The global grid is a typical object that is not selectable.

is_visiblebool

Whether to show object.

show_pointsbool

Whether to show points/vertices of the object.

show_linesbool

Whether to show lines/edges of the object.

show_facesbool

Whether to show faces of the object.

pointscolordict[Any, compas.colors.Color]

The color of the points.

linescolordict[Any, compas.colors.Color]

The color of the lines.

facescolordict[Any, compas.colors.Color]

The color of the faces.

lineswidthfloat

The line width to be drawn on screen

pointssizefloat

The point size to be drawn on screen.

opacityfloat

The opacity of the object.

backgroundbool

Whether the object is drawn on the background with depth test disabled.

bounding_boxlist[float], read-only

The min and max corners of object bounding box, as a numpy array of shape (2, 3).

bounding_box_centercompas.geometry.Point, read-only

The center of object bounding box, as a point.

Methods

clear

Clear the object

draw

Draw the object from its buffers

draw_instance

Draw the object instance for picking

init

Initialize the object

make_buffer_from_data

Create buffers from point/line/face data.

make_buffers

Create all buffers from object's data

update

Update the object

update_buffer_from_data

Update existing buffers from point/line/face data.

update_buffers

Update all buffers from object's data

Inherited Methods

add

Add a child item to the scene object.