Class GeometryToolkit
Useful geometry-related functionality that can be used by scripting code.
Namespace: Scripting
Syntax
public class GeometryToolkit
Methods
IsPointInPolygon(Point, IReadOnlyList<Point>)
Determines whether the specified point is in the polygon. (from http://dominoc925.blogspot.co.uk/2012/02/c-code-snippet-to-determine-if-point-is.html).
Declaration
public bool IsPointInPolygon(Point point, IReadOnlyList<Point> polygonPoints)
Parameters
Type | Name | Description |
---|---|---|
Point | point | The point. |
System.Collections.Generic.IReadOnlyList<Point> | polygonPoints | The polygon points. |
Returns
Type | Description |
---|---|
System.Boolean |
|
SimplifyPolygon(List<Point>, Double)
Simplifies the specified polygon, using the Douglas Peucker algorithm. See https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm and https://cartography-playground.gitlab.io/playgrounds/douglas-peucker-algorithm/
Declaration
public List<Point> SimplifyPolygon(List<Point> polygonPoints, double simplificationToleranceFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<Point> | polygonPoints | The polygon points. |
System.Double | simplificationToleranceFactor | The simplification tolerance factor (a default of 1.0 is common). |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Point> | The simplified polygon. |