#include <vector>
#include "Segment2.h"
#include "PolygonTree.h"
#include "Visualizer2.h"
#include "common.h"
Go to the source code of this file.
|
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...
|
|
◆ 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
-
pBaseZoneIn | The Zone2 used to clip the polygon. |
vPolygonInput | A vector of unordered and unoriented Segment2 s. The segments may self-intersect, and the polygon can have holes. All such issues are automatically repaired. |
bWithDrape | A dummy parameter with no effect for the 2D version; use false. |
vPolygonSegmentsOut | A 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.