Skip to content

compas_model.scene ¤

Classes¤

ElementObject ¤

ElementObject(
    vertexcolor: Color | None = black(),
    edgecolor: Color | None = black(),
    facecolor: Color | None = white(),
    vertexsize: float | None = 1.0,
    edgewidth: float | None = 1.0,
    show_vertices: bool | None = False,
    show_edges: bool | None = True,
    show_faces: bool | None = True,
    **kwargs,
)

Base class for all element scene objects.

Parameters:

  • element (Element) –

    A COMPAS element.

Attributes:

  • element (Element) –

    The element.

  • color (Color) –

    The base RGB color of the element.

  • vertexcolor (ColorDict) –

    Vertex colors.

  • edgecolor (ColorDict) –

    Edge colors.

  • facecolor (ColorDict) –

    Face colors.

  • vertexsize (float) –

    The size of the vertices. Default is 1.0.

  • edgewidth (float) –

    The width of the edges. Default is 1.0.

  • show_vertices (Union[bool, sequence[float]]) –

    Flag for showing or hiding the vertices, or a list of keys for the vertices to show. Default is False.

  • show_edges (Union[bool, sequence[tuple[int, int]]]) –

    Flag for showing or hiding the edges, or a list of keys for the edges to show. Default is True.

  • show_faces (Union[bool, sequence[int]]) –

    Flag for showing or hiding the faces, or a list of keys for the faces to show. Default is True.

Functions¤

clear ¤
clear()

Clear all components of the element.

Returns:

  • None
draw ¤
draw()

draw the element.

Returns:

  • None

ModelObject ¤

ModelObject(**kwargs)

Functions¤

clear ¤
clear() -> None

Clear all components of the model.

Returns:

  • None
draw ¤
draw() -> None

draw the model.

Returns:

  • None