libigl v2.5.0
|
Classes | |
struct | EmbreeDevice |
keep track of embree device instance More... | |
class | EmbreeIntersector |
Simple class to wrap Embree's ray tracing functionality. More... | |
Functions | |
template<typename DerivedV , typename DerivedF , typename DerivedP , typename DerivedN , typename DerivedS > | |
void | ambient_occlusion (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S) |
Compute ambient occlusion per given point. | |
template<typename DerivedP , typename DerivedN , typename DerivedS > | |
void | ambient_occlusion (const EmbreeIntersector &ei, const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S) |
bool | bone_heat (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::MatrixXd &C, const Eigen::VectorXi &P, const Eigen::MatrixXi &BE, const Eigen::MatrixXi &CE, Eigen::MatrixXd &W) |
Compute skinning weights W given a surface mesh (V,F) and an internal skeleton (C,BE) according to "Automatic Rigging" [Baran and Popovic 2007]. | |
template<typename DerivedV , typename DerivedF , typename DerivedSD , typename Derivedflag > | |
void | bone_visible (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedSD > &s, const Eigen::PlainObjectBase< DerivedSD > &d, Eigen::PlainObjectBase< Derivedflag > &flag) |
Test whether vertices of mesh are "visible" to a given bone, where "visible" is defined as in [Baran & Popovic 07]. | |
template<typename DerivedV , typename DerivedF , typename DerivedSD , typename Derivedflag > | |
void | bone_visible (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const EmbreeIntersector &ei, const Eigen::PlainObjectBase< DerivedSD > &s, const Eigen::PlainObjectBase< DerivedSD > &d, Eigen::PlainObjectBase< Derivedflag > &flag) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename ScalarMatrix , typename IndexMatrix > | |
ScalarMatrix | line_mesh_intersection (const ScalarMatrix &V_source, const ScalarMatrix &N_source, const ScalarMatrix &V_target, const IndexMatrix &F_target) |
Project the point cloud V_source onto the triangle mesh V_target,F_target. | |
template<typename DerivedV , typename DerivedF , typename DerivedI , typename DerivedC > | |
void | reorient_facets_raycast (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, int rays_total, int rays_minimum, bool facet_wise, bool use_parity, bool is_verbose, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C) |
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. | |
template<typename DerivedV , typename DerivedF , typename DerivedFF , typename DerivedI > | |
void | reorient_facets_raycast (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedFF > &FF, Eigen::PlainObjectBase< DerivedI > &I) |
template<typename DerivedP , typename DerivedN , typename DerivedS > | |
void | shape_diameter_function (const EmbreeIntersector &ei, const Eigen::PlainObjectBase< DerivedP > &P, const Eigen::PlainObjectBase< DerivedN > &N, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S) |
Compute shape diamter function per given point. | |
template<typename DerivedV , typename DerivedF , typename DerivedP , typename DerivedN , typename DerivedS > | |
void | shape_diameter_function (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedP > &P, const Eigen::PlainObjectBase< DerivedN > &N, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename Derivedobj > | |
int | unproject_in_mesh (const Eigen::Vector2f &pos, const Eigen::Matrix4f &model, const Eigen::Matrix4f &proj, const Eigen::Vector4f &viewport, const EmbreeIntersector &ei, Eigen::PlainObjectBase< Derivedobj > &obj, std::vector< igl::Hit > &hits) |
Unproject a screen location (using current opengl viewport, projection, and model view) to a 3D position inside a given mesh. | |
template<typename Derivedobj > | |
int | unproject_in_mesh (const Eigen::Vector2f &pos, const Eigen::Matrix4f &model, const Eigen::Matrix4f &proj, const Eigen::Vector4f &viewport, const EmbreeIntersector &ei, Eigen::PlainObjectBase< Derivedobj > &obj) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
bool | unproject_onto_mesh (const Eigen::Vector2f &pos, const Eigen::Matrix4f &model, const Eigen::Matrix4f &proj, const Eigen::Vector4f &viewport, const EmbreeIntersector &ei, int &fid, Eigen::Vector3f &bc) |
Unproject a screen location (using the given model, proj and viewport) to find the first hit on a mesh. | |
bool | unproject_onto_mesh (const Eigen::Vector2f &pos, const Eigen::MatrixXi &F, const Eigen::Matrix4f &model, const Eigen::Matrix4f &proj, const Eigen::Vector4f &viewport, const EmbreeIntersector &ei, int &fid, int &vid) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void igl::embree::ambient_occlusion | ( | const Eigen::MatrixBase< DerivedV > & | V, |
const Eigen::MatrixBase< DerivedF > & | F, | ||
const Eigen::MatrixBase< DerivedP > & | P, | ||
const Eigen::MatrixBase< DerivedN > & | N, | ||
const int | num_samples, | ||
Eigen::PlainObjectBase< DerivedS > & | S | ||
) |
Compute ambient occlusion per given point.
[in] | V | #V by 3 list of mesh vertex positiosn |
[in] | F | #F by 3 list of mesh triangle indices into rows of V |
[in] | P | #P by 3 list of origin points |
[in] | N | #P by 3 list of origin normals |
[out] | S | #P list of ambient occlusion values between 1 (fully occluded) and 0 (not occluded) |
void igl::embree::ambient_occlusion | ( | const EmbreeIntersector & | ei, |
const Eigen::MatrixBase< DerivedP > & | P, | ||
const Eigen::MatrixBase< DerivedN > & | N, | ||
const int | num_samples, | ||
Eigen::PlainObjectBase< DerivedS > & | S | ||
) |
bool igl::embree::bone_heat | ( | const Eigen::MatrixXd & | V, |
const Eigen::MatrixXi & | F, | ||
const Eigen::MatrixXd & | C, | ||
const Eigen::VectorXi & | P, | ||
const Eigen::MatrixXi & | BE, | ||
const Eigen::MatrixXi & | CE, | ||
Eigen::MatrixXd & | W | ||
) |
Compute skinning weights W given a surface mesh (V,F) and an internal skeleton (C,BE) according to "Automatic Rigging" [Baran and Popovic 2007].
[in] | V | #V by 3 list of mesh vertex positions |
[in] | F | #F by 3 list of mesh corner indices into V |
[in] | C | #C by 3 list of joint locations |
[in] | P | #P list of point handle indices into C |
[in] | BE | #BE by 2 list of bone edge indices into C |
[in] | CE | #CE by 2 list of cage edge indices into P |
[out] | W | #V by #P+#BE matrix of weights. |
void igl::embree::bone_visible | ( | const Eigen::PlainObjectBase< DerivedV > & | V, |
const Eigen::PlainObjectBase< DerivedF > & | F, | ||
const Eigen::PlainObjectBase< DerivedSD > & | s, | ||
const Eigen::PlainObjectBase< DerivedSD > & | d, | ||
Eigen::PlainObjectBase< Derivedflag > & | flag | ||
) |
Test whether vertices of mesh are "visible" to a given bone, where "visible" is defined as in [Baran & Popovic 07].
Instead of checking whether each point can see any of the bone, we just check if each point can see its own projection onto the bone segment. In other words, we project each vertex v onto the bone, projv. Then we check if there are any intersections between the line segment (projv-->v) and the mesh.
[in] | V | #V by 3 list of vertex positions |
[in] | F | #F by 3 list of triangle indices |
[in] | s | row vector of position of start end point of bone |
[in] | d | row vector of position of dest end point of bone |
[out] | flag | #V by 1 list of bools (true) visible, (false) obstructed |
void igl::embree::bone_visible | ( | const Eigen::PlainObjectBase< DerivedV > & | V, |
const Eigen::PlainObjectBase< DerivedF > & | F, | ||
const EmbreeIntersector & | ei, | ||
const Eigen::PlainObjectBase< DerivedSD > & | s, | ||
const Eigen::PlainObjectBase< DerivedSD > & | d, | ||
Eigen::PlainObjectBase< Derivedflag > & | flag | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | ei | EmbreeIntersector for mesh (V,F) should be double sided |
ScalarMatrix igl::embree::line_mesh_intersection | ( | const ScalarMatrix & | V_source, |
const ScalarMatrix & | N_source, | ||
const ScalarMatrix & | V_target, | ||
const IndexMatrix & | F_target | ||
) |
Project the point cloud V_source onto the triangle mesh V_target,F_target.
A ray is casted for every vertex in the direction specified by N_source and its opposite.
[in] | V_source | #Vx3 Vertices of the source mesh |
[in] | N_source | #Vx3 Normals of the point cloud |
[in] | V_target | #V2x3 Vertices of the target mesh |
[in] | F_target | #F2x3 Faces of the target mesh |
void igl::embree::reorient_facets_raycast | ( | const Eigen::PlainObjectBase< DerivedV > & | V, |
const Eigen::PlainObjectBase< DerivedF > & | F, | ||
int | rays_total, | ||
int | rays_minimum, | ||
bool | facet_wise, | ||
bool | use_parity, | ||
bool | is_verbose, | ||
Eigen::PlainObjectBase< DerivedI > & | I, | ||
Eigen::PlainObjectBase< DerivedC > & | C | ||
) |
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].
[in] | V | #V by 3 list of vertex positions |
[in] | F | #F by 3 list of triangle indices |
[in] | rays_total | Total number of rays that will be shot |
[in] | rays_minimum | Minimum number of rays that each patch should receive |
[in] | facet_wise | Decision made for each face independently, no use of patches (i.e., each face is treated as a patch) |
[in] | use_parity | Use parity mode |
[in] | is_verbose | Verbose output to cout |
[out] | I | #F list of whether face has been flipped |
[out] | C | #F list of patch ID (output of bfs_orient > manifold patches) |
void igl::embree::reorient_facets_raycast | ( | const Eigen::PlainObjectBase< DerivedV > & | V, |
const Eigen::PlainObjectBase< DerivedF > & | F, | ||
Eigen::PlainObjectBase< DerivedFF > & | FF, | ||
Eigen::PlainObjectBase< DerivedI > & | I | ||
) |
void igl::embree::shape_diameter_function | ( | const EmbreeIntersector & | ei, |
const Eigen::PlainObjectBase< DerivedP > & | P, | ||
const Eigen::PlainObjectBase< DerivedN > & | N, | ||
const int | num_samples, | ||
Eigen::PlainObjectBase< DerivedS > & | S | ||
) |
Compute shape diamter function per given point.
[in] | ei | EmbreeIntersector containing (V,F) |
[in] | P | #P by 3 list of origin points |
[in] | N | #P by 3 list of origin normals |
[out] | S | #P list of shape diamater function values between bounding box diagonal (perfect sphere) and 0 (perfect needle hook) |
void igl::embree::shape_diameter_function | ( | const Eigen::PlainObjectBase< DerivedV > & | V, |
const Eigen::PlainObjectBase< DerivedF > & | F, | ||
const Eigen::PlainObjectBase< DerivedP > & | P, | ||
const Eigen::PlainObjectBase< DerivedN > & | N, | ||
const int | num_samples, | ||
Eigen::PlainObjectBase< DerivedS > & | S | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Wrapper which builds new EmbreeIntersector for (V,F). That's expensive so avoid this if repeatedly calling.
[in] | V | #V by 3 list of mesh vertex positiosn |
[in] | F | #F by 3 list of mesh triangle indices into rows of V |
int igl::embree::unproject_in_mesh | ( | const Eigen::Vector2f & | pos, |
const Eigen::Matrix4f & | model, | ||
const Eigen::Matrix4f & | proj, | ||
const Eigen::Vector4f & | viewport, | ||
const EmbreeIntersector & | ei, | ||
Eigen::PlainObjectBase< Derivedobj > & | obj, | ||
std::vector< igl::Hit > & | hits | ||
) |
Unproject a screen location (using current opengl viewport, projection, and model view) to a 3D position inside a given mesh.
If the ray through the given screen location (x,y) hits the mesh more than twice then the 3D midpoint between the first two hits is return. If it hits once, then that point is return. If it does not hit the mesh then obj is not set.
[in] | pos | screen space coordinates |
[in] | model | model matrix |
[in] | proj | projection matrix |
[in] | viewport | vieweport vector |
[in] | ei | EmbreeIntersector containing (V,F) |
[out] | obj | 3d unprojected mouse point in mesh |
[out] | hits | vector of embree hits |
Eigen::Matrix4f model,proj; Eigen::Vector4f viewport; igl::opengl2::model_proj_viewport(model,proj,viewport); igl::embree::unproject_in_mesh(Vector2f(x,y),model,proj,viewport,ei,obj,hits);
int igl::embree::unproject_in_mesh | ( | const Eigen::Vector2f & | pos, |
const Eigen::Matrix4f & | model, | ||
const Eigen::Matrix4f & | proj, | ||
const Eigen::Vector4f & | viewport, | ||
const EmbreeIntersector & | ei, | ||
Eigen::PlainObjectBase< Derivedobj > & | obj | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool igl::embree::unproject_onto_mesh | ( | const Eigen::Vector2f & | pos, |
const Eigen::Matrix4f & | model, | ||
const Eigen::Matrix4f & | proj, | ||
const Eigen::Vector4f & | viewport, | ||
const EmbreeIntersector & | ei, | ||
int & | fid, | ||
Eigen::Vector3f & | bc | ||
) |
Unproject a screen location (using the given model, proj and viewport) to find the first hit on a mesh.
[in] | pos | screen space coordinates |
[in] | model | model matrix |
[in] | proj | projection matrix |
[in] | viewport | vieweport vector |
[in] | ei | EmbreeIntersector containing (V,F) |
[out] | fid | id of the first face hit |
[out] | bc | barycentric coordinates of hit |
bool igl::embree::unproject_onto_mesh | ( | const Eigen::Vector2f & | pos, |
const Eigen::MatrixXi & | F, | ||
const Eigen::Matrix4f & | model, | ||
const Eigen::Matrix4f & | proj, | ||
const Eigen::Vector4f & | viewport, | ||
const EmbreeIntersector & | ei, | ||
int & | fid, | ||
int & | vid | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | vid | vertex id of the closest vertex hit |