Element BVH¤
compas_model.models.bvh
¤
Classes¤
ElementBVH
¤
ElementBVH(
nodetype: type[BVHNode[Element]] = ElementAABBNode,
max_depth: int | None = None,
leafsize: int = 1,
)
Methods:¤
nearby_elements
¤
Yield elements whose bounds are within an absolute distance of an element.
Parameters:
-
element(Element) –The element around which to search.
-
tolerance(float, default:0.0) –The absolute search distance.
Yields:
-
Element–Broad-phase proximity candidates, excluding
elementitself.
Raises:
-
ValueError–If
toleranceis negative.
Notes
The query expands the element's axis-aligned bounding box by
tolerance in every direction. The results are conservative: an
element may be yielded even when its geometry is farther away.
nearest_neighbors
¤
overlap_elements
¤
overlap_elements(
other: ElementBVH, *, self_collision: bool = False
) -> Iterator[tuple[Element, Element]]
Yield element pairs from overlapping BVH leaves.
Parameters:
-
other(ElementBVH) –The other element hierarchy.
-
self_collision(bool, default:False) –Enable comparison of the hierarchy with itself.
Yields:
Notes
Candidate bounding volumes overlap, but the element geometries may not. Result ordering is not part of the public contract.