Fade2.5D Documentation pages v2.16.7
Delaunay Features
PolygonClipper.h File Reference
#include <vector>
#include "Segment2.h"
#include "PolygonTree.h"
#include "Visualizer2.h"
#include "common.h"

Go to the source code of this file.

Classes

class  GEOM_FADE25D::PolygonClipper
 The PolygonClipper class handles polygon repair operations. More...
 

Functions

bool CLASS_DECLSPEC GEOM_FADE25D::clipPolygon (Zone2 *pBaseZoneIn, std::vector< Segment2 > &vPolygonInput, bool bWithDrape, std::vector< Segment2 > &vPolygonSegmentsOut)
 Limits an input polygon to a specified zone. More...
 

Function Documentation

◆ clipPolygon()

bool CLASS_DECLSPEC GEOM_FADE25D::clipPolygon ( Zone2 pBaseZoneIn,
std::vector< Segment2 > &  vPolygonInput,
bool  bWithDrape,
std::vector< Segment2 > &  vPolygonSegmentsOut 
)
The original polygons on the left are clipped by a rectangular window (box) on the right.

This function trims an input polygon so that its area is constrained to the given Zone2.

Parameters
pBaseZoneInThe Zone2 used to clip the polygon.
vPolygonInputA vector of unordered and unoriented Segment2s. The segments may self-intersect, and the polygon can have holes. All such issues are automatically repaired.
bWithDrapeA dummy parameter with no effect for the 2D version; use false.
vPolygonSegmentsOutA vector to store the resulting polygon segments. The output segments are free of self-intersections and are oriented counterclockwise around the polygon area.
Returns
true if successful; false if the operation fails due to invalid input or empty output.