Skip to content

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 positiosn
  • F — #F by 3 list of mesh triangle indices into rows of V
  • P — #P by 3 list of origin points
  • N — #P by 3 list of origin normals
  • S — #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 points
  • N — #P by 3 list of origin normals
  • S — #P list of ambient occlusion values between 1 (fully occluded) and 0 (not occluded)

bone_visible

C++ reference

bone_visible(V: float64[m, n], F: int64[m, n], s: float64[m], d: float64[m]) -> bool[m]

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 positions
  • F — #F by 3 list of triangle indices
  • s — 3-vector: bone start position
  • d — 3-vector: bone end position

Returns

  • flag #V bool vector, true if vertex is visible to the bone

line_mesh_intersection

C++ reference

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 positions
  • N_source — #V by 3 source point normals
  • V_target — #V2 by 3 target mesh vertex positions
  • F_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

C++ reference

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 positions
  • F — #F by 3 list of triangle indices
  • rays_total — Total number of rays that will be shot
  • rays_minimum — Minimum number of rays that each patch should receive
  • facet_wise — Decision made for each face independently, no use of patches (i.e., each face is treated as a patch)
  • use_parity — Use parity mode
  • is_verbose — Verbose output to cout
  • I — #F list of whether face has been flipped
  • C — #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 positiosn
  • F — #F by 3 list of mesh triangle indices into rows of V
  • P — #P by 3 list of origin points
  • N — #P by 3 list of origin normals
  • S — #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 points
  • N — #P by 3 list of origin normals
  • S — #P list of ambient occlusion values between 1 (fully occluded) and 0 (not occluded)

EmbreeIntersector

C++ reference

EmbreeIntersector.init

init(V: float32[m, 3], F: int32[m, 3], isStatic: bool = False) -> None

EmbreeIntersector.intersectRay_first

intersectRay_first(origin: float32[3], direction: float32[3], tnear: float = 0, tfar: float = float('inf')) -> tuple[int, float, float, float]

EmbreeIntersector.intersectRay

intersectRay(origin: float32[3], direction: float32[3], tnear: float = 0, tfar: float = float('inf')) -> tuple[list[tuple[int, float, float, float]], int]