BVH
- class compas_model.datastructures.BVH(nodetype=<class 'compas_model.datastructures.bvh.AABBNode'>, max_depth=None, leafsize=1, **kwargs)
Bases:
Tree
Bounding Volume Hierarchy as a special case of a (binary) tree.
- Parameters:
Notes
This class has the following constructors:
References
…
Examples
>>>
Methods
Construct a BVH from a mesh.
Construct a BVH from a mesh.
Construct a BVH from a collection of meshes.
Construct a BVH from a mesh.
Construct a BVH from a collection of triangles.
Intersect the tree with a box to find all intersected nodes in descending order.
Intersect the tree with a line to find all intersected nodes in descending order.
Intersect the tree with a sphere to find all intersected nodes in descending order.
Rebuild the tree using the current objects.
Refit the tree to the current objects.
Inherited Methods
Converts the instance to a string.
Add a node to the tree.
Compute the axis-aligned bounding box of the datastructure.
Compute the oriented bounding box of the datastructure.
Make an independent copy of the data object.
Construct an object of this type from a JSON file.
Construct an object of this type from a JSON string.
Return string representation for the spatial hierarchy of the tree.
Get a node by its name.
Get all nodes by their name.
Remove a node from the tree.
Rotate the datastructure.
Returns a rotated copy of this geometry.
Scale the datastructure.
Returns a scaled copy of this geometry.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert the tree to a graph.
Convert an object to its native data representation and save it to a JSON file.
Convert an object to its native data representation and save it to a JSON string.
Transforms the data structure.
Transforms the data structure.
Returns a transformed copy of this data structure.
Returns a transformed copy of this data structure.
Translate the datastructure.
Returns a translated copy of this geometry.
Traverse the tree from the root node.
Validate the data against the object's data schema.