igl.embree¶
Python API reference for igl.embree.
ambient_occlusion¶
ambient_occlusion(V: float64[m, n], F: int64[m, n], P: float64[m, n], N: float64[m, n], num_samples: int) -> float64[m]
Compute ambient occlusion per given point
Parameters
V— #V by 3 list of mesh vertex positiosnF— #F by 3 list of mesh triangle indices into rows of VP— #P by 3 list of origin pointsN— #P by 3 list of origin normalsS— #P list of ambient occlusion values between 1 (fully occluded) and 0 (not occluded)
ambient_occlusion(ei: EmbreeIntersector, P: float64[m, n], N: float64[m, n], num_samples: int) -> float64[m]
Compute ambient occlusion per given point
Parameters
ei— EmbreeIntersector containing (V,F)P— #P by 3 list of origin pointsN— #P by 3 list of origin normalsS— #P list of ambient occlusion values between 1 (fully occluded) and 0 (not occluded)
bone_visible¶
Test which mesh vertices are visible to a bone segment.
A vertex v is "visible" if the line segment from its projection onto the bone to v does not intersect the mesh (see Baran & Popovic 2007).
Parameters
V— #V by 3 list of mesh vertex positionsF— #F by 3 list of triangle indicess— 3-vector: bone start positiond— 3-vector: bone end position
Returns
- flag #V bool vector, true if vertex is visible to the bone
line_mesh_intersection¶
line_mesh_intersection(V_source: float64[m, n], N_source: float64[m, n], V_target: float64[m, n], F_target: int64[m, n]) -> float64[m, n]
Project a point cloud onto a target mesh by ray casting along normals.
For each source point, a ray is cast along its normal (and the opposite direction). The nearest intersection with the target mesh is returned as barycentric coordinates.
Parameters
V_source— #V by 3 source point positionsN_source— #V by 3 source point normalsV_target— #V2 by 3 target mesh vertex positionsF_target— #F2 by 3 target mesh triangle indices
Returns
- #V by 3 matrix of barycentric hits: each row is (face_id, b1, b2) where face_id is the index of the hit face and b1, b2 are barycentric coordinates w.r.t. the first two edges
reorient_facets_raycast¶
reorient_facets_raycast(V: float64[m, n], F: int64[m, n], rays_total: int = -1, rays_minimum: int = 10, facet_wise: bool = False, use_parity: bool = False, is_verbose: bool = False) -> tuple[bool[m], int64[m]]
Orient each component (identified by C) of a mesh (V,F) using ambient occlusion such that the front side is less occluded than back side, as described in "A Simple Method for Correcting Facet Orientations in Polygon Meshes Based on Ray Casting" [Takayama et al. 2014].
Parameters
V— #V by 3 list of vertex positionsF— #F by 3 list of triangle indicesrays_total— Total number of rays that will be shotrays_minimum— Minimum number of rays that each patch should receivefacet_wise— Decision made for each face independently, no use of patches (i.e., each face is treated as a patch)use_parity— Use parity modeis_verbose— Verbose output to coutI— #F list of whether face has been flippedC— #F list of patch ID (output of bfs_orient > manifold patches)
shape_diameter_function¶
shape_diameter_function(V: float64[m, n], F: int64[m, n], P: float64[m, n], N: float64[m, n], num_samples: int) -> float64[m]
Compute shape diameter function per given point
Parameters
V— #V by 3 list of mesh vertex positiosnF— #F by 3 list of mesh triangle indices into rows of VP— #P by 3 list of origin pointsN— #P by 3 list of origin normalsS— #P list of ambient occlusion values between 1 (fully occluded) and 0 (not occluded)
shape_diameter_function(ei: EmbreeIntersector, P: float64[m, n], N: float64[m, n], num_samples: int) -> float64[m]
Compute shape diameter function per given point
Parameters
ei— EmbreeIntersector containing (V,F)P— #P by 3 list of origin pointsN— #P by 3 list of origin normalsS— #P list of ambient occlusion values between 1 (fully occluded) and 0 (not occluded)
EmbreeIntersector¶
EmbreeIntersector.init¶
EmbreeIntersector.intersectRay_first¶
intersectRay_first(origin: float32[3], direction: float32[3], tnear: float = 0, tfar: float = float('inf')) -> tuple[int, float, float, float]