igl.triangle¶
Python API reference for igl.triangle.
cdt¶
cdt(V: float64[m, n], E: int64[m, n], flags: str = '-c') -> tuple[float64[m, n], int64[m, n], int64[m, n], int64[m]]
Constrained Delaunay triangulation of the convex hull of 2D points and segments.
Preprocesses input to remove duplicates before calling triangle. Unlike triangulate(), this returns an adjusted edge list on the output.
Parameters
V— #V by 2 list of 2D vertex positionsE— #E by 2 list of constraint edge indices into Vflags— triangle option string; should contain "-c" unless segments already enclose all points (default: "-c")
Returns
- tuple (WV, WF, WE, J): - WV #WV by 2 background mesh vertex positions - WF #WF by 3 background mesh triangle indices into WV - WE #WE by 2 constraint edge indices into WV (may be smaller than E if degenerate constraints were removed) - J #V list of indices into WF/WE for each original vertex in V
refine¶
refine(V: float64[m, n], E: int64[m, n], F: int64[m, n], flags: str = 'q') -> tuple[float64[m, n], int64[m, n]]
Refine an existing 2D triangulation.
Parameters
V— #V by 2 list of 2D vertex positionsE— #E by 2 list of segment indices (constraint edges)F— #F by 3 list of triangle indicesflags— triangle option string (default: "q" for quality refinement)
Returns
- tuple (V2, F2): - V2 #V2 by 2 refined vertex positions - F2 #F2 by 3 refined triangle indices
scaf_precompute¶
scaf_precompute(V: float64[m, n], F: int32[m, n], V_init: float64[m, n], scaf_energy: 'igl::MappingEnergyType', b: int32[m], bc: float64[m, n], soft_p: float, data: SCAFData) -> None
Compute necessary information to start using SCAF
Parameters
V— #V by 3 list of mesh vertex positionsF— #F by 3/3 list of mesh faces (triangles/tets)V_init— #V by 3 list of initial mesh vertex positionsdata— resulting precomputed dataslim_energy— Energy type to minimizeb— list of boundary indices into V (soft constraint)bc— #b by dim list of boundary conditions (soft constraint)soft_p— Soft penalty factor (can be zero)
scaf_solve¶
Run iter_num iterations of SCAF, with precomputed data
Parameters
data— precomputed dataiter_num— number of iterations to run
Returns
- resulting V_o (in SLIMData): #V by dim list of mesh vertex positions
scaf_system¶
Set up the SCAF system L * uv = rhs, without solving it.
Parameters
s:— igl::SCAFData. Will be modified by energy and Jacobian computation.L:— m by m matrixrhs:— m by 1 vector with m = dim * (#V_mesh + #V_scaf - #V_frame)
triangulate¶
triangulate(V: float64[m, n], E: int64[m, n] = Ellipsis, H: float64[m, n] = Ellipsis, VM: int64[m] = Ellipsis, EM: int64[m] = Ellipsis, flags: str = '') -> tuple[float64[m, n], int64[m, n], int64[m], int64[m, n], int64[m]]
Triangulate the interior of a polygon using the triangle library.
Parameters
V— #V by 2 list of 2D vertex positionsE— #E by 2 list of vertex ids forming unoriented edges of the boundary of the polygonH— #H by 2 coordinates of points contained inside holes of the polygonVM— #V list of markers for input verticesEM— #E list of markers for input edgesflags— string of options pass to triangle (see triangle documentation)V2— #V2 by 2 coordinates of the vertives of the generated triangulationF2— #F2 by 3 list of indices forming the faces of the generated triangulationVM2— #V2 list of markers for output verticesE2— #E2 by 2 list of output edgesEM2— #E2 list of markers for output edges