Object

class Object[source]

Bases: abc.ABC

Base object for compas_view2

Parameters
data: :class:`compas.data.Data`

A COMPAS data object.

is_selectedbool, optional

Whether the object is selected. Default to False.

is_visiblebool, optional

Whether to show object. Default to True.

show_pointsbool, optional

Whether to show points/vertices of the object. Default to False.

show_linesbool, optional

Whether to show lines/edges of the object. Default to True.

show_facesbool, optional

Whether to show faces of the object. Default to True.

pointcolorUnion[Color, Dict[Union[str, int], Color]], optional

The color or the dict of colors of the points. Default to compas_view2.objects.Object.default_color_points.

linecolorUnion[Color, Dict[Union[str, int], Color]], optional

The color or the dict of colors of the lines. Default to compas_view2.objects.Object.default_color_lines.

facecolorUnion[Color, Dict[Union[str, int], Color]], optional

The color or the dict of colors the faces. Default to compas_view2.objects.Object.default_color_faces.

linewidthint, optional

The line width to be drawn on screen Default to 1.

pointsizeint, optional

The point size to be drawn on screen Default to 10.

opacityfloat, optional

The opacity of the object. Default to 1.0.

**kwargsdict, optional

Additional visualization options for specific objects.

Attributes
is_selectedbool

Whether the object is selected.

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.

pointcolorcompas.color.Color

The color of the points.

linecolorcompas.color.Color

The color of the lines.

facecolorcompas.color.Color

The color of the faces.

pointcolorsDict[Union[str, int], Color]

The color dict of individual points.

linecolorsDict[Union[str, int], Color]

The color dict of individual lines.

facecolorsDict[Union[str, int], Color]

The color dict of individual faces.

linewidthint

The line width to be drawn on screen.

pointsizeint

The point size to be drawn on screen.

opacityfloat

The opacity of the object.

backgroundbool

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

bounding_boxnumpy.array, read-only

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

bounding_box_centernumpy.array, read-only

The center of object bounding box, as a numpy array of shape (3,).

matrixnumpy.array

Get the updated matrix from object’s translation, rotation and scale

translationnumpy.array

The translation vector of the object.

rotationnumpy.array

The euler rotation vector of the object.

scalenumpy.array

The scale vector of the object.

propertieslist, read-only

The list of object-specific properties.

otypeclass

The data class of the object.

Methods

add

build

Build an object class according to its corrensponding data type

create

draw

init

register

Register an object class to its corrensponding data type

remove