cloudViewer.geometry.HalfEdgeTriangleMesh#
- class cloudViewer.geometry.HalfEdgeTriangleMesh#
HalfEdgeTriangleMesh inherits TriangleMesh class with the addition of HalfEdge data structure for each half edge in the mesh as well as related functions.
- class Type#
Enum class for Geometry types.
- BBOX = <Type.BBOX: 35184372088835>#
- BOX = <Type.BOX: 524809>#
- CAMERA_SENSOR = <Type.CAMERA_SENSOR: 4294975489>#
- CONE = <Type.CONE: 262665>#
- CUSTOM_H_OBJECT = <Type.CUSTOM_H_OBJECT: 129>#
- CYLINDER = <Type.CYLINDER: 393737>#
- DISH = <Type.DISH: 1049097>#
- EXTRU = <Type.EXTRU: 2097673>#
- FACET = <Type.FACET: 8388609>#
- GBL_SENSOR = <Type.GBL_SENSOR: 134225921>#
- IMAGE = <Type.IMAGE: 4097>#
- IMAGE2 = <Type.IMAGE2: 562949953421315>#
- LABEL_2D = <Type.LABEL_2D: 35>#
- LINESET = <Type.LINESET: 2251799813685249>#
- MATERIAL_SET = <Type.MATERIAL_SET: 16777222>#
- MESH = <Type.MESH: 513>#
- MESH_GROUP = <Type.MESH_GROUP: 517>#
- OLD_CYLINDER_ID = <Type.OLD_CYLINDER_ID: 131593>#
- ORIENTED_BBOX = <Type.ORIENTED_BBOX: 70368744177667>#
- PLANE = <Type.PLANE: 16905>#
- POINT_CLOUD = <Type.POINT_CLOUD: 257>#
- POINT_KDTREE = <Type.POINT_KDTREE: 4194307>#
- POINT_OCTREE = <Type.POINT_OCTREE: 1027>#
- POINT_OCTREE2 = <Type.POINT_OCTREE2: 140737488355331>#
- POLY_LINE = <Type.POLY_LINE: 2049>#
- PRIMITIVE = <Type.PRIMITIVE: 521>#
- QUADRIC = <Type.QUADRIC: 8589935113>#
- RGBD_IMAGE = <Type.RGBD_IMAGE: 1125899906842627>#
- SENSOR = <Type.SENSOR: 8193>#
- SPHERE = <Type.SPHERE: 33289>#
- SUB_MESH = <Type.SUB_MESH: 515>#
- TETRA_MESH = <Type.TETRA_MESH: 27021597764222977>#
- TORUS = <Type.TORUS: 66057>#
- VIEWPORT_2D_LABEL = <Type.VIEWPORT_2D_LABEL: 99>#
- VIEWPORT_2D_OBJECT = <Type.VIEWPORT_2D_OBJECT: 67>#
- VOXEL_GRID = <Type.VOXEL_GRID: 281474976710657>#
- property name#
- property value#
- static New(*args, **kwargs)#
Overloaded function.
New(objectType: typing.SupportsInt, name: str = None) -> cloudViewer.geometry.ccHObject
New(pluginId: QString, classId: QString, name: str = None) -> cloudViewer.geometry.ccHObject
- __init__(*args, **kwargs)#
Overloaded function.
__init__(self: cloudViewer.geometry.HalfEdgeTriangleMesh) -> None
Default constructor
__init__(self: cloudViewer.geometry.HalfEdgeTriangleMesh, arg0: cloudViewer.geometry.HalfEdgeTriangleMesh) -> None
Copy constructor
- add_child(self, child, dependencyFlags=24, insertIndex=-1)#
Adds a child.
- Parameters:
child (cloudViewer.geometry.ccHObject) – child instance geometry
dependencyFlags (SupportsInt, optional, default=24) – dependency flags
insertIndex (SupportsInt, optional, default=-1) – insertion index (if <0, child is simply appended to the children list)
- Returns:
bool
- boundary_half_edges_from_vertex(self, vertex_index)#
Query manifold boundary half edges from a starting vertex. If query vertex is not on boundary, empty vector will be returned.
- Parameters:
vertex_index (SupportsInt) –
- Returns:
cloudViewer.utility.IntVector
- boundary_vertices_from_vertex(self)#
- Returns:
cloudViewer.utility.IntVector
- colors_shown(self)#
Returns whether colors are shown or not.
- Returns:
bool
- compute_convex_hull(self)#
Computes the convex hull of the triangle mesh.
- Returns:
tuple[ccMesh, list[int]]
- static create_from_triangle_mesh(mesh)#
Convert HalfEdgeTriangleMesh from TriangleMesh. Throws exception if the input mesh is not manifolds
- Parameters:
mesh (cloudViewer.geometry.ccMesh) – The input TriangleMesh
- Returns:
cloudViewer.geometry.HalfEdgeTriangleMesh
- enable_gl_transformation(self, state)#
Enables/disables associated GL transformation.
- Parameters:
state (bool) –
- Returns:
None
- enable_temp_color(self, state)#
Set temporary color activation state.
- Parameters:
state (bool) –
- Returns:
None
- filter_children(self, recursive=False, filter=<Type.???: 0>, strict=False)#
Collects the children corresponding to a certain pattern.
- Parameters:
recursive (bool, optional, default=False) – specifies if the search should be recursive
(typing.SupportsInt (filter) – 0>): pattern for children selection
optional – 0>): pattern for children selection
default=<Type.??? – 0>): pattern for children selection
strict (bool, optional, default=False) – whether the search is strict on the type (i.e ‘isA’) or not (i.e. ‘isKindOf’)
- Returns:
list[cloudViewer.geometry.ccHObject]
- find(self, unique_id)#
Finds an entity in this object hierarchy.
- Parameters:
unique_id (SupportsInt) –
- Returns:
cloudViewer.geometry.ccHObject
- from_file(self, filename, dataVersion, flags)#
Loads data from binary stream.
- Parameters:
filename (str) –
dataVersion (SupportsInt) – file version
flags (SupportsInt) – deserialization flags (see ccSerializableObject::DeserializationFlags)
- Returns:
bool
- get_axis_aligned_bounding_box(self)#
Returns an axis-aligned bounding box of the geometry.
- Returns:
ccBBox
- get_bbox_corner(self)#
Returns the mesh bounding-box.
- Returns:
tuple[typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”], typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]]
- get_boundaries(self)#
Returns a vector of boundaries. A boundary is a vector of vertices.
- Returns:
list[cloudViewer.utility.IntVector]
- get_center(self)#
Returns the center of the geometry coordinates.
- Returns:
typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]
- get_child(self, childPos)#
Returns the ith child.
- Parameters:
childPos (SupportsInt) – child position
- Returns:
cloudViewer.geometry.ccHObject
- get_children_number(self)#
Returns the number of children.
- Returns:
int
- get_class_id(self)#
Returns class ID.
- Returns:
int
- get_glTransformation_history(self)#
Returns the transformation ‘history’ matrix.
- Returns:
ccGLMatrix
- get_gl_transformation(self)#
Returns associated GL transformation.
- Returns:
typing.Annotated[numpy.typing.NDArray[numpy.float32], “[4, 4]”]
- get_max_2Dbound(self)#
Returns max 2d bounds for geometry coordinates.
- Returns:
typing.Annotated[numpy.typing.NDArray[numpy.float64], “[2, 1]”]
- get_max_bound(self)#
Returns max bounds for geometry coordinates.
- Returns:
typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]
- get_min_2Dbound(self)#
Returns min 2d bounds for geometry coordinates.
- Returns:
typing.Annotated[numpy.typing.NDArray[numpy.float64], “[2, 1]”]
- get_min_bound(self)#
Returns min bounds for geometry coordinates.
- Returns:
typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]
- get_name(self)#
Returns object name.
- Returns:
str
- get_next_triangle(self)#
Returns the next triangle (relatively to the global iterator position).
- Returns:
cloudViewer::GenericTriangle
- get_opacity(self)#
Get opacity.
- Returns:
float
- get_oriented_bounding_box(self)#
Returns an oriented bounding box of the geometry.
- Returns:
ecvOrientedBBox
- get_own_bounding_box(self, withGLFeatures=False)#
Returns an axis-aligned bounding box of the geometry.
- Parameters:
withGLFeatures (bool, optional, default=False) – whether use openGL features.
- Returns:
ccBBox
- get_parent(self)#
Returns parent object.
- Returns:
cloudViewer.geometry.ccHObject
- static get_rotation_matrix_from_axis_angle(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_euler_angle(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_quaternion(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[4, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_xyz(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_xzy(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_yxz(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_yzx(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_zxy(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_zyx(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- get_temp_color(self)#
Returns current temporary (unique) color.
- Returns:
typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]
- get_unique_id(self)#
Returns object unique ID.
- Returns:
int
- has_colors(self)#
Returns whether colors are enabled or not.
- Returns:
bool
- has_displayed_scalar_field(self)#
Returns whether an active scalar field is available or not.
- Returns:
bool
- has_half_edges(self)#
Returns
Trueif half-edges have already been computed.- Returns:
bool
- has_normals(self)#
Returns whether normals are enabled or not.
- Returns:
bool
- has_scalar_fields(self)#
Returns whether one or more scalar fields are instantiated.
- Returns:
bool
- has_triangles(self)#
Returns whether triangles are empty.
- Returns:
bool
- has_vertex_colors(self)#
Returns
Trueif the mesh contains vertex colors.- Returns:
bool
- has_vertex_normals(self)#
Returns
Trueif the mesh contains vertex normals.- Returns:
bool
- has_vertices(self)#
Returns
Trueif the mesh contains vertices.- Returns:
bool
- is_a(self, type)#
Returns whether the geometry is a type pointed.
- Parameters:
type (SupportsInt) –
- Returns:
bool
- is_color_overriden(self)#
Returns whether colors are currently overridden by a temporary (unique) color.
- Returns:
bool
- is_custom(self)#
Returns whether the geometry is custom.
- Returns:
bool
- is_empty(self)#
Returns
Trueif the geometry is empty.- Returns:
bool
- is_gl_trans_enabled(self)#
Returns whether a GL transformation is enabled or not.
- Returns:
bool
- is_group(self)#
Returns whether the instance is a group.
- Returns:
bool
- is_hierarchy(self)#
Returns whether the geometry is hierarchy.
- Returns:
bool
- is_kind_of(self, type)#
Returns whether the geometry is kind of the type pointed.
- Parameters:
type (SupportsInt) –
- Returns:
bool
- is_leaf(self)#
Returns whether the geometry is leaf.
- Returns:
bool
- is_selected(self)#
Returns whether entity is selected or not.
- Returns:
bool
- is_serializable(self)#
Returns whether the instance is a serializable.
- Returns:
bool
- is_visible(self)#
Returns whether entity is visible or not.
- Returns:
bool
- is_visiblity_locked(self)#
Returns whether visibility is locked or not.
- Returns:
bool
- minimum_file_version(self: cloudViewer.geometry.ccHObject) int#
Returns the minimum file version required to save this object
- name_3d_shown(self)#
Returns whether name is displayed in 3D or not.
- Returns:
bool
- normalize_normals(self)#
Normalize vertex normals to length 1.
- Returns:
cloudViewer.geometry.ecvMeshBase
- normals_shown(self)#
Returns whether normals are shown or not.
- Returns:
bool
- paint_uniform_color(self, color)#
Assigns each vertex in the ecvMeshBase the same color.
- Parameters:
color (Annotated[numpy.typing.ArrayLike, numpy.float64,) – RGB colors of vertices.
- Returns:
cloudViewer.geometry.ecvMeshBase
- place_iterator_at_beginning(self)#
Places the mesh iterator at the beginning.
- Returns:
None
- remove_all_children(self)#
Clear all children in the geometry.
- Returns:
None
- remove_child(*args, **kwargs)#
Overloaded function.
remove_child(self: cloudViewer.geometry.ccHObject, child: cloudViewer.geometry.ccHObject) -> None
Removes a specific child.
remove_child(self: cloudViewer.geometry.ccHObject, pos: typing.SupportsInt) -> None
Removes a specific child given its index.
- reset_glTransformation_history(self)#
Resets the transformation ‘history’ matrix.
- Returns:
None
- reset_gl_transformation(self)#
Resets associated GL transformation.
- Returns:
None
- rotate(*args, **kwargs)#
Overloaded function.
- rotate(self, R)
Apply rotation to the geometry coordinates and normals.
- Parameters:
R (Annotated[numpy.typing.ArrayLike, numpy.float64,) – The rotation matrix
- Returns:
cloudViewer.geometry.ccHObject
- rotate(self, R, center)
Apply rotation to the geometry coordinates and normals.
- rotate_gl(self, rotation)#
Multiplies (left) current GL transformation by a rotation matrix.
- Parameters:
rotation (Annotated[numpy.typing.ArrayLike, numpy.float64,) –
- Returns:
None
- scale(*args, **kwargs)#
Overloaded function.
- scale(self, scale)
Apply scaling to the geometry coordinates.
- Parameters:
scale (SupportsFloat) –
- Returns:
cloudViewer.geometry.ccHObject
- scale(self, scale, center)
Apply scaling to the geometry coordinates.
- Parameters:
scale (SupportsFloat) –
center (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Scale center used for transformation
- Returns:
cloudViewer.geometry.ccHObject
- set_glTransformation_history(self, mat)#
Sets the transformation ‘history’ matrix (handle with care!).
- Parameters:
mat (ccGLMatrix) – transformation ‘history’ matrix
- Returns:
None
- set_gl_transformation(self, transformation)#
Associates entity with a GL transformation (rotation + translation).
- Parameters:
transformation (Annotated[numpy.typing.ArrayLike, numpy.float64,) –
- Returns:
None
- set_lineWidth_recursive(self, width)#
Sets the line width.
- Parameters:
width (SupportsFloat) – line width
- Returns:
None
- set_opacity(self, opacity)#
Set opacity activation state.
- Parameters:
opacity (SupportsFloat) –
- Returns:
None
- set_pointSize_recursive(self, pSize)#
Sets the point size.
- Parameters:
pSize (SupportsInt) – point size
- Returns:
None
- set_temp_color(self, color, auto_activate=True)#
Sets current temporary (unique).
- set_unique_id(self, ID)#
Changes unique ID.
- Parameters:
ID (SupportsInt) –
- Returns:
None
- sf_shown(self)#
Returns whether active scalar field is visible.
- Returns:
bool
- show_3d_name(self, state)#
Sets whether name should be displayed in 3D.
- Parameters:
state (bool) –
- Returns:
None
- size(self)#
Returns the number of triangles.
- Returns:
int
- to_file(self, filename, data_version)#
Saves data to binary stream.
- Parameters:
filename (str) –
data_version (SupportsInt) –
- Returns:
bool
- toggle_colors(self)#
Toggles colors display state.
- Returns:
None
- toggle_materials(self)#
Toggles material display state.
- Returns:
None
- toggle_normals(self)#
Toggles normals display state.
- Returns:
None
- toggle_sf(self)#
Toggles SF display state.
- Returns:
None
- toggle_show_name(self)#
Toggles name in 3D display state.
- Returns:
None
- toggle_visibility(self)#
Toggles visibility.
- Returns:
None
- transform(self, arg0)#
Apply transformation (4x4 matrix) to the geometry coordinates.
- Parameters:
arg0 (Annotated[numpy.typing.ArrayLike, numpy.float64,) –
- Returns:
cloudViewer.geometry.ccHObject
- translate(self, translation, relative=True)#
Apply translation to the geometry coordinates.
- Parameters:
- Returns:
cloudViewer.geometry.ccHObject
- translate_gl(self, translation)#
Translates current GL transformation by a rotation matrix.
- Parameters:
translation (Annotated[numpy.typing.ArrayLike, numpy.float64,) –
- Returns:
None
- BBOX = <Type.BBOX: 35184372088835>#
- BOX = <Type.BOX: 524809>#
- CAMERA_SENSOR = <Type.CAMERA_SENSOR: 4294975489>#
- CONE = <Type.CONE: 262665>#
- CUSTOM_H_OBJECT = <Type.CUSTOM_H_OBJECT: 129>#
- CYLINDER = <Type.CYLINDER: 393737>#
- DISH = <Type.DISH: 1049097>#
- EXTRU = <Type.EXTRU: 2097673>#
- FACET = <Type.FACET: 8388609>#
- GBL_SENSOR = <Type.GBL_SENSOR: 134225921>#
- IMAGE = <Type.IMAGE: 4097>#
- IMAGE2 = <Type.IMAGE2: 562949953421315>#
- LABEL_2D = <Type.LABEL_2D: 35>#
- LINESET = <Type.LINESET: 2251799813685249>#
- MATERIAL_SET = <Type.MATERIAL_SET: 16777222>#
- MESH = <Type.MESH: 513>#
- MESH_GROUP = <Type.MESH_GROUP: 517>#
- OLD_CYLINDER_ID = <Type.OLD_CYLINDER_ID: 131593>#
- ORIENTED_BBOX = <Type.ORIENTED_BBOX: 70368744177667>#
- PLANE = <Type.PLANE: 16905>#
- POINT_CLOUD = <Type.POINT_CLOUD: 257>#
- POINT_KDTREE = <Type.POINT_KDTREE: 4194307>#
- POINT_OCTREE = <Type.POINT_OCTREE: 1027>#
- POINT_OCTREE2 = <Type.POINT_OCTREE2: 140737488355331>#
- POLY_LINE = <Type.POLY_LINE: 2049>#
- PRIMITIVE = <Type.PRIMITIVE: 521>#
- QUADRIC = <Type.QUADRIC: 8589935113>#
- RGBD_IMAGE = <Type.RGBD_IMAGE: 1125899906842627>#
- SENSOR = <Type.SENSOR: 8193>#
- SPHERE = <Type.SPHERE: 33289>#
- SUB_MESH = <Type.SUB_MESH: 515>#
- TETRA_MESH = <Type.TETRA_MESH: 27021597764222977>#
- TORUS = <Type.TORUS: 66057>#
- VIEWPORT_2D_LABEL = <Type.VIEWPORT_2D_LABEL: 99>#
- VIEWPORT_2D_OBJECT = <Type.VIEWPORT_2D_OBJECT: 67>#
- VOXEL_GRID = <Type.VOXEL_GRID: 281474976710657>#
- property half_edges#
List of HalfEdge in the mesh
- property ordered_half_edge_from_vertex#
Counter-clockwise ordered half-edges started from each vertex
- property triangle_normals#
Triangle normals.
- Type:
float64array of shape(num_triangles, 3), usenumpy.asarray()to access data
- property triangles#
List of triangles denoted by the index of points forming the triangle.
- Type:
intarray of shape(num_triangles, 3), usenumpy.asarray()to access data
- property vertex_colors#
RGB colors of vertices.
- Type:
float64array of shape(num_vertices, 3), range[0, 1], usenumpy.asarray()to access data
- property vertex_normals#
Vertex normals.
- Type:
float64array of shape(num_vertices, 3), usenumpy.asarray()to access data
- property vertices#
Vertex coordinates.
- Type:
float64array of shape(num_vertices, 3), usenumpy.asarray()to access data