C# Class R3.Geometry.Slicer

Exibir arquivo Open project: roice3/Honeycombs Class Usage Examples

Public Methods

Method Description
Clip ( List &tiles, Circle c, bool keepInside ) : void

Clip the drawn polygons in a set of tiles, using a circle.

SlicePolygon ( Polygon p, Circle c, List &output ) : bool

Slices up a polygon with a circle (line case not supported).

The input polygon might get reversed

SlicePolygon ( Polygon p, CircleNE c, Geometry g, double thickness, List &output ) : void

Slices a polygon by a circle with some thickness. Input circle may be a line.

The input polygon might get reversed

Private Methods

Method Description
GetNextSegmentIndex ( Polygon walking, int idx ) : int
GetPairPoints ( List iPoints, int pair, bool increment, IntersectionPoint &iPoint1, IntersectionPoint &iPoint2 ) : void

Get a pair of intersection points.

SlicePolygonInternal ( Polygon p, Circle c, List &output ) : bool
SmallerSplicedArc ( Circle c, List iPoints, int &pair, bool increment, int &nextSegIndex ) : Segment

Helper to return the smaller spliced arc.

SplicedArc ( Polygon parent, Circle c, List iPoints, int &pair, bool increment, int &nextSegIndex ) : Segment

Helper to return a spliced arc.

SplitHelper ( Segment segmentToSplit, Vector3D iLocation, Polygon diced, List iPoints ) : Segment

Splits segmentToSplit in two based on iLocation. First new segment will be added to diced, and second new segment will be returned. If split doesn't happen, segmentToSplit will be returned.

WalkPolygon ( Polygon parent, Polygon walking, Circle c, int pair, List iPoints, bool increment ) : Polygon

Helper to walk a polygon, starting from a pair of intersection points. increment determines the direction we are walking. NOTE: when walking from i1 -> i2 along c, we should be moving through the interior of the polygon.

Method Details

Clip() public static method

Clip the drawn polygons in a set of tiles, using a circle.
public static Clip ( List &tiles, Circle c, bool keepInside ) : void
tiles List
c Circle
keepInside bool
return void

SlicePolygon() public static method

Slices up a polygon with a circle (line case not supported).
The input polygon might get reversed
public static SlicePolygon ( Polygon p, Circle c, List &output ) : bool
p Polygon
c Circle
output List
return bool

SlicePolygon() public static method

Slices a polygon by a circle with some thickness. Input circle may be a line.
The input polygon might get reversed
public static SlicePolygon ( Polygon p, CircleNE c, Geometry g, double thickness, List &output ) : void
p Polygon
c CircleNE
g Geometry
thickness double
output List
return void