MeshTable¶
- class py3dm.MeshTable¶
Python wrapper providing access to
ON_Meshobjects stored in anONX_Model.This class offers a convenient interface for adding, retrieving, counting, and iterating over mesh objects.
MeshTabledoes not own the underlying data; it operates on the associatedONX_Modelinstance.- __iter__() collections.abc.Iterator[MeshView]¶
- add(obj_attr: ObjectAttributes) uuid.UUID¶
- add(mesh: Mesh, obj_attr: None | ObjectAttributes = None) uuid.UUID
- add(initial_face_array_capacity: int, initial_vertex_array_capacity: int, has_vertex_normals: bool, has_texture_coordinates: bool, obj_attr: None | ObjectAttributes = None) uuid.UUID
Returns the
UUIDof the mesh in case of successful addition, or an emptyUUIDotherwise. If the mesh is in the model, then theUUIDis unique for all components in the model and is locked.
- get_by_uuid(object_uuid: uuid.UUID) Mesh | None¶
Returns the object with the given
object_uuidorNoneifobject_uuidis not found.
- get_by_uuid_exclusive(object_uuid: uuid.UUID) MeshView | None¶
Returns the object with the given
object_uuidorNoneifobject_uuidis not found.Notes
From opennurbs documentation (
ON_ModelGeometryComponent::ExclusiveGeometry()): Get a pointer to geometry that can be used to modify the geometry. The returned pointer is not shared at the time it is returned and will not be shared until a copy of thisON_ModelGeometryComponentis created. If thisON_ModelGeometryComponentis the only reference to the geometry, then a pointer to the geometry is returned. Otherwise,nullptris returned.