Group detail#
Modules#
Type | Name |
---|---|
module | Algorithm implementation details |
module | IO implementation details |
Namespaces#
Type | Name |
---|---|
namespace | SFCGAL::detail Implementation details namespace. |
namespace | SFCGAL::triangulate::detail Triangulate detail namespace. |
Classes#
Type | Name |
---|---|
class | SFCGAL::algorithm::BoundaryVisitor |
class | SFCGAL::algorithm::ConsistentOrientationBuilder |
class | SFCGAL::algorithm::SurfaceGraph |
class | SFCGAL::algorithm::WeightedCentroid |
Public Functions#
Public Functions Documentation#
function area#
auto algorithm::area (
const Triangle & g
)
Returns Compute the 2D area for a Triangle
function area#
auto algorithm::area (
const Polygon & g
)
Returns Compute the 2D area for a Polygon
function area#
auto algorithm::area (
const GeometryCollection & g
)
Returns the 2D area for a GeometryCollection
function area#
auto algorithm::area (
const TriangulatedSurface & g
)
Returns the 2D area for a TriangulatedSurface
function area#
auto algorithm::area (
const PolyhedralSurface & g
)
Returns the 2D area for a TriangulatedSurface
function area3D#
auto algorithm::area3D (
const Geometry & g,
NoValidityCheck
)
Returns 3D area for a Geometry
Warning:
Solid area is set to 0 (might be defined as the area of the surface)
Precondition:
g is a valid geometry
Warning:
No actual validity check is done
function area3D#
auto algorithm::area3D (
const Polygon & g
)
Returns 3D area for a Polygon
function area3D#
auto algorithm::area3D (
const GeometryCollection & g
)
Returns the 3D area for a MultiPolygon
function area3D#
auto algorithm::area3D (
const PolyhedralSurface & g
)
Returns the 3D area for a PolyhedralSurface
function area3D#
auto algorithm::area3D (
const Triangle & g
)
Returns the 3D area for a Triangle
function area3D#
auto algorithm::area3D (
const TriangulatedSurface & g
)
Returns the 3D area for a TriangulatedSurface
function collect#
template<typename GeometryIterator>
std::unique_ptr< Geometry > algorithm::collect (
GeometryIterator begin,
GeometryIterator end
)
Returns an aggregate of a list of geometries
function covers#
template<int Dim>
bool algorithm::covers (
const detail::GeometrySet < Dim > & a,
const detail::GeometrySet < Dim > & b
)
function covers#
template<int Dim>
bool algorithm::covers (
const detail::PrimitiveHandle < Dim > & a,
const detail::PrimitiveHandle < Dim > & b
)
function coversPoints#
auto algorithm::coversPoints (
const Geometry & ga,
const Geometry & gb
)
Pseudo cover test on 2D geometries. Collect points of gb and tests if no points of gb is outside ga
function coversPoints3D#
auto algorithm::coversPoints3D (
const Geometry & ga,
const Geometry & gb
)
Pseudo cover test on 3D geometries. Collect points of gb and tests if no points of gb is outside ga
function distanceGeometryCollectionToGeometry#
auto algorithm::distanceGeometryCollectionToGeometry (
const Geometry & gA,
const Geometry & gB
)
dispatch distance from a collection of geometry (gA) to a Geometry (gB)
function distanceGeometryCollectionToGeometry3D#
auto algorithm::distanceGeometryCollectionToGeometry3D (
const Geometry & gA,
const Geometry & gB
)
dispatch distance from a collection of geometry (gA) to a Geometry (gB)
function distanceLineStringGeometry#
auto algorithm::distanceLineStringGeometry (
const LineString & gA,
const Geometry & gB
)
dispatch distance from LineString to Geometry
function distanceLineStringGeometry3D#
auto algorithm::distanceLineStringGeometry3D (
const LineString & gA,
const Geometry & gB
)
dispatch distance between a LineString and a Geometry
function distanceLineStringLineString#
auto algorithm::distanceLineStringLineString (
const LineString & gA,
const LineString & gB
)
distance between two LineStrings
function distanceLineStringLineString3D#
auto algorithm::distanceLineStringLineString3D (
const LineString & gA,
const LineString & gB
)
distance between two LineStrings
function distanceLineStringPolygon#
auto algorithm::distanceLineStringPolygon (
const LineString & gA,
const Polygon & gB
)
distance between a LineString and a Polygon
function distanceLineStringPolygon3D#
auto algorithm::distanceLineStringPolygon3D (
const LineString & gA,
const Polygon & gB
)
distance between a LineString and a Polygon
Todo
same method than distancePointPolygon3D (unify if triangulate is available)
function distanceLineStringPolyhedralSurface3D#
auto algorithm::distanceLineStringPolyhedralSurface3D (
const LineString & lineA,
const PolyhedralSurface & polySurfaceB
)
distance between a LineString and a PolyhedralSurface
function distanceLineStringSolid3D#
auto algorithm::distanceLineStringSolid3D (
const LineString & gA,
const Solid & gB
)
distance between a LineString and a Solid
function distanceLineStringTriangle#
auto algorithm::distanceLineStringTriangle (
const LineString & gA,
const Triangle & gB
)
distance between a LineString and a Triangle
function distanceLineStringTriangle3D#
auto algorithm::distanceLineStringTriangle3D (
const LineString & gA,
const Triangle & gB
)
distance between a LineString and a Triangle
function distanceLineStringTriangulatedSurface3D#
auto algorithm::distanceLineStringTriangulatedSurface3D (
const LineString & lineA,
const TriangulatedSurface & triangulatedSurfaceB
)
distance between a LineString and a TriangulatedSurface
function distancePointGeometry#
auto algorithm::distancePointGeometry (
const Point & gA,
const Geometry & gB
)
dispatch distance from Point to Geometry
function distancePointGeometry3D#
auto algorithm::distancePointGeometry3D (
const Point & gA,
const Geometry & gB
)
dispatch distance from Point to Geometry
function distancePointLineString#
auto algorithm::distancePointLineString (
const Point & gA,
const LineString & gB
)
distance between a Point and a LineString
function distancePointLineString3D#
auto algorithm::distancePointLineString3D (
const Point & gA,
const LineString & gB
)
distance between a Point and a LineString
function distancePointPoint#
auto algorithm::distancePointPoint (
const Point & gA,
const Point & gB
)
distance between two Points
function distancePointPoint3D#
auto algorithm::distancePointPoint3D (
const Point & gA,
const Point & gB
)
distance between two Points
function distancePointPolygon#
auto algorithm::distancePointPolygon (
const Point & gA,
const Polygon & gB
)
distance between a Point and a Polygon
function distancePointPolygon3D#
auto algorithm::distancePointPolygon3D (
const Point & gA,
const Polygon & gB
)
distance between a Point and a Triangle
function distancePointPolyhedralSurface3D#
auto algorithm::distancePointPolyhedralSurface3D (
const Point & pointA,
const PolyhedralSurface & polySurfaceB
)
distance between a Point and a PolyhedralSurface
function distancePointSegment#
auto algorithm::distancePointSegment (
const Point & p,
const Point & a,
const Point & b
)
function distancePointSegment3D#
auto algorithm::distancePointSegment3D (
const Point & p,
const Point & a,
const Point & b
)
function distancePointSolid3D#
auto algorithm::distancePointSolid3D (
const Point & gA,
const Solid & gB
)
distance between a Point and a Solid
function distancePointTriangle#
auto algorithm::distancePointTriangle (
const Point & gA,
const Triangle & gB
)
distance between a Point and a Triangle
function distancePointTriangle3D#
auto algorithm::distancePointTriangle3D (
const Point & gA,
const Triangle & gB
)
distance between a Point and a Triangle
function distancePointTriangle3D#
auto algorithm::distancePointTriangle3D (
const Point & p_,
const Point & a_,
const Point & b_,
const Point & c_
)
function distancePointTriangulatedSurface3D#
auto algorithm::distancePointTriangulatedSurface3D (
const Point & pointA,
const TriangulatedSurface & triangulatedSurfaceB
)
distance between a Point and a TriangulatedSurface
function distancePolygonGeometry#
auto algorithm::distancePolygonGeometry (
const Polygon & gA,
const Geometry & gB
)
dispatch distance from Polygon to Geometry
function distancePolygonGeometry3D#
auto algorithm::distancePolygonGeometry3D (
const Polygon & gA,
const Geometry & gB
)
dispatch distance between a Polygon and a Geometry
function distancePolygonPolygon#
auto algorithm::distancePolygonPolygon (
const Polygon & gA,
const Polygon & gB
)
distance between two Polygons
function distancePolygonTriangle#
auto algorithm::distancePolygonTriangle (
const Polygon & gA,
const Triangle & gB
)
distance between a Polygon and a Triangle
function distancePolyhedralSurfaceGeometry3D#
auto algorithm::distancePolyhedralSurfaceGeometry3D (
const PolyhedralSurface & polySurfaceA,
const Geometry & geomB
)
dispatch distance between a PolyhedralSurface and a Geometry
function distanceSegmentSegment#
auto algorithm::distanceSegmentSegment (
const Point & a,
const Point & b,
const Point & c,
const Point & d
)
function distanceSegmentSegment3D#
auto algorithm::distanceSegmentSegment3D (
const Point & a,
const Point & b,
const Point & c,
const Point & d
)
function distanceSegmentTriangle3D#
auto algorithm::distanceSegmentTriangle3D (
const Point & sA_,
const Point & sB_,
const Point & tA_,
const Point & tB_,
const Point & tC_
)
function distanceSolidGeometry3D#
auto algorithm::distanceSolidGeometry3D (
const Solid & gA,
const Geometry & gB
)
dispatch distance between a Solid and a Geometry
function distanceSolidSolid3D#
auto algorithm::distanceSolidSolid3D (
const Solid & gA,
const Solid & gB
)
distance between two Solids
function distanceTriangleGeometry#
auto algorithm::distanceTriangleGeometry (
const Triangle & gA,
const Geometry & gB
)
dispatch distance from a Triangle to a Geometry
function distanceTriangleGeometry3D#
auto algorithm::distanceTriangleGeometry3D (
const Triangle & gA,
const Geometry & gB
)
dispatch distance between a Triangle and a Geometry
function distanceTrianglePolyhedralSurface3D#
auto algorithm::distanceTrianglePolyhedralSurface3D (
const Triangle & triangleA,
const PolyhedralSurface & polySurfaceB
)
distance between a Triangle and a PolyhedralSurface
function distanceTriangleSolid3D#
auto algorithm::distanceTriangleSolid3D (
const Triangle & gA,
const Solid & gB
)
distance between a Triangle and a Solid
function distanceTriangleTriangle3D#
auto algorithm::distanceTriangleTriangle3D (
const Triangle & gA,
const Triangle & gB
)
distance between two Triangles
function distanceTriangulatedSurfaceGeometry3D#
auto algorithm::distanceTriangulatedSurfaceGeometry3D (
const TriangulatedSurface & triangulatedSurfaceA,
const Geometry & geomB
)
dispatch distance between a TriangulatedSurface and a Geometry
function extrude#
Returns a Geometry equal to the specified Geometry, extruded by the specified displacement.
SFCGAL_API auto algorithm::extrude (
const Geometry & g,
const double & dx,
const double & dy,
const double & dz
)
Parameters:
g
The specified Geometry.dx
The component of the specified displacement in the x-direction.dy
The component of the specified displacement in the y-direction.dz
The component of the specified displacement in the z-direction.
Returns:
A Geometry equal to g extruded by the displacement vector {dx, dy, dz}.
Precondition:
g must be a valid geometry.
Precondition:
dx, dy and dz must all be finite.
Note:
If g is such that g.isMeasured() is true, then, since there is no common expectation of the values of the measures on the returned Geometry, all measures from the result are removed.
Warning:
No actual validity check is conducted.
function extrude#
Returns a Geometry equal to the specified Geometry, extruded by the specified displacement vector.
auto algorithm::extrude (
const Geometry & g,
const Kernel::Vector_3 & v
)
Parameters:
g
The specified Geometry.v
The specified displacement vector.
Returns:
A Geometry equal to g extruded by the displacement vector v.
Precondition:
g must be a valid geometry.
Note:
If g is such that g.isMeasured() is true, then, since there is no common expectation of the values of the measures on the returned Geometry, all measures from the result are removed.
Todo
Improve extrude for 3D surfaces - Extrude only faces whose scalar_product(v,normal) > 0 and use Polyhedron union to get output geometries with a clean topology.
function extrudedStraightSkeleton#
build a 3D straight skeleton extruded for a Polygon __
SFCGAL_API auto algorithm::extrudedStraightSkeleton (
const Polygon & geom,
double height
)
Exception:
- NotImplementedException If geom is a Polygon with point touching rings.
function hasPlane3D#
Test if a 3D plane can be extracted from a Polygon .
template<typename Kernel>
bool algorithm::hasPlane3D (
const Polygon & polygon,
CGAL::Point_3< Kernel > & a,
CGAL::Point_3< Kernel > & b,
CGAL::Point_3< Kernel > & c
)
function intersection#
template<int Dim>
void algorithm::intersection (
const GeometrySet < Dim > & a,
const GeometrySet < Dim > & b,
GeometrySet < Dim > & output
)
function intersects#
auto algorithm::intersects (
const Geometry & ga,
const Geometry & gb,
NoValidityCheck
)
Intersection test on 2D geometries. Force projection to z=0 if needed
Precondition:
ga and gb are valid geometries
Warning:
the validity is assumed, no actual check is done
function intersects#
template<int Dim>
bool algorithm::intersects (
const detail::GeometrySet < Dim > & a,
const detail::GeometrySet < Dim > & b
)
Intersection test on GeometrySet
function intersects#
template<int Dim>
bool algorithm::intersects (
const detail::PrimitiveHandle < Dim > & a,
const detail::PrimitiveHandle < Dim > & b
)
Intersection test on a PrimitiveHandle
function intersects3D#
auto algorithm::intersects3D (
const Geometry & ga,
const Geometry & gb,
NoValidityCheck
)
Intersection test on 3D geometries. Assume z = 0 if needed
Precondition:
ga and gb are valid geometries
Warning:
the validity is assumed, no actual check is done
function isClosed#
auto algorithm::isClosed (
const SurfaceGraph & graph
)
test if a surface is closed, the graph should be build beforehand
Note:
the surface may not be connected, eg. two spheres will yield a true result
function isConnected#
auto algorithm::isConnected (
const SurfaceGraph & graph
)
test if a surface is connected, the graph should be build beforehand
function isPlane3D#
template<typename Kernel>
bool algorithm::isPlane3D (
const Geometry & geom,
const double & toleranceAbs
)
Test if all points of a geometry lie in the same plane
function opentriangulatePolygon3D#
Triangulate a 3D MultiPolygon .
SFCGAL_API void triangulate::opentriangulatePolygon3D (
const GeometryCollection & g,
TriangulatedSurface & triangulatedSurface
)
Todo
unittest
function plane3D#
template<typename Kernel>
CGAL::Plane_3< Kernel > algorithm::plane3D (
const Polygon & polygon
)
Returns the oriented 3D plane of a polygon (supposed to be planar). May return degenerate plane.
function plane3D#
template<typename Kernel>
CGAL::Plane_3< Kernel > algorithm::plane3D (
const Polygon & polygon,
const Plane3DInexactUnsafe &
)
Returns the oriented 3D plane of a polygon (supposed to be planar) - inexact version.
Warning:
Will divide by zero if polygon is degenerate.
Warning:
result is rounded to double (avoid huge expression tree).
function selfIntersects#
auto algorithm::selfIntersects (
const LineString & l
)
Self intersection test for 2D LineString (false if only endpoint touch)
function selfIntersects#
auto algorithm::selfIntersects (
const PolyhedralSurface & s,
const SurfaceGraph & g
)
Self intersection test for 2D PolyhedralSurface (false if only point touch)
function selfIntersects#
auto algorithm::selfIntersects (
const TriangulatedSurface & s,
const SurfaceGraph & g
)
Self intersection test for 2D TriangulatedSurface (false if only point touch)
function selfIntersects3D#
auto algorithm::selfIntersects3D (
const LineString & l
)
Self intersection test for 3D LineString (false if only endpoints touch)
function selfIntersects3D#
auto algorithm::selfIntersects3D (
const PolyhedralSurface & s,
const SurfaceGraph & g
)
Self intersection test for 3D PolyhedralSurface (false if only point touch)
function selfIntersects3D#
auto algorithm::selfIntersects3D (
const TriangulatedSurface & s,
const SurfaceGraph & g
)
Self intersection test for 3D TriangulatedSurface (false if only point touch)
function signedArea#
Compute the 2D signed area for a Triangle .
auto algorithm::signedArea (
const Triangle & g
)
function signedArea#
Compute the 2D signed area for a closed LineString .
auto algorithm::signedArea (
const LineString & g
)
function straightSkeleton#
build a 2D straight skeleton for a Polygon __
auto algorithm::straightSkeleton (
const Polygon & geom,
bool autoOrientation=true,
bool innerOnly=false,
bool outputDistanceInM=false,
const double & toleranceAbs=EPSILON
)
Exception:
- NotImplementedException If geom is a Polygon with point touching rings.
function straightSkeleton#
build a 2D straight skeleton for a Polygon __
auto algorithm::straightSkeleton (
const MultiPolygon & geom,
bool autoOrientation=true,
bool innerOnly=false,
bool outputDistanceInM=false,
const double & toleranceAbs=EPSILON
)
Exception:
- NotImplementedException If geom is a Polygon with point touching rings.
function straightSkeletonPartition#
Build a 2D straight skeleton partition for a Polygon .
auto algorithm::straightSkeletonPartition (
const Polygon & geom,
bool autoOrientation=true
)
Parameters:
geom
The input polygonautoOrientation
Check and fix polygon orientation (not used in this implementation)
Returns:
A unique pointer to a MultiPolygon representing the partitioned polygon
Exception:
- Exception If CGAL fails to create the straight skeleton
This function creates a partition of the input polygon based on its straight skeleton. It uses CGAL's Arrangement_2 to handle the intersection of skeleton and polygon edges.
function straightSkeletonPartition#
Build a 2D straight skeleton partition for a MultiPolygon .
auto algorithm::straightSkeletonPartition (
const MultiPolygon & geom,
bool autoOrientation=true
)
Parameters:
geom
The input multi-polygonautoOrientation
Check and fix polygon orientation
Returns:
A unique pointer to a MultiPolygon representing the partitioned multi-polygon
This function applies the straight skeleton partition to each polygon in the input multi-polygon and combines the results into a single MultiPolygon.
function triangulatePolygon3D#
Triangulate a 3D Polygon .
void triangulate::triangulatePolygon3D (
const Polygon & g,
TriangulatedSurface & triangulatedSurface
)
Todo
unittest
function triangulatePolygon3D#
Triangulate a 3D Triangle (copy triangle)
void triangulate::triangulatePolygon3D (
const Triangle & g,
TriangulatedSurface & triangulatedSurface
)
Todo
unittest
function triangulatePolygon3D#
Triangulate a 3D TriangulatedSurface (copy triangles)
void triangulate::triangulatePolygon3D (
const TriangulatedSurface & g,
TriangulatedSurface & triangulatedSurface
)
Todo
unittest
function triangulatePolygon3D#
Triangulate 3D polygons in a PolyhedralSurface .
void triangulate::triangulatePolygon3D (
const PolyhedralSurface & polyhedralSurface,
TriangulatedSurface & triangulatedSurface
)
function triangulatePolygon3D#
Triangulate a Solid .
void triangulate::triangulatePolygon3D (
const Solid & g,
TriangulatedSurface & triangulatedSurface
)
Todo
unittest
function union_#
template<int Dim>
void algorithm::union_ (
const detail::GeometrySet < Dim > & a,
const detail::GeometrySet < Dim > & b,
detail::GeometrySet < Dim > &
)
function union_#
template<int Dim>
void algorithm::union_ (
const detail::PrimitiveHandle < Dim > & a,
const detail::PrimitiveHandle < Dim > & b,
detail::GeometrySet < Dim > &
)
function weightedCentroid#
auto algorithm::weightedCentroid (
const Geometry & g,
bool enable3DComputation=false
)
Returns the weighted centroid for a Geometry
function weightedCentroid#
auto algorithm::weightedCentroid (
const Triangle & g,
bool enable3DComputation=false
)
Returns the weighted centroid for a Triangle
function weightedCentroid#
auto algorithm::weightedCentroid (
const Point & a,
const Point & b,
const Point & c,
bool enable3DComputation=false
)
Returns the weighted centroid for a Triangle
function weightedCentroid#
auto algorithm::weightedCentroid (
const LineString & g,
bool enable3DComputation=false
)
Returns the weighted centroid for a LineString
function weightedCentroid#
auto algorithm::weightedCentroid (
const Polygon & g,
bool enable3DComputation=false
)
Returns the weighted centroid for a Polygon
function weightedCentroid#
auto algorithm::weightedCentroid (
const GeometryCollection & g,
bool enable3DComputation=false
)
Returns the weighted centroid for a GeometryCollection
function weightedCentroid#
auto algorithm::weightedCentroid (
const TriangulatedSurface & g,
bool enable3DComputation=false
)
Returns the weighted centroid for a TriangulatedSurface
function weightedCentroid#
auto algorithm::weightedCentroid (
const PolyhedralSurface & g,
bool enable3DComputation=false
)
Returns the weighted centroid for a PolyhedralSurface
function weightedCentroid#
auto algorithm::weightedCentroid (
const Solid & g,
bool enable3DComputation=false
)
Returns the weighted centroid for a Solid