igl.copyleft.cgal¶
Python API reference for igl.copyleft.cgal.
convex_hull¶
convex_hull(V: float64[m, n]) -> int64[m, n]
Compute the convex hull of a set of points, returning only the triangular faces of the hull.
Parameters
V— #V by 3 matrix of input points
Returns
- F: #F by 3 matrix of triangle indices into V
fast_winding_number¶
fast_winding_number(P: float64[m, n], N: float64[m, n], Q: float64[m, n], expansion_order: int = 2, beta: float = 2.0) -> float64[m]
Evaluate the fast winding number for point data with adjustable accuracy.
Parameters
P— #P by 3 list of point locationsN— #P by 3 list of point normalsQ— #Q by 3 list of query points for the winding numberexpansion_order— Order of the Taylor expansion (0, 1, or 2)beta— Barnes-Hut style accuracy parameter (recommended: 2)
Returns
- Vector of winding number values for each query point
intersect_other¶
intersect_other(VA: float64[m, n], FA: int64[m, n], VB: float64[m, n], FB: int64[m, n], detect_only: bool = False, first_only: bool = False, stitch_all: bool = False, slow_and_more_precise_rounding: bool = False, cutoff: int = 1000) -> tuple[int64[m, n], float64[m, n], int64[m, n], int64[m], int64[m]]
Detect intersecting faces between two triangle meshes, providing detailed output.
Parameters
VA— #V by 3 list of vertices for first meshFA— #F by 3 list of faces for first meshVB— #V by 3 list of vertices for second meshFB— #F by 3 list of faces for second meshdetect_only— only detect intersections, do not resolvefirst_only— only return first intersectionstitch_all— stitch all intersectionsslow_and_more_precise_rounding— use slow and more precise roundingcutoff— maximum number of intersections to resolve
Returns
- Tuple containing: - success: bool indicating if the operation succeeded - IF: # intersecting face pairs - VVAB: list of intersection vertex positions - FFAB: list of triangle indices into VVAB - JAB: list of indices into [FA;FB] denoting the birth triangle - IMAB: indices stitching duplicates from intersections
intersect_with_half_space¶
intersect_with_half_space(V: float64[m, n], F: int64[m, n], p: float64[m], n: float64[m]) -> tuple[float64[m, n], int64[m, n], int64[m]]
Intersect a PWN mesh with a half-space using a point and normal.
Parameters
V— #V by 3 list of mesh vertex positionsF— #F by 3 list of triangle indicesp— 3D point on planen— 3D normal vector
Returns
- Tuple containing: - success: bool, true if successful - VC: vertices of resulting mesh - FC: face indices of resulting mesh - J: birth facet indices
intersect_with_half_space(V: float64[m, n], F: int64[m, n], equ: float64[m]) -> tuple[float64[m, n], int64[m, n], int64[m]]
Intersect a PWN mesh with a half-space using the plane equation.
Parameters
V— #V by 3 list of mesh vertex positionsF— #F by 3 list of triangle indicesequ— Plane equation coefficients (a, b, c, d)
Returns
- Tuple containing: - success: bool, true if successful - VC: vertices of resulting mesh - FC: face indices of resulting mesh - J: birth facet indices
mesh_boolean¶
mesh_boolean(VA: float64[m, n], FA: int64[m, n], VB: float64[m, n] = Ellipsis, FB: int64[m, n] = Ellipsis, type_str: str = Ellipsis) -> tuple[float64[m, n], int64[m, n], int64[m]]
Compute the boolean operation (union, intersection, difference, etc.) between two meshes.
Parameters
VA— #VA by dim matrix of mesh A verticesFA— #FA by simplex_size matrix of mesh A facesVB— #VB by dim matrix of mesh B verticesFB— #FB by simplex_size matrix of mesh B facestype_str— Type of boolean operation: “union”, “intersection”, “difference”, etc.VC— #VC by dim matrix of result verticesFC— #FC by simplex_size matrix of result facesJ— #FC list of indices indicating which input face contributed to each result face
Returns
- Tuple containing: - VC: Result vertices - FC: Result faces - J: Face origin indices
oriented_bounding_box¶
oriented_bounding_box(P: float64[m, n]) -> float64[m, n]
Given a set of points compute the rotation transformation of them such that their axis-aligned bounding box is as small as possible.
igl::oriented_bounding_box is often faster and better
Parameters
P— #P by 3 list of point locationsR— rotation matrix
point_areas¶
point_areas(P: float64[m, n], I: int64[m, n], N: float64[m, n]) -> tuple[float64[m], float64[m, n]]
Given a 3D set of points P, each with a list of k-nearest-neighbours, estimate the geodesic voronoi area associated with each point.
The k nearest neighbours may be known from running igl::knn_octree on the output data from igl::octree. We reccomend using a k value between 15 and 20 inclusive for accurate area estimation.
N is used filter the neighbours, to ensure area estimation only occurs using neighbors that are on the same side of the surface (ie for thin sheets), as well as to solve the orientation ambiguity of the tangent plane normal.
\note This function should be implemented by pre-filtering I, rather than filtering in this function using N. In this case, the function would only take P and I as input.
Parameters
P— #P by 3 list of point locationsI— #P by k list of k-nearest-neighbor indices into PN— #P by 3 list of point normalsA— #P list of estimated areasT— #P by 3 list of tangent plane normals for each point
remesh_self_intersections¶
remesh_self_intersections(V: float64[m, n], F: int64[m, n], detect_only: bool = False, first_only: bool = False, stitch_all: bool = False, slow_and_more_precise_rounding: bool = False, cutoff: int = 1000) -> tuple[float64[m, n], int64[m, n], int64[m, n], int64[m], int64[m]]
Resolve self-intersections in a mesh, without returning unique vertex indices (IM).
Parameters
V— #V by 3 list of vertex positionsF— #F by 3 list of face indicesdetect_only— only detect intersections, do not resolvefirst_only— only return first intersectionstitch_all— stitch all intersectionsslow_and_more_precise_rounding— use slow and more precise roundingcutoff— maximum number of intersections to resolve
Returns
- Tuple containing: - VV: remeshed vertex positions - FF: remeshed face indices - IF: intersecting face pairs - J: birth triangle indices - IM if stitch_all = true #VV list from 0 to #VV-1 elseif stitch_all = false #VV list of indices into VV of unique vertices.
trim_with_solid¶
trim_with_solid(VA: float64[m, n], FA: int64[m, n], VB: float64[m, n], FB: int64[m, n]) -> tuple[float64[m, n], int64[m, n], bool[m], int64[m]]
Trim a mesh with another solid mesh, determining which faces lie inside or outside.
Parameters
VA— Vertex positions of mesh AFA— Triangle indices of mesh AVB— Vertex positions of mesh B (solid)FB— Triangle indices of mesh BV— Output vertex positionsF— Output triangle indicesD— Boolean vector indicating if each face is inside BJ— Indices into FA showing parent triangle