Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::geodesic Namespace Reference

Classes

class  Edge
 
struct  edge_visible_from_source
 
class  Face
 
class  GeodesicAlgorithmBase
 
class  GeodesicAlgorithmExact
 
struct  HalfEdge
 
class  Interval
 
class  IntervalList
 
struct  IntervalWithStop
 
class  MemoryAllocator
 
class  Mesh
 
class  MeshElementBase
 
class  OutputBuffer
 
class  Point3D
 
class  SimlpeMemoryAllocator
 
class  SimpleVector
 
class  SortedSources
 
class  SurfacePoint
 
class  SurfacePointWithIndex
 
class  Vertex
 

Typedefs

typedef Vertexvertex_pointer
 
typedef Edgeedge_pointer
 
typedef Faceface_pointer
 
typedef Meshmesh_pointer
 
typedef MeshElementBasebase_pointer
 
typedef Intervalinterval_pointer
 
typedef IntervalListlist_pointer
 

Enumerations

enum  PointType { VERTEX , EDGE , FACE , UNDEFINED_POINT }
 

Functions

double cos_from_edges (double const a, double const b, double const c)
 
double angle_from_edges (double const a, double const b, double const c)
 
template<class Points , class Faces >
bool read_mesh_from_file (char *filename, Points &points, Faces &faces)
 
bool operator< (const HalfEdge &x, const HalfEdge &y)
 
bool operator!= (const HalfEdge &x, const HalfEdge &y)
 
bool operator== (const HalfEdge &x, const HalfEdge &y)
 
void fill_surface_point_structure (geodesic::SurfacePoint *point, double *data, Mesh *mesh)
 
void fill_surface_point_double (geodesic::SurfacePoint *point, double *data, long mesh_id)
 
double length (std::vector< SurfacePoint > &path)
 
void print_info_about_path (std::vector< SurfacePoint > &path)
 

Variables

double const GEODESIC_INF = 1e100
 
double const SMALLEST_INTERVAL_RATIO = 1e-6
 

Class Documentation

◆ igl::geodesic::edge_visible_from_source

struct igl::geodesic::edge_visible_from_source
+ Collaboration diagram for igl::geodesic::edge_visible_from_source:
Class Members
edge_pointer edge
unsigned source

◆ igl::geodesic::HalfEdge

struct igl::geodesic::HalfEdge
Class Members
unsigned face_id
unsigned vertex_0
unsigned vertex_1

Typedef Documentation

◆ base_pointer

◆ edge_pointer

◆ face_pointer

◆ interval_pointer

◆ list_pointer

◆ mesh_pointer

◆ vertex_pointer

Enumeration Type Documentation

◆ PointType

Enumerator
VERTEX 
EDGE 
FACE 
UNDEFINED_POINT 
327{
328 VERTEX,
329 EDGE,
330 FACE,
332};
@ UNDEFINED_POINT
Definition exact_geodesic.cpp:331
@ VERTEX
Definition exact_geodesic.cpp:328
@ FACE
Definition exact_geodesic.cpp:330
@ EDGE
Definition exact_geodesic.cpp:329

Function Documentation

◆ angle_from_edges()

double igl::geodesic::angle_from_edges ( double const  a,
double const  b,
double const  c 
)
inline
56{
57 return acos(cos_from_edges(a,b,c));
58}
EIGEN_DEVICE_FUNC const AcosReturnType acos() const
Definition ArrayCwiseUnaryOps.h:262
double cos_from_edges(double const a, double const b, double const c)
Definition exact_geodesic.cpp:40

References acos(), and cos_from_edges().

Referenced by igl::geodesic::Mesh::build_adjacencies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cos_from_edges()

double igl::geodesic::cos_from_edges ( double const  a,
double const  b,
double const  c 
)
inline
43{
44 assert(a>1e-50);
45 assert(b>1e-50);
46 assert(c>1e-50);
47
48 double result = (b*b + c*c - a*a)/(2.0*b*c);
49 result = std::max(result, -1.0);
50 return std::min(result, 1.0);
51}

Referenced by angle_from_edges().

+ Here is the caller graph for this function:

◆ fill_surface_point_double()

void igl::geodesic::fill_surface_point_double ( geodesic::SurfacePoint point,
double *  data,
long  mesh_id 
)
inline
1168{
1169 data[0] = point->x();
1170 data[1] = point->y();
1171 data[2] = point->z();
1172 data[4] = point->base_element()->id();
1173
1174 if(point->type() == VERTEX) //vertex
1175 {
1176 data[3] = 0;
1177 }
1178 else if(point->type() == EDGE) //edge
1179 {
1180 data[3] = 1;
1181 }
1182 else //face
1183 {
1184 data[3] = 2;
1185 }
1186}
unsigned & id()
Definition exact_geodesic.cpp:350
double & x()
Definition exact_geodesic.cpp:374
double & z()
Definition exact_geodesic.cpp:376
double & y()
Definition exact_geodesic.cpp:375
base_pointer & base_element()
Definition exact_geodesic.cpp:603
PointType type()
Definition exact_geodesic.cpp:602

References igl::geodesic::SurfacePoint::base_element(), EDGE, igl::geodesic::MeshElementBase::id(), igl::geodesic::SurfacePoint::type(), VERTEX, igl::geodesic::Point3D::x(), igl::geodesic::Point3D::y(), and igl::geodesic::Point3D::z().

+ Here is the call graph for this function:

◆ fill_surface_point_structure()

void igl::geodesic::fill_surface_point_structure ( geodesic::SurfacePoint point,
double *  data,
Mesh mesh 
)
inline
1145{
1146 point->set(data);
1147 unsigned type = (unsigned) data[3];
1148 unsigned id = (unsigned) data[4];
1149
1150
1151 if(type == 0) //vertex
1152 {
1153 point->base_element() = &mesh->vertices()[id];
1154 }
1155 else if(type == 1) //edge
1156 {
1157 point->base_element() = &mesh->edges()[id];
1158 }
1159 else //face
1160 {
1161 point->base_element() = &mesh->faces()[id];
1162 }
1163}
std::vector< Vertex > & vertices()
Definition exact_geodesic.cpp:704
std::vector< Edge > & edges()
Definition exact_geodesic.cpp:705
std::vector< Face > & faces()
Definition exact_geodesic.cpp:706
void set(double new_x, double new_y, double new_z)
Definition exact_geodesic.cpp:378

References igl::geodesic::SurfacePoint::base_element(), igl::geodesic::Mesh::edges(), igl::geodesic::Mesh::faces(), igl::geodesic::Point3D::set(), and igl::geodesic::Mesh::vertices().

+ Here is the call graph for this function:

◆ length()

double igl::geodesic::length ( std::vector< SurfacePoint > &  path)
inline
1683{
1684 double length = 0;
1685 if(!path.empty())
1686 {
1687 for(unsigned i=0; i<path.size()-1; ++i)
1688 {
1689 length += path[i].distance(&path[i+1]);
1690 }
1691 }
1692 return length;
1693}
double length(std::vector< SurfacePoint > &path)
Definition exact_geodesic.cpp:1682

References length().

Referenced by igl::geodesic::GeodesicAlgorithmExact::construct_propagated_intervals(), igl::geodesic::IntervalList::covering_interval(), igl::exact_geodesic(), length(), print_info_about_path(), igl::geodesic::GeodesicAlgorithmExact::propagate(), and igl::geodesic::Interval::signal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator!=()

bool igl::geodesic::operator!= ( const HalfEdge x,
const HalfEdge y 
)
inline
672{
673 return x.vertex_0 != y.vertex_0 || x.vertex_1 != y.vertex_1;
674}

◆ operator<()

bool igl::geodesic::operator< ( const HalfEdge x,
const HalfEdge y 
)
inline
660{
661 if(x.vertex_0 == y.vertex_0)
662 {
663 return x.vertex_1 < y.vertex_1;
664 }
665 else
666 {
667 return x.vertex_0 < y.vertex_0;
668 }
669}

◆ operator==()

bool igl::geodesic::operator== ( const HalfEdge x,
const HalfEdge y 
)
inline
677{
678 return x.vertex_0 == y.vertex_0 && x.vertex_1 == y.vertex_1;
679}

◆ print_info_about_path()

void igl::geodesic::print_info_about_path ( std::vector< SurfacePoint > &  path)
inline
1696{
1697 std::cout << "number of the points in the path = " << path.size()
1698 << ", length of the path = " << length(path)
1699 << std::endl;
1700}

References length().

+ Here is the call graph for this function:

◆ read_mesh_from_file()

template<class Points , class Faces >
bool igl::geodesic::read_mesh_from_file ( char *  filename,
Points &  points,
Faces &  faces 
)
inline
64{
65 std::ifstream file(filename);
66 assert(file.is_open());
67 if(!file.is_open()) return false;
68
69 unsigned num_points;
70 file >> num_points;
71 assert(num_points>=3);
72
73 unsigned num_faces;
74 file >> num_faces;
75
76 points.resize(num_points*3);
77 for(typename Points::iterator i=points.begin(); i!=points.end(); ++i)
78 {
79 file >> *i;
80 }
81
82 faces.resize(num_faces*3);
83 for(typename Faces::iterator i=faces.begin(); i!=faces.end(); ++i)
84 {
85 file >> *i;
86 }
87 file.close();
88
89 return true;
90}

Variable Documentation

◆ GEODESIC_INF

◆ SMALLEST_INTERVAL_RATIO