Skip to content

Contact Layer¤

compas_model.viewer.contactlayer ¤

Classes¤

ContactLayer ¤

ContactLayer(controller: Any, show: bool = True)

Scene representation of contacts stored in a model interaction graph.

Each planar region receives its own scene object. This intentionally avoids merging contact meshes because a merged buffer cannot support independent picking or visibility.

Attributes¤
selected_keys property ¤
selected_keys: tuple[ContactKey, ...]

Keys of contact regions selected in the viewport.

Methods:¤
keys_for_edge ¤
keys_for_edge(edge: tuple[int, int]) -> tuple[ContactKey, ...]

Return contact keys belonging to an interaction edge.

select ¤
select(keys: Iterable[ContactKey], clear: bool = True) -> None

Set selection on contact-region scene objects.

set_all_visible ¤
set_all_visible(visible: bool) -> None

Set visibility of the complete contact layer.

set_visibility ¤
set_visibility(keys: Iterable[ContactKey], visible: bool) -> None

Set visibility of individual contact regions.

view ¤
view(key: ContactKey) -> ContactView

Return the view of one graph-edge contact region.

ContactView dataclass ¤

ContactView(
    key: ContactKey,
    elements: tuple[Element, Element],
    contact: Contact,
    scene_object: Any,
)

One independently selectable contact-region scene object.