Fade2.5D Documentation pages v2.16.3
Delaunay Features
freeFunctions.h File Reference
#include "Point2.h"
#include "Segment2.h"
#include "Edge2.h"
#include <vector>

Go to the source code of this file.

Functions

void GEOM_FADE25D::edgesToPolygons (const std::vector< Edge2 > &vEdgesIn, std::vector< std::vector< Edge2 > > &vvPolygonsOut, std::vector< Edge2 > &vRemainingOut)
 Create polygons from a set of edges. More...
 
bool GEOM_FADE25D::fillHole (const std::vector< Point2 > &vMeshCorners, const std::vector< Segment2 > &vPolygonSegments, bool bWithRefine, bool bVerbose, std::vector< Point2 > &vCornersOut)
 Fill a hole in a 3D mesh with triangles (deprecated) More...
 
bool GEOM_FADE25D::fillHole (const std::vector< std::pair< Segment2, Vector2 > > &vPolygonSegments, bool bWithRefine, bool bVerbose, std::vector< Point2 > &vCornersOut)
 Fill a hole in a 3D mesh with triangles (deprecated) More...
 
bool GEOM_FADE25D::fillHole (Mesh3 *pMesh, const std::vector< Edge2 > &vPolygonEdges, bool bWithRefine, bool bVerbose, std::vector< Point2 > &vCornersOut)
 Fill a hole in a 3D mesh with triangles (deprecated) More...
 
double GEOM_FADE25D::getArea25D (const Point2 *p0, const Point2 *p1, const Point2 *p2)
 Get 2.5D area of a triangle. More...
 
double GEOM_FADE25D::getArea2D (const Point2 *p0, const Point2 *p1, const Point2 *p2)
 Get 2D area of a triangle. More...
 
void GEOM_FADE25D::getBorders (const std::vector< Triangle2 * > &vT, std::vector< Segment2 > &vBorderSegmentsOut)
 Get Borders. More...
 
void GEOM_FADE25D::getConnectedComponents (const std::vector< Triangle2 * > &vT, std::vector< std::vector< Triangle2 * > > &vvT)
 Get connected components. More...
 
void GEOM_FADE25D::getDirectedEdges (const std::vector< Triangle2 * > &vT, std::vector< Edge2 > &vDirectedEdgesOut)
 Get directed edges The directed edges of vT are returned in vDirectedEdgesOut. Directed means that each edge (a,b) with two adjacent triangles in vT is returned twice, as edge(a,b) and edge(b,a).
 
const char * GEOM_FADE25D::getFade2DVersion ()
 Get the Fade2D version string.
 
int GEOM_FADE25D::getGlobalNumCPU ()
 Get the global number of threads to be used. More...
 
int GEOM_FADE25D::getMajorVersionNumber ()
 Get the major version number.
 
int GEOM_FADE25D::getMinorVersionNumber ()
 Get the minor version number.
 
Vector2 GEOM_FADE25D::getNormalVector (const Point2 &p0, const Point2 &p1, const Point2 &p2, bool &bOK)
 Get normal vector. More...
 
Orientation2 GEOM_FADE25D::getOrientation2 (const Point2 *p0, const Point2 *p1, const Point2 *p2)
 Get the orientation of three points. More...
 
Orientation2 GEOM_FADE25D::getOrientation2_mt (const Point2 *p0, const Point2 *p1, const Point2 *p2)
 Get Orientation2 (MT) More...
 
int GEOM_FADE25D::getRevisionNumber ()
 Get the revision version number.
 
void GEOM_FADE25D::getSortedBoundaryPolygons (std::vector< Triangle2 * > &vConnectedComponent, std::vector< Edge2 > &vOutsidePolygon, std::vector< std::vector< Edge2 > > &vHolePolygons)
 Get sorted boundary polygons. More...
 
void GEOM_FADE25D::getUndirectedEdges (const std::vector< Triangle2 * > &vT, std::vector< Edge2 > &vUndirectedEdgesOut)
 Get undirected edges. More...
 
bool GEOM_FADE25D::isRelease ()
 Check if a RELEASE or a DEBUG version is used.
 
bool GEOM_FADE25D::isSimplePolygon (std::vector< Segment2 > &vSegments)
 isSimplePolygon More...
 
void GEOM_FADE25D::offsetPolygonPoints (double offset, const std::vector< Point2 > &vOrgPoints, std::vector< Point2 > &vOffsetPoints, double maxCorrectionFactor=1.0)
 
void GEOM_FADE25D::pointsToPolyline (std::vector< Point2 > &vInPoints, bool bClose, std::vector< Segment2 > &vOutSegments)
 Points-to-Polyline. More...
 
bool GEOM_FADE25D::readPointsBIN (const char *filename, std::vector< Point2 > &vPointsIn, bool bWithHeader=true)
 Read points from a binary file. More...
 
bool GEOM_FADE25D::readPointsPLY (const char *filename, bool bUniquePoints, std::vector< Point2 > &vPoints, std::vector< VtxColor > *pVertexColors=NULL)
 Read points from a *.PLY file. More...
 
bool GEOM_FADE25D::readPointsPLY (std::istream &is, bool bUniquePoints, std::vector< Point2 > &vPoints, std::vector< VtxColor > *pVertexColors=NULL)
 Read points from a *.PLY file. More...
 
bool GEOM_FADE25D::readSegmentsBIN (const char *filename, std::vector< Segment2 > &vSegmentsOut)
 Read segments from a binary file. More...
 
bool GEOM_FADE25D::readXY (const char *filename, std::vector< Point2 > &vPointsOut)
 Read (x y) points. More...
 
bool GEOM_FADE25D::readXYZ (const char *filename, std::vector< Point2 > &vPointsOut)
 Read (x y z) points. More...
 
int GEOM_FADE25D::setGlobalNumCPU (int numCPU)
 Set the global number of threads to be used. More...
 
void GEOM_FADE25D::simplifyPolygon (const std::vector< Point2 > &vIn, double errBound, std::vector< Point2 > &vOut)
 Simplify a polygon. More...
 
bool GEOM_FADE25D::sortRing (std::vector< Segment2 > &vRing)
 Sort a vector of Segments. More...
 
bool GEOM_FADE25D::sortRingCCW (std::vector< Segment2 > &vRing)
 Sort a vector of Segments. More...
 
void GEOM_FADE25D::untwistPolygon (std::vector< Segment2 > &vPolygon, std::vector< std::vector< Segment2 > > &vvPolygon)
 Repair a selfintersecting polygon. More...
 
bool GEOM_FADE25D::writePointsASCII (const char *filename, const std::vector< Point2 * > &vPointsIn)
 Write points to an ASCII file. More...
 
bool GEOM_FADE25D::writePointsASCII (const char *filename, const std::vector< Point2 > &vPointsIn)
 Write points to an ASCII file. More...
 
bool GEOM_FADE25D::writePointsBIN (const char *filename, std::vector< Point2 * > &vPoints)
 Write points to a binary file. More...
 
bool GEOM_FADE25D::writePointsBIN (const char *filename, std::vector< Point2 > &vPoints)
 Write points to a binary file. More...
 
bool GEOM_FADE25D::writePointsPLY (const char *filename, std::vector< Point2 * > &vPoints, bool bASCII)
 Write points to a *.PLY file. More...
 
bool GEOM_FADE25D::writePointsPLY (std::ostream &os, std::vector< Point2 * > &vPoints, bool bASCII)
 Write points to a *.PLY file. More...
 
bool GEOM_FADE25D::writeSegmentsBIN (const char *filename, std::vector< Segment2 > &vSegmentsIn)
 Write segments to a binary file. More...
 

Function Documentation

◆ getGlobalNumCPU()

int GEOM_FADE25D::getGlobalNumCPU ( )

Get the global number of threads to be used.

Note
Fade is by default single-threaded to avoid nested multithreading when Fade runs in multiple threads of your application but you can change the number of threads using setGlobalNumCPU()

◆ getSortedBoundaryPolygons()

void GEOM_FADE25D::getSortedBoundaryPolygons ( std::vector< Triangle2 * > &  vConnectedComponent,
std::vector< Edge2 > &  vOutsidePolygon,
std::vector< std::vector< Edge2 > > &  vHolePolygons 
)

Get sorted boundary polygons.

This function takes ONE connected component of triangles. It returns the outer polygon as well as the inner hole polygons if any.

Parameters
[in]vConnectedComponentis a connected component of triangles where the term "connected" means adjacency on edges. It is important that just one connected component is passed!
[out]vOutsidePolygonis the outside boundary of the connected component.
[out]vHolePolygonscontains the hole polygons (if any)

Edges in output polygons are sorted and CCW-oriented with respect to their triangle. Thus the outer polygon is always CCW oriented and holes are always CW oriented. This is sometimes a useful property.

Attention
Pass only one connected component.

◆ setGlobalNumCPU()

int GEOM_FADE25D::setGlobalNumCPU ( int  numCPU)

Set the global number of threads to be used.

Parameters
numCPUis the number of CPU cores to be used and is 0 (means autodetect) or greater.
Returns
the number of CPU cores that will be used
Note
Fade is by default single-threaded to avoid nested multithreading when Fade runs in multiple threads of your application.

Characteristics:

  • For technical reasons you should insert points into a triangulation before you insert constraint segments. Then the algorithm can fully benefit from multithreading.
  • Fade continues support for very old compilers but multithreading is not available for VS2010 and CentOS6.4 library versions.

◆ simplifyPolygon()

void GEOM_FADE25D::simplifyPolygon ( const std::vector< Point2 > &  vIn,
double  errBound,
std::vector< Point2 > &  vOut 
)

Simplify a polygon.

This function simplifies the input polygon based on the specified geometric error.

Parameters
[in]vInspecifies the input polygon to be simplified.
[in]errBoundbounds the maximum geometric error.
[out]vOutthe simplified output polygon.

◆ untwistPolygon()

void GEOM_FADE25D::untwistPolygon ( std::vector< Segment2 > &  vPolygon,
std::vector< std::vector< Segment2 > > &  vvPolygon 
)

Repair a selfintersecting polygon.

Deprecated: This function is deprecated but retained for backward compatibility. It is recommended to use the PolygonClipper class instead, which offers greater versatility and robustness.

Parameters
vPolygon[in] The input polygon, no specific order and orientation
vvPolygon[out] One or more output polygons, free of selfintersections, counterclockwise oriented around the enclosed area