Object

class compas_view2.objects.Object(data, app=None, name=None, is_selected=False, is_visible=True, show_points=False, show_lines=True, show_faces=True, pointcolor=None, linecolor=None, facecolor=None, linewidth=1, pointsize=10, opacity=1.0)[source]

Bases: ABC

Base object for compas_view2

Parameters:
  • data (compas.data.Data) – A COMPAS data object.

  • is_selected (bool, optional) – Whether the object is selected. Default to False.

  • is_visible (bool, optional) – Whether to show object. Default to True.

  • show_points (bool, optional) – Whether to show points/vertices of the object. Default to False.

  • show_lines (bool, optional) – Whether to show lines/edges of the object. Default to True.

  • show_faces (bool, optional) – Whether to show faces of the object. Default to True.

  • pointcolor (Union[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.

  • linecolor (Union[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.

  • facecolor (Union[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.

  • linewidth (int, optional) – The line width to be drawn on screen Default to 1.

  • pointsize (int, optional) – The point size to be drawn on screen Default to 10.

  • opacity (float, optional) – The opacity of the object. Default to 1.0.

  • **kwargs (dict, optional) – Additional visualization options for specific objects.

Attributes:
  • is_selected (bool) – Whether the object is selected.

  • is_visible (bool) – Whether to show object.

  • show_points (bool) – Whether to show points/vertices of the object.

  • show_lines (bool) – Whether to show lines/edges of the object.

  • show_faces (bool) – Whether to show faces of the object.

  • pointcolor (compas.color.Color) – The color of the points.

  • linecolor (compas.color.Color) – The color of the lines.

  • facecolor (compas.color.Color) – The color of the faces.

  • pointcolors (Dict[Union[str, int], Color]) – The color dict of individual points.

  • linecolors (Dict[Union[str, int], Color]) – The color dict of individual lines.

  • facecolors (Dict[Union[str, int], Color]) – The color dict of individual faces.

  • linewidth (int) – The line width to be drawn on screen.

  • pointsize (int) – The point size to be drawn on screen.

  • opacity (float) – The opacity of the object.

  • background (bool) – Whether the object is drawn on the backgound with depth test disabled.

  • bounding_box (numpy.array, read-only) – The min and max corners of object bounding box, as a numpy array of shape (2, 3).

  • bounding_box_center (numpy.array, read-only) – The center of object bounding box, as a numpy array of shape (3,).

  • matrix (numpy.array) – The transformation matrix of the object.

  • translation (numpy.array) – The translation vector of the object.

  • rotation (numpy.array) – The euler rotation vector of the object.

  • scale (numpy.array) – The scale vector of the object.

  • properties (list, read-only) – The list of object-specific properties.

  • otype (class) – The data class of the object.

  • Class Attributes

  • —————-

  • default_color_points (compas.color.Color) – The default color of the points with value rgb(0.2, 0.2, 0.2).

  • default_color_lines (compas.color.Color) – The default color of the lines with value rgb(0.4, 0.4, 0.4).

  • default_color_faces (compas.color.Color) – The default color of the faces with value rgb(0.8, 0.8, 0.8).

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