Geom Software - C++ Programming and Geometry Libraries
Fade2.5D Documentation pages v1.55
Free Functions

## Functions

Vector2 GEOM_FADE25D::getNormalVector (const Point2 &p0, const Point2 &p1, const Point2 &p2)
Get normal vector. More...

void GEOM_FADE25D::getDirectedEdges (std::vector< Triangle2 *> &vT, std::vector< Edge2 > &vDirectedEdgesOut)
Get directed edge The directed edges of `vT` are returned `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).

void GEOM_FADE25D::getUndirectedEdges (std::vector< Triangle2 *> &vT, std::vector< Edge2 > &vUndirectedEdgesOut)
Get undirected edges. More...

Get the Fade2D version string.

Get the major version number.

Get the minor version number.

Get the revision version number.

Check if a RELEASE or a DEBUG version is used.

void GEOM_FADE25D::getBorders (const std::vector< Triangle2 *> &vT, std::vector< Segment2 > &vBorderSegmentsOut)
Get Borders. More...

bool GEOM_FADE25D::sortRing (std::vector< Segment2 > &vRing)
Sort a vector of Segments. 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...

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::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...

bool GEOM_FADE25D::writePointsBIN (const char *filename, const std::vector< Point2 > &vPointsIn)
Write points to a binary file. More...

bool GEOM_FADE25D::writePointsBIN (const char *filename, std::vector< Point2 *> &vPointsIn)
Write points to a binary file. More...

bool GEOM_FADE25D::readPointsBIN (const char *filename, std::vector< Point2 > &vPointsIn)
Read points from a binary file. More...

bool GEOM_FADE25D::writeSegmentsBIN (const char *filename, std::vector< Segment2 > &vSegmentsIn)
Write segments to a binary file. More...

bool GEOM_FADE25D::readSegmentsBIN (const char *filename, std::vector< Segment2 > &vSegmentsOut)
Read segments from a binary file. More...

## ◆ getBorders()

 void GEOM_FADE25D::getBorders ( const std::vector< Triangle2 *> & vT, std::vector< Segment2 > & vBorderSegmentsOut )

Computes the border of the triangles in `vT`. The border consists of all edges having only one adjacent triangle in vT.

Parameters
 [in] vT are the input triangles [out] vBorderSegmentsOut is used to return all border segments

## ◆ getNormalVector()

 Vector2 GEOM_FADE25D::getNormalVector ( const Point2 & p0, const Point2 & p1, const Point2 & p2 )

Returns the normalized normal vector of the triangle defined by the three input points `p0`, `p1`, `p2`

## ◆ getOrientation2()

 Orientation2 GEOM_FADE25D::getOrientation2 ( const Point2 * p0, const Point2 * p1, const Point2 * p2 )

This function returns the exact orientation of the points `p0`, `p1`, `p2` Possible values are
ORIENTATION2_COLLINEAR if `p0`, `p1`, `p2` are located on a line,
ORIENTATION2_CCW if `p0`, `p1`, `p2` are counterclockwise oriented
ORIENTATION2_CW if `p0`, `p1`, `p2` are clockwise oriented
Not thread-safe but a bit faster than the thread-safe version

## ◆ getOrientation2_mt()

 Orientation2 GEOM_FADE25D::getOrientation2_mt ( const Point2 * p0, const Point2 * p1, const Point2 * p2 )
Orientation2 getOrientation2(const Point2* p0,const Point2* p1,const Point2* p2);

This version is thread-safe.

## ◆ getUndirectedEdges()

 void GEOM_FADE25D::getUndirectedEdges ( std::vector< Triangle2 *> & vT, std::vector< Edge2 > & vUndirectedEdgesOut )

A unique set of edges of `vT` is returned.

 bool GEOM_FADE25D::readPointsBIN ( const char * filename, std::vector< Point2 > & vPointsIn )

Reads points from a binary file of type 20 or 30

bool writePointsBIN(const char* filename,const std::vector<Point2>& vPointsIn)

 bool GEOM_FADE25D::readSegmentsBIN ( const char * filename, std::vector< Segment2 > & vSegmentsOut )

Reads segments from a binary file of type 21 or 31

bool writeSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsIn);

 bool GEOM_FADE25D::readXY ( const char * filename, std::vector< Point2 > & vPointsOut )

Reads points from an ASCII file. Expected file format: Two coordinates (x y) per line, whitespace separated.

The z coordinate is set to 0.

 bool GEOM_FADE25D::readXYZ ( const char * filename, std::vector< Point2 > & vPointsOut )

Reads points from an ASCII file. Expected file format: Three coordinates (x y z) per line, whitespace separated.

## ◆ sortRing()

 bool GEOM_FADE25D::sortRing ( std::vector< Segment2 > & vRing )

The segments in vRing are reoriented and sorted such that subsequent segments join at the endpoints.

## ◆ writePointsASCII() [1/2]

 bool GEOM_FADE25D::writePointsASCII ( const char * filename, const std::vector< Point2 *> & vPointsIn )

Writes points to an ASCII file, three coordinates (x y z) per line, whitespace separated.

Note
Data exchange through ASCII files is easy and convenient but floating point coordinates are not necessarily exact when represented as decimal numbers. If the tiny rounding errors can't be accepted in your setting you are advised to write binary files, (use writePointsBIN(const char* filename,const std::vector<Point2>& vPointsIn))

## ◆ writePointsASCII() [2/2]

 bool GEOM_FADE25D::writePointsASCII ( const char * filename, const std::vector< Point2 > & vPointsIn )
bool writePointsASCII(const char* filename,const std::vector<Point2*>& vPointsIn);

## ◆ writePointsBIN() [1/2]

 bool GEOM_FADE25D::writePointsBIN ( const char * filename, const std::vector< Point2 > & vPointsIn )

File format:
int filetype (30)
size_t numPoints (`vPointsIn.size()`)
double x0
double y0
double z0
...
double xn
double yn
double zn

## ◆ writePointsBIN() [2/2]

 bool GEOM_FADE25D::writePointsBIN ( const char * filename, std::vector< Point2 *> & vPointsIn )
writePointsBIN(const char* filename,const std::vector<Point2>& vPointsIn);

## ◆ writeSegmentsBIN()

 bool GEOM_FADE25D::writeSegmentsBIN ( const char * filename, std::vector< Segment2 > & vSegmentsIn )

Binary file format:
int filetype (31)
size_t numSegments (`vSegmentsIn.size()`)
double x0_source
double y0_source
double z0_source
double x0_target
double y0_target
double z0_target
...
double xn_source
double yn_source
double zn_source
double xn_target
double yn_target
double zn_target