Functions | |
| CLASS_DECLSPEC void | GEOM_FADE25D::edgesToPolygons (const std::vector< Edge2 > &vEdgesIn, std::vector< std::vector< Edge2 > > &vvPolygonsOut, std::vector< Edge2 > &vRemainingOut) |
| Organize a set of edges into polygons. More... | |
| CLASS_DECLSPEC 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... | |
| CLASS_DECLSPEC 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... | |
| CLASS_DECLSPEC 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... | |
| CLASS_DECLSPEC double | GEOM_FADE25D::getArea25D (const Point2 *p0, const Point2 *p1, const Point2 *p2) |
| Get 2.5D area of a triangle. More... | |
| CLASS_DECLSPEC double | GEOM_FADE25D::getArea2D (const Point2 *p0, const Point2 *p1, const Point2 *p2) |
| Get 2D area of a triangle. More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::getBorders (const std::vector< Triangle2 * > &vT, std::vector< Segment2 > &vBorderSegmentsOut) |
| Get the border segments of a set of triangles. More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::getConnectedComponents (const std::vector< Triangle2 * > &vT, std::vector< std::vector< Triangle2 * > > &vvT) |
| Get connected components. More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::getDirectedEdges (const std::vector< Triangle2 * > &vT, std::vector< Edge2 > &vDirectedEdgesOut) |
| Get directed edges. More... | |
| CLASS_DECLSPEC int | GEOM_FADE25D::getGlobalNumCPU () |
| Get the number of cpu cores to be used. More... | |
| CLASS_DECLSPEC Vector2 | GEOM_FADE25D::getNormalVector (const Point2 &p0, const Point2 &p1, const Point2 &p2, bool &bOK) |
| Get the normal vector of a triangle. More... | |
| CLASS_DECLSPEC Orientation2 | GEOM_FADE25D::getOrientation2 (const Point2 *p0, const Point2 *p1, const Point2 *p2) |
| Get the orientation of three points. More... | |
| CLASS_DECLSPEC Orientation2 | GEOM_FADE25D::getOrientation2_mt (const Point2 *p0, const Point2 *p1, const Point2 *p2) |
| Get the orientation of three points (MT) More... | |
| CLASS_DECLSPEC CINC2 | GEOM_FADE25D::getPointCirclePosition (Triangle2 *pT, const Point2 &q) |
| Check the position of a point relative to the circumcircle of a triangle. More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::getSortedBoundaryPolygons (std::vector< Triangle2 * > &vConnectedComponent, std::vector< Edge2 > &vOutsidePolygon, std::vector< std::vector< Edge2 > > &vHolePolygons) |
| Get sorted boundary polygons. More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::getUndirectedEdges (const std::vector< Triangle2 * > &vT, std::vector< Edge2 > &vUndirectedEdgesOut) |
| Get undirected edges. More... | |
| CLASS_DECLSPEC bool | GEOM_FADE25D::isSimplePolygon (std::vector< Segment2 > &vSegments) |
| Check if a polygon is simple. More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::offsetPolygonPoints (double offset, const std::vector< Point2 > &vOrgPoints, std::vector< Point2 > &vOffsetPoints, double maxCorrectionFactor=1.0) |
| Get offset points (deprecated) More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::pointsToPolyline (std::vector< Point2 > &vInPoints, bool bClose, std::vector< Segment2 > &vOutSegments) |
| Create segments from a set of points. More... | |
| CLASS_DECLSPEC int | GEOM_FADE25D::setGlobalNumCPU (int numCPU) |
| Set the global number of threads to be used. More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::setGlobalTimeLimit_constraints (double ms) |
| Set a global time limit for constraint insertion. More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::setHighPrecisionIntersections (bool bUseHighPrecisionIntersections) |
| Enable or disable high-precision intersection calculations. More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::simplifyPolygon (const std::vector< Point2 > &vIn, double errBound, std::vector< Point2 > &vOut) |
| Simplify a polygon. More... | |
| CLASS_DECLSPEC bool | GEOM_FADE25D::sortRing (std::vector< Segment2 > &vRing) |
| Sort a vector of segments. More... | |
| CLASS_DECLSPEC bool | GEOM_FADE25D::sortRingCCW (std::vector< Segment2 > &vRing) |
| Order and orient a vector of segments (CCW) More... | |
| CLASS_DECLSPEC void | GEOM_FADE25D::untwistPolygon (std::vector< Segment2 > &vPolygon, std::vector< std::vector< Segment2 > > &vvPolygon) |
| Repair a selfintersecting polygon (deprecated) More... | |
| CLASS_DECLSPEC void GEOM_FADE25D::edgesToPolygons | ( | const std::vector< Edge2 > & | vEdgesIn, |
| std::vector< std::vector< Edge2 > > & | vvPolygonsOut, | ||
| std::vector< Edge2 > & | vRemainingOut | ||
| ) |
This method processes a set of unorganized edges, grouping them into one or more polygons when possible.
| [in] | vEdgesIn | A vector of Edge2 objects forming the input set. |
| [out] | vvPolygonsOut | A vector of output polygons, where each polygon is represented as a vector<Edge2>. |
| [out] | vRemainingOut | A vector containing edges that could not form a closed polygon. |
The method adds one vector<Edge2> to vvPolygonsOut for each polygon found in vEdgesIn. Any edges that do not form a closed polygon are stored in vRemainingOut.
edgesToPolygons()| CLASS_DECLSPEC bool GEOM_FADE25D::fillHole | ( | const std::vector< Point2 > & | vMeshCorners, |
| const std::vector< Segment2 > & | vPolygonSegments, | ||
| bool | bWithRefine, | ||
| bool | bVerbose, | ||
| std::vector< Point2 > & | vCornersOut | ||
| ) |
| [in] | vMeshCorners | specifies the input mesh, 3 points per triangle in counterclockwise order. |
| [in] | vPolygonSegments | are the edges of the closed polygon to be triangulated. |
| [in] | bWithRefine | specifies if additional vertices shall be created (bWithRefine=true is experimental, don't use currently) |
| [in] | bVerbose | specifies if warnings shall be printed to stdout |
| [out] | vCornersOut | contains the created fill triangles, 3 corners per triangle, counterclockwise oriented. |
| CLASS_DECLSPEC bool GEOM_FADE25D::fillHole | ( | const std::vector< std::pair< Segment2, Vector2 > > & | vPolygonSegments, |
| bool | bWithRefine, | ||
| bool | bVerbose, | ||
| std::vector< Point2 > & | vCornersOut | ||
| ) |
| [in] | vPolygonSegments | contains the segments of a closed, simple input polygon along with normal vectors. The segments are counterclockwise oriented and ordered with respect to the surface to be created. Check twice, the orientation is very important. The normal vectors point in the direction of the thought surface at the segment i.e., if a hole is filled, the normal vector of an adjecent triangle is taken but if a T-joint is filled the normal vector should be the average normal of the two triangles at the edge. |
| [in] | bWithRefine | specifies if additional vertices shall be created. (bWithRefine=true is experimental, don't use currently) |
| [in] | bVerbose | specifies if warnings shall be printed to stdout |
| [out] | vCornersOut | contains the created fill triangles, 3 corners per triangle, counterclockwise oriented. |
| CLASS_DECLSPEC bool GEOM_FADE25D::fillHole | ( | Mesh3 * | pMesh, |
| const std::vector< Edge2 > & | vPolygonEdges, | ||
| bool | bWithRefine, | ||
| bool | bVerbose, | ||
| std::vector< Point2 > & | vCornersOut | ||
| ) |
| [in] | pMesh | |
| [in] | vPolygonEdges | are edges of the polygon to be triangulated. They must form a closed polygon in the mesh. |
| [in] | bWithRefine | specifies if additional vertices shall be created (Note: bWithRefine=true is experimental, don't use currently) |
| [in] | bVerbose | specifies if warnings shall be printed to stdout |
| [out] | vCornersOut | contains the created fill triangles, 3 corners per triangle, counterclockwise oriented. |
| CLASS_DECLSPEC double GEOM_FADE25D::getArea25D | ( | const Point2 * | p0, |
| const Point2 * | p1, | ||
| const Point2 * | p2 | ||
| ) |
Computes the area of the triangle defined by the three input points p0, p1, and p2.
| [in] | p0,p1,p2 | The corners of the triangle. |
| CLASS_DECLSPEC double GEOM_FADE25D::getArea2D | ( | const Point2 * | p0, |
| const Point2 * | p1, | ||
| const Point2 * | p2 | ||
| ) |
Computes the 2D area of the triangle defined by the three input points p0, p1, p2.
| [in] | p0,p1,p2 | The corners of the triangle. |
| CLASS_DECLSPEC void GEOM_FADE25D::getBorders | ( | const std::vector< Triangle2 * > & | vT, |
| std::vector< Segment2 > & | vBorderSegmentsOut | ||
| ) |
This function computes the borders of the triangles in vT, which consist of all edges that have exactly one adjacent triangle in vT.
| [in] | vT | A vector containing the input triangles |
| [out] | vBorderSegmentsOut | A vector that will contain the border segments as Segment2 objects |
| CLASS_DECLSPEC void GEOM_FADE25D::getConnectedComponents | ( | const std::vector< Triangle2 * > & | vT, |
| std::vector< std::vector< Triangle2 * > > & | vvT | ||
| ) |
This function partitions the triangles in vT into connected components, which are sets of triangles that are connected by shared edges.
| [in] | vT | A vector containing the input triangles |
| [out] | vvT | A vector of vectors that will contain the connected components of triangles |
| CLASS_DECLSPEC void GEOM_FADE25D::getDirectedEdges | ( | const std::vector< Triangle2 * > & | vT, |
| std::vector< Edge2 > & | vDirectedEdgesOut | ||
| ) |
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).
| CLASS_DECLSPEC int GEOM_FADE25D::getGlobalNumCPU | ( | ) |
| CLASS_DECLSPEC Vector2 GEOM_FADE25D::getNormalVector | ( | const Point2 & | p0, |
| const Point2 & | p1, | ||
| const Point2 & | p2, | ||
| bool & | bOK | ||
| ) |
Computes the normalized normal vector of the triangle defined by the three input points p0, p1, and p2.
| [in] | p0,p1,p2 | The corners of the triangle. If these points are counterclockwise (CCW) oriented, the resulting normal vector points towards the viewer. |
| [out] | bOK | A boolean value that returns true for valid results or false if the input points are collinear. |
| CLASS_DECLSPEC 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.
| [in] | p0,p1,p2 | The three input points. |
ORIENTATION2_COLLINEAR if p0, p1, p2 are collinear.ORIENTATION2_CCW if p0, p1, p2 are counterclockwise (CCW) oriented.ORIENTATION2_CW if p0, p1, p2 are clockwise (CW) oriented.| CLASS_DECLSPEC Orientation2 GEOM_FADE25D::getOrientation2_mt | ( | const Point2 * | p0, |
| const Point2 * | p1, | ||
| const Point2 * | p2 | ||
| ) |
This function returns the exact orientation of the points p0, p1, p2.
| [in] | p0,p1,p2 | The three input points. |
ORIENTATION2_COLLINEAR if p0, p1, p2 are collinear.ORIENTATION2_CCW if p0, p1, p2 are counterclockwise (CCW) oriented.ORIENTATION2_CW if p0, p1, p2 are clockwise (CW) oriented.This function determines the position of the query point q in relation to the circumcircle of the given triangle pT.
| pT | The triangle whose circumcircle is used for the test. | |
| [in] | q | The point whose position relative to the circumcircle is evaluated. |
q relative to the circumcircle:CINC2_ZERO: q is exactly on the boundary of the circumcircle of pT.CINC2_INCIRCLE: q is inside the circumcircle of pT.CINC2_OUTCIRCLE: q is outside the circumcircle of pT. | CLASS_DECLSPEC void GEOM_FADE25D::getSortedBoundaryPolygons | ( | std::vector< Triangle2 * > & | vConnectedComponent, |
| std::vector< Edge2 > & | vOutsidePolygon, | ||
| std::vector< std::vector< Edge2 > > & | vHolePolygons | ||
| ) |
This function processes a single edge-connected component of triangles and returns the outer polygon, as well as any inner hole polygons, if present.
| [in] | vConnectedComponent | A connected component of triangles, where the term "connected" means adjacency on edges. It is important that only one connected component is passed! |
| [out] | vOutsidePolygon | The outside boundary of the connected component. |
| [out] | vHolePolygons | A vector that will contain any hole polygons, if they exist. |
| CLASS_DECLSPEC void GEOM_FADE25D::getUndirectedEdges | ( | const std::vector< Triangle2 * > & | vT, |
| std::vector< Edge2 > & | vUndirectedEdgesOut | ||
| ) |
This function computes the edges of the input triangles. The term "undirected" means that edges which appear twice with different orientations (i.e., reversed directions) are only returned once, with an arbitrary orientation.
| [in] | vT | A vector containing the input triangles. |
| [out] | vUndirectedEdgesOut | A vector that will contain the output edges. |
| CLASS_DECLSPEC bool GEOM_FADE25D::isSimplePolygon | ( | std::vector< Segment2 > & | vSegments | ) |
This function checks whether the given set of segments forms a simple polygon. A polygon is considered simple if it is closed (the first and last vertices are connected) and does not have any self-intersections. Degenerate segments (i.e., segments with zero length) are ignored during the check.
| [in] | vSegments | A vector of Segment2 objects forming the input. |
true if vSegments forms a closed polygon without self-intersections; false otherwise. | CLASS_DECLSPEC void GEOM_FADE25D::offsetPolygonPoints | ( | double | offset, |
| const std::vector< Point2 > & | vOrgPoints, | ||
| std::vector< Point2 > & | vOffsetPoints, | ||
| double | maxCorrectionFactor = 1.0 |
||
| ) |
| offset | specifies the offset distance (positive or negative) | |
| [in] | vOrgPoints | are ordered points of a counterclockwise polygon (no point repeated) |
| [out] | vOffsetPoints | returns points moved outside/inside by a positive/negative offset distance (times the angle correction factor) |
| [in] | maxCorrectionFactor | is the maximum angle correction factor that may be applied to the offset value. It's default value is 1.0 (no angle correction), lower values are ignored. The angle that can be corrected with a certain maxCorrectionFactor is computed according to |
simplifyPolygon() before using this function.| CLASS_DECLSPEC void GEOM_FADE25D::pointsToPolyline | ( | std::vector< Point2 > & | vInPoints, |
| bool | bClose, | ||
| std::vector< Segment2 > & | vOutSegments | ||
| ) |
Turns a vector of points (p0, p1, p2, ..., pm, pn) into a vector of segments ((p0, p1), (p1, p2), ..., (pm, pn)). In case that bClose is true and pn!=p0, an additional segment (pn, p0) is constructed. Degenerate segments are ignored. Self-intersections of the polyline are not checked.
| [in] | vInPoints | The input vector of points. |
| [in] | bClose | Specifies whether a closing segment shall be constructed. |
| [out] | vOutSegments | The output vector where the segments are stored. |
| CLASS_DECLSPEC int GEOM_FADE25D::setGlobalNumCPU | ( | int | numCPU | ) |
Sets the number of CPU cores that Fade should use for parallel operations.
| numCPU | The number of CPU cores to be used. A value of 0 means autodetection. |
Characteristics:
| CLASS_DECLSPEC void GEOM_FADE25D::setGlobalTimeLimit_constraints | ( | double | ms | ) |
| ms | Time limit in milliseconds. Use DBL_MAX to disable the limit. |
This function is only needed in special cases: When multiple constraint segments intersect and lie very close to each other, there may not be enough space to insert intersection points without creating new overlaps. Such situations are extremely rare and have only been observed when almost vertical walls were created. Avoid such constructions whenever possible, as they may lead to infinite geometric loops.
If such constructions cannot be avoided, use this function to set a time limit. If the specified time is exceeded during constraint insertion, an exception is thrown. Consider also using setHighPrecisionIntersections(true) for more accurate handling of constraint segment intersections.
| CLASS_DECLSPEC void GEOM_FADE25D::setHighPrecisionIntersections | ( | bool | bUseHighPrecisionIntersections | ) |
This function enables or disables the use of high-precision arithmetic when computing intersections between constraint segments. High-precision mode is more robust in degenerate cases but comes at a performance cost. In virtually all scenarios, the default precision is safe and sufficient. Therefore, high-precision intersection is disabled by default.
Enable high-precision mode only if you are dealing with problematic input data, such as when constraint segments are extremely close to each other. This situation can occur, for example, with nearly vertical triangles.
| bUseHighPrecisionIntersections | Pass true to enable high-precision intersection computations, or false to use the faster default method. |
| CLASS_DECLSPEC void GEOM_FADE25D::simplifyPolygon | ( | const std::vector< Point2 > & | vIn, |
| double | errBound, | ||
| std::vector< Point2 > & | vOut | ||
| ) |
This function simplifies the input polygon based on the specified geometric error. Does not automatically check for self-intersections.
| [in] | vIn | specifies the input polygon to be simplified. |
| [in] | errBound | bounds the maximum geometric error. |
| [out] | vOut | the simplified output polygon. |
| CLASS_DECLSPEC bool GEOM_FADE25D::sortRing | ( | std::vector< Segment2 > & | vRing | ) |
This function reorients and sorts the segments in vRing such that each segment joins at the endpoint of the previous one.
| [in,out] | vRing | A vector of segments to be sorted and reoriented. |
true if the sorting was successful; otherwise, false. | CLASS_DECLSPEC bool GEOM_FADE25D::sortRingCCW | ( | std::vector< Segment2 > & | vRing | ) |
This function reorients and sorts the segments in vRing such that the resulting polygon is counterclockwise oriented. It ensures that subsequent segments join at their endpoints to form a continuous polygon.
| [in,out] | vRing | A vector of segments that will be sorted and reoriented to form a CCW polygon. |
true if the sorting was successful; otherwise, false. | CLASS_DECLSPEC void GEOM_FADE25D::untwistPolygon | ( | std::vector< Segment2 > & | vPolygon, |
| std::vector< std::vector< Segment2 > > & | vvPolygon | ||
| ) |
| 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 |