|
Programming Reference for VirtualLab Fusion
2026.1
|
This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Public class which defines a simple polygon (defined by an array of vertices). 'Simple' means, that there are no intersections of the vertices.
More...
Public Member Functions | |||||
| override void | CalculateAxisAlignedBoundingBox () | ||||
| Method for (re)calculating the axis aligned bounding box. | |||||
| override double | CalculateDistanceOfPointToRegionBorder (VectorD point) | ||||
| Calculates the distance of a point to the border of this region. | |||||
| List< double > | CalculateInternalAngles () | ||||
| Method which calculates all internal angles of the polygon. | |||||
| VectorD[] | CalculateIntersectionsOfHalfLineAndPolygon (VectorD startPositionOfHalfLine, VectorD directionOfHalfLine, string linesName, bool ignoreVirtualVertices, out string[] namesOfPoints) | ||||
| Method for calculating the intersection points of a given half line and this polygon. | |||||
| List<(VectorD intersectionPoint, string nameOfPoint)> | CalculateIntersectionsOfLineAndPolygon (VectorD firstPointOnLine, VectorD secondPointOnLineOrDirectionOfLine, bool directionGivenInsteadOfSecondPointOnLine, string linesName, bool ignoreVirtualVertices, out List<(int edgeStart, int edgeEnd)> congruentEdges) | ||||
| Method for calculating the intersection points of a given line and this polygon. | |||||
| VectorD[] | CalculateIntersectionsOfLineSegmentAndPolygon (VectorD startPositionOfSegment, VectorD endPositionOfSegment, string linesName, string nameOfSegmentStart, string nameOfSegmentEnd, bool ignoreVirtualVertices, out(string, string)[] namesOfPoints) | ||||
| Method for calculating the intersection points of a given line segment and this polygon. | |||||
| override object | Clone () | ||||
| Deep copy of the object. | |||||
| new void | DeserializationPostProcessing (ref List< System.Reflection.FieldInfo > unfindableFields, RemainingData remainingData) | ||||
| Method for doing post-processing after XML deserialization. Especially, handling of fields which have been altered since the version the data were saved with. But also additional operations (like filling caching variables etc.) can be done here. | |||||
| override bool | Equals (object obj, EqualityIntent equalityIntent) | ||||
| Equality operator. | |||||
| void | ExtrapolatedRegionBorders (RectanglePhysical boundingBox, out List< Tuple< bool, double > > leftBorders, out List< Tuple< bool, double > > topBorders, out List< Tuple< bool, double > > rightBorders, out List< Tuple< bool, double > > bottomBorders) | ||||
| Determine region borders that can be created by 'border continuation' extrapolation. //See ITN.064 for more information. | |||||
| PolygonVertexList | Get_EffectiveVertices () | ||||
| Method which creates a new PolygonVertexList containing only effective vertices. | |||||
| override int | GetHashCode () | ||||
| override InsideOutside | GetInOutRelation (VectorD point, ExtrapolationInfo extrapolation2use=null) | ||||
| Method which checks whether or not a point lies inside or outside the 2D region or on its boundary. | |||||
| InsideOutside | InOutRelation_boundingBoxBorder_extrapolated (VectorD point, RectanglePhysical boundingBox, List< Tuple< bool, double > > leftBorders, List< Tuple< bool, double > > topBorders, List< Tuple< bool, double > > rightBorders, List< Tuple< bool, double > > bottomBorders, ExtrapolationInfo extrapolation2use) | ||||
| If a simple polygon is used inside a composed region, we may need a special handling for points near a given bounding box. If there are edges of neighbored vertices exactly on a border of the bounding box, the border may effectively disappear in case of 'periodic' or 'border continuation' extrapolation. See ITN.064 for more information on the mode 'border continuation'. | |||||
| override void | MayBeNonzeroOutside (out bool maybeNonZeroLeft, out bool maybeNonZeroRight, out bool maybeNonZeroBottom, out bool maybeNonZeroTop) | ||||
| Method which determines whether or not non zero values (i.e. 'inside' states) may appear outside the polygon in case of 'border continuation' extrapolation. | |||||
| SimplePolygon () | |||||
| Default constructor, creating a triangle with an edge length of 5mm, centered at (0, 0), and with its base line parallel to the x-axis. | |||||
| SimplePolygon (bool useOnlyEffectiveVertices=true, VectorD[] vertices) | |||||
| Initializes a new instance of the SimplePolygon class out of a list of VectorD. Each vertex gets the name "Vertex" and a running number. The boundaries are regarded as being outside, which you can change with the BoundariesAreInside property. | |||||
| SimplePolygon (PolygonVertexList vertices, bool boundaryIsInside=false, PhysicalProperty propertyOfCoordinatesX=PhysicalProperty.Length, PhysicalProperty propertyOfCoordinatesY=PhysicalProperty.Length, bool dontCheckConsistency=false, bool useOnlyEffectiveVertices=true) | |||||
| A constructor of the simple polygon class. Non-simple polygons (where at least two edges intersect) are not allowed. The constructor determines the type of the polygon. | |||||
| SimplePolygon (RectanglePhysical rectangle, bool boundaryIsInside=false) | |||||
| Constructor which gets a rectangle that shall be represented by a polygon. | |||||
| SimplePolygon (RectangularRegion rectangle) | |||||
| Constructor which gets a rectangular region which shall be represented by a polygon. | |||||
| SimplePolygon (SimplePolygon polygon) | |||||
| copy constructor of the simple polygon class | |||||
| override void | UpdatePropertyOfCoordinates () | ||||
| Method for handling update after change of the physical property of the coordinate. | |||||
Public Member Functions inherited from ElementaryRegion2D | |||||
| double | CalculateDistanceOfPointToRegionBorder (VectorD point) | ||||
| Calculates the distance of a point to the border of this region. | |||||
| ElementaryRegion2D (bool boundariesAreInside, PhysicalProperty propertyOfCoordinatesX=PhysicalProperty.Length, PhysicalProperty propertyOfCoordinatesY=PhysicalProperty.Length) | |||||
| Constructor which gets the _boundariesAreInside flag. To be called from derived classes constructors. | |||||
| ElementaryRegion2D (ElementaryRegion2D region2bCopied) | |||||
| Copy constructor. | |||||
Public Member Functions inherited from Region2D | |||||
| void | CalculateAxisAlignedBoundingBox () | ||||
| Method for (re)calculating the axis aligned bounding box. | |||||
| override object | Clone () | ||||
| Clones the current object. | |||||
| override bool | Equals (object obj, EqualityIntent equalityIntent) | ||||
| Equality operation. | |||||
| override int | GetHashCode () | ||||
| InsideOutside | GetInOutRelation (VectorD point, ExtrapolationInfo extrapolation2use=null) | ||||
| Method which checks whether or not a point lies inside or outside the 2D region or on its boundary. | |||||
| override FormDocument | GetNewDocumentWindow (Form formMain, string fileName) | ||||
Gets a new document window containing this document.
| |||||
| bool | IsInside (double pointX, double pointY) | ||||
| Method which checks whether or not a point is inside the 2D region. | |||||
| bool | IsInside (VectorD point) | ||||
| Method which checks whether or not a point is inside the 2D region. | |||||
| void | MayBeNonzeroOutside (out bool maybeNonZeroLeft, out bool maybeNonZeroRight, out bool maybeNonZeroBottom, out bool maybeNonZeroTop) | ||||
| Method which determines whether or not the region can provide "inside" state outside of its boundary interval. This is not the case for extrapolation mode 'ConstantZero', of course. | |||||
| Region2D (bool boundariesAreInside, PhysicalProperty propertyOfCoordinatesX=PhysicalProperty.Length, PhysicalProperty propertyOfCoordinatesY=PhysicalProperty.Length) | |||||
| Constructor which gets the _boundariesAreInside flag. To be called from derived classes constructors. | |||||
| Region2D (Region2D region2bCopied) | |||||
| Copy constructor. | |||||
Static Public Member Functions | |
| static VectorD | CalculateCentroid (SimplePolygon polygon) |
| Calculates the centroid of a given polygon. Formula taken from Wikipedia. | |
| static List< SimplePolygon > | CalculateIntersectionOfTwoPolygons (SimplePolygon polygon1, SimplePolygon polygon2, bool ignoreVirtualVertices) |
| Method for calculating the intersection of two polygons. See ITN.067 for more information. | |
| static ? SimplePolygon | CalculateUnionOfTwoPolygons (SimplePolygon polygon1, SimplePolygon polygon2, bool ignoreVirtualVertices, out List< SimplePolygon >? holes) |
| Method for calculating the union of two polygons. See ITN.067 for more information. | |
| static bool | CheckPolygonalChainForConvexityAndMonotony (VectorD[] polygonalPoints, out bool monotone_inX, out bool monotone_inY, out RectangleD boundingBox, out List< int > minX_vertexIndices, out List< int > maxX_vertexIndices, out List< int > minY_vertexIndices, out List< int > maxY_vertexIndices) |
| Check whether a polygonal chain is convex and monotone. | |
| static ? List<(string nameOfVertex1, string nameOfVertex2, bool criticalX, bool criticalY)> | CheckPolygonForCoordinateDifferencesWhichAreNumericalCritical (SimplePolygon polygon) |
| Method which checks the vertices of a given SimplePolygon whether or not it contains (neighbored) vertices whose x- or y-coordinates are not identical but so close that numerical problems are probable. | |
| static SimplePolygon | EnsureClockwisePolygon (SimplePolygon polygon2check) |
| Method which checks whether the vertices of a polygon are given in clockwise order. If so, it will be returned unchanged. If not, a polygon with reversed vertex order is returned. | |
| static SimplePolygon | EnsureCounterClockwisePolygon (SimplePolygon polygon2check) |
| Method which checks whether the vertices of a polygon are given in counterclockwise order. If so, it will be returned unchanged. If not, a polygon with reversed vertex order is returned. | |
| static List<(long index, VectorD point)> | ExtendConvexPolygonWithOutlyingPoint (SimplePolygon polygon, List< long > pointIndicesOfPolygonVertices, NamedPolygonVertex singlePoint, long pointIndexOfSinglePoint, out List< TriangulationTriangle2D > newTrianglesForExtension) |
| // Calculates the area of a given polygon. Formula taken from Wikipedia. // | |
| static InsideOutside | IsInsideTriangle (VectorD point, VectorD vertex1, VectorD vertex2, VectorD vertex3, bool useNumericalChecks=true) |
| Fast method for checking whether a point lies inside a given triangle. Important: No check for collinearity is done (for performance reasons). | |
| static bool | IsSelfIntersecting (VectorD[] vertices, out double areaWithSign) |
| Method which checks whether or not a polygon (for the given order of the vertices!) is self intersecting. | |
| static bool | operator!= (SimplePolygon o1, SimplePolygon o2) |
| Unequals operator. | |
| static bool | operator== (SimplePolygon o1, SimplePolygon o2) |
| Equals operator. | |
| static SimplePolygon | RemoveVirtualVertices (SimplePolygon polygon) |
| Method for creating a polygon without virtual vertices from an arbitrary polygon. | |
| static SimplePolygon | Rotate (SimplePolygon polygon, double angle, VectorD centerOfRotation) |
| Static method for transforming a given polygon to another one which is rotated by an angle around a given rotation center. | |
| static SimplePolygon | Scale (SimplePolygon polygon, double factor) |
| Static method for scaling a given polynom while keeping the center of its bounding box. See also the more general method TransformToTargetBox. | |
| static SimplePolygon | TransformToTargetBox (SimplePolygon polygon, RectanglePhysical targetBoundingBox) |
| Static method for transforming a given polygon to another one with defined position and size. | |
| static SimplePolygon | Translate (SimplePolygon polygon, VectorD translationVector) |
| Static method for transforming a given polygon to another one which is translated by a given vector. | |
Static Public Member Functions inherited from ElementaryRegion2D | |
| static bool | operator!= (ElementaryRegion2D o1, ElementaryRegion2D o2) |
| Unequals operator. | |
| static bool | operator== (ElementaryRegion2D o1, ElementaryRegion2D o2) |
| Equals operator. | |
Static Public Member Functions inherited from Region2D | |
| static Region2D | InvertRegion (Region2D region2Invert) |
| Creates a new region with inverted in / out regions compared to this. | |
| static Region2D | Load (string fileName) |
| Loads the specified file name. Works independently from whether the document has been saved without view settings (as prior to VL 6.0) or with view settings. | |
| static bool | operator!= (Region2D o1, Region2D o2) |
| Unequals operator. | |
| static bool | operator== (Region2D o1, Region2D o2) |
| Equals operator. | |
Public Attributes | |
| int | startIndexOfNearestEdge |
| Calculates the distance of a point to the border of this polygon. Important: This method will ignore all extrapolation settings! | |
Static Public Attributes | |
| const string | NameOfRectanglesCorner_BL |
| Vertex name of the bottom left corner of a rectangle which is represented as SimplePolygon. | |
| const string | NameOfRectanglesCorner_BR |
| Vertex name of the botom right corner of a rectangle which is represented as SimplePolygon. | |
| const string | NameOfRectanglesCorner_TL |
| Vertex name of the top left corner of a rectangle which is represented as SimplePolygon. | |
| const string | NameOfRectanglesCorner_TR |
| Vertex name of the top right corner of a rectangle which is represented as SimplePolygon. | |
| const double | ThresholdForNumericalCriticalDifference |
| Threshold below which a coordinate difference is considered critical. To be used by the method CheckPolygonForCoordinateDifferencesWhichAreNumericalCritical. | |
| static List< NamedPolygonVertex > | upperChain |
| Method which decomposes a suitable polygon into two separate polygonal chains, an upper and a lower one. | |
Static Public Attributes inherited from Region2D | |
| const string | DefaultDocumentName |
| The default document name (= type description) for an Order Collection. | |
| static readonly string | FileDialogFilterString |
| The filter string used in "Open File" dialogs. | |
| const string | FileExtensionString |
| The file extension for an Order Collection. | |
Properties | |
| double | Area [get] |
| Gets the area of the polygon. | |
| bool | CounterClockwise [get] |
| Gets whether or not the polygon is defined counterclockwise. It is determined during preprocessing. | |
| virtual List< Parameter > | ParameterRunParameters [get] |
| Gets all available parameters. For variable parameters (i.e. those double and int parameters which can be used in the Parameter Run, Parametric Optimization and so on) add a VaryParameterInfo object (derived from Parameter class) to the returned list. | |
| PolygonType | Type [get] |
| Gets the type of the polygon. It is determined during preprocessing. | |
| PolygonVertexList | Vertices [get] |
| public property to get the vertices of the polygon | |
Properties inherited from Region2D | |
| RectanglePhysical | AxisAlignedBoundingBox [get] |
| Gets the bounding box for the 2D region. Its sides are parallel to the x- and y-axis resp. | |
| bool | BoundariesAreInside [get, set] |
| Gets or sets whether or not the boundaries of the region belong to the inner region. | |
| string | CommentOfCoordinates_X [get, set] |
| Gets and sets the comment for the x-coordinates. | |
| string | CommentOfCoordinates_Y [get, set] |
| Gets and sets the comment for the y-coordinates. | |
| ExtrapolationInfo | ExtrapolationHandling [get, set] |
| The extrapolation mode for this region. See ITN.064 for more information on the mode 'border continuation'. | |
| bool | IsOneD [get] |
| Gets whether this IRegion1D2D is 1D or 2D. | |
| string | Name [get, set] |
| The name which can be given to the region by the user. | |
| PhysicalProperty | PropertyOfCoordinatesX [get, set] |
| Physical property of the x-coordinates of the region. | |
| PhysicalProperty | PropertyOfCoordinatesY [get, set] |
| Physical property of the y-coordinates of the region. | |
| Region2DType | RegionType [get] |
| Gets the type of the region. | |
| SamplingParameters | SamplingForUsageWithComplexFields [get, set] |
| Sampling parameters which will be used for a coordinate rescaling in case of using the region with a complex field. | |
Properties inherited from IDocument | |
| VirtualLabSession | Session [get, set] |
| every documents need to be handled in a session ==> default is the VirtualLab Mainsession | |
| NodeVLExplorer | TreeStructure [get] |
| every document should have a node (maybe with subnodes) in the VirtualLab Explorer | |
| DocumentType | TypeOfDocument [get] |
| Gets an enum entry specifying the type of the document. | |
Events | |
| EventHandler? | PolygonChanged |
| Event for changed vertices. | |
This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Public class which defines a simple polygon (defined by an array of vertices). 'Simple' means, that there are no intersections of the vertices.
| SimplePolygon | ( | bool | useOnlyEffectiveVertices = true, |
| VectorD[] | vertices ) |
Initializes a new instance of the SimplePolygon class out of a list of VectorD. Each vertex gets the name "Vertex" and a running number. The boundaries are regarded as being outside, which you can change with the BoundariesAreInside property.
| vertices | The vertices of the polygon. |
| useOnlyEffectiveVertices | If true, only effective vertices (instead of all defined vertices) will be used. |
| System.ArgumentException | At least three vertices must be given. |
| System.ArgumentException | Vertices have to be unique. |
| SimplePolygon | ( | PolygonVertexList | vertices, |
| bool | boundaryIsInside = false, | ||
| PhysicalProperty | propertyOfCoordinatesX = PhysicalProperty::Length, | ||
| PhysicalProperty | propertyOfCoordinatesY = PhysicalProperty::Length, | ||
| bool | dontCheckConsistency = false, | ||
| bool | useOnlyEffectiveVertices = true ) |
A constructor of the simple polygon class. Non-simple polygons (where at least two edges intersect) are not allowed. The constructor determines the type of the polygon.
| vertices | The vertices that define the polygon. The order is important. |
| boundaryIsInside | Flag which says whether or not the boundary is part of the inner region or not. |
| propertyOfCoordinatesX | Physical property of the x-coordinate. |
| propertyOfCoordinatesY | Physical property of the y-coordinate. |
| dontCheckConsistency | If true, no consistency check will be done. (Make sure that you know what you're doing!) |
| useOnlyEffectiveVertices | If true, only effective vertices (instead of all defined vertices) will be used. |
| System.ArgumentNullException | |
| System.ArgumentException | Not enough vertices specified. or Duplicate vertices found. |
| SimplePolygon | ( | SimplePolygon | polygon | ) |
copy constructor of the simple polygon class
| polygon | the polygon which shall be copied |
| SimplePolygon | ( | RectanglePhysical | rectangle, |
| bool | boundaryIsInside = false ) |
Constructor which gets a rectangle that shall be represented by a polygon.
| rectangle | Rectangle to be converted to a polygon. |
| boundaryIsInside | Flag which says whether or not the boundary is part of the inner region or not. |
| SimplePolygon | ( | RectangularRegion | rectangle | ) |
Constructor which gets a rectangular region which shall be represented by a polygon.
| rectangle | Rectangle to be converted to a polygon. |
|
static |
Calculates the centroid of a given polygon. Formula taken from Wikipedia.
| polygon | Polygon to calculate the centroid for. |
| override double CalculateDistanceOfPointToRegionBorder | ( | VectorD | point | ) |
Calculates the distance of a point to the border of this region.
| point | Point to calculate the distance for. |
| List< double > CalculateInternalAngles | ( | ) |
Method which calculates all internal angles of the polygon.
|
static |
Method for calculating the intersection of two polygons. See ITN.067 for more information.
| polygon1 | First of the polygons to intersect. |
| polygon2 | Second of the polygons to intersect. |
| ignoreVirtualVertices | If true, only effective vertices are used. That will be sufficient for most geometrical cases. If it is about triangulation, all vertices are needed instead. |
| VectorD[] CalculateIntersectionsOfHalfLineAndPolygon | ( | VectorD | startPositionOfHalfLine, |
| VectorD | directionOfHalfLine, | ||
| string | linesName, | ||
| bool | ignoreVirtualVertices, | ||
| out string[] | namesOfPoints ) |
Method for calculating the intersection points of a given half line and this polygon.
| startPositionOfHalfLine | The start position of the half line. |
| directionOfHalfLine | The direction of the half line. |
| linesName | Name of the line to intersect with the polygon. |
| ignoreVirtualVertices | If true, only effective vertices are used. That will be sufficient for most geometrical cases. If it is about triangulation, all vertices are needed instead. |
| namesOfPoints | Array which contains the names of the intersection points. |
| List<(VectorD intersectionPoint, string nameOfPoint)> CalculateIntersectionsOfLineAndPolygon | ( | VectorD | firstPointOnLine, |
| VectorD | secondPointOnLineOrDirectionOfLine, | ||
| bool | directionGivenInsteadOfSecondPointOnLine, | ||
| string | linesName, | ||
| bool | ignoreVirtualVertices, | ||
| out List<(int edgeStart, int edgeEnd)> | congruentEdges ) |
Method for calculating the intersection points of a given line and this polygon.
| firstPointOnLine | One point lying on the line to be intersecting. |
| secondPointOnLineOrDirectionOfLine | Either a second point on the line or the direction of the line, depending on the flag directionGivenInsteadOfSecondPointOnLine. |
| directionGivenInsteadOfSecondPointOnLine | If true, the second VectorD is interpreted as line direction instead of a second point on the line. |
| linesName | Name of the line to intersect with the polygon. |
| ignoreVirtualVertices | If true, only effective vertices are used. That will be sufficient for most geometrical cases. If it is about triangulation, all vertices are needed instead. |
| congruentEdges | A list of edge start and end indices of these edges which are congruent to the line to intersect. |
| ArgumentException | If directionGivenInsteadOfSecondPointOnLine is true and the absolute value of secondPointOnLineOrDirectionOfLine, an exception is thrown. |
| VectorD[] CalculateIntersectionsOfLineSegmentAndPolygon | ( | VectorD | startPositionOfSegment, |
| VectorD | endPositionOfSegment, | ||
| string | linesName, | ||
| string | nameOfSegmentStart, | ||
| string | nameOfSegmentEnd, | ||
| bool | ignoreVirtualVertices, | ||
| out(string, string)[] | namesOfPoints ) |
Method for calculating the intersection points of a given line segment and this polygon.
| startPositionOfSegment | The start position of the line segment. |
| endPositionOfSegment | The end position of the line segment. |
| linesName | Name of the line to intersect with the polygon. |
| nameOfSegmentStart | Name of the start point of the line segment to be intersected with the polygon. |
| nameOfSegmentEnd | Name of the end point of the line segment to be intersected with the polygon. |
| ignoreVirtualVertices | If true, only effective vertices are used. That will be sufficient for most geometrical cases. If it is about triangulation, all vertices are needed instead. |
| namesOfPoints | Array which contains the names of the intersection points. |
|
static |
Method for calculating the union of two polygons. See ITN.067 for more information.
| polygon1 | First of the polygons to unite. |
| polygon2 | Second of the polygons to unite. |
| ignoreVirtualVertices | If true, only effective vertices are used. That will be sufficient for most geometrical cases. If it is about triangulation, all vertices are needed instead. |
| holes | A list of holes that do not belong to the mathematical union set but which can be not represented by the returned simple polygon. |
Null will be returned in case of the two given polygons being separate or touching in one single contact point at most.
|
static |
Check whether a polygonal chain is convex and monotone.
| polygonalPoints | Points of the polygonal chain to check. |
| monotone_inX | Out parameter which is true, if the polygon is monotone in x. |
| monotone_inY | Out parameter which is true, if the polygon is monotone in y. |
| boundingBox | The bounding box of the polygon. |
| minX_vertexIndices | Out parameter which is a list of the indices of those vertices which have the minimum x-coordinate. |
| maxX_vertexIndices | Out parameter which is a list of the indices of those vertices which have the maximum x-coordinate. |
| minY_vertexIndices | Out parameter which is a list of the indices of those vertices which have the minimum y-coordinate. |
| maxY_vertexIndices | Out parameter which is a list of the indices of those vertices which have the maximum y-coordinate. |
True if the polygon which is described by the chain is convex.
|
static |
Method which checks the vertices of a given SimplePolygon whether or not it contains (neighbored) vertices whose x- or y-coordinates are not identical but so close that numerical problems are probable.
| polygon | SimplePolygon to check. |
| override object Clone | ( | ) |
Deep copy of the object.
| new void DeserializationPostProcessing | ( | ref List< System.Reflection.FieldInfo > | unfindableFields, |
| RemainingData | remainingData ) |
Method for doing post-processing after XML deserialization. Especially, handling of fields which have been altered since the version the data were saved with. But also additional operations (like filling caching variables etc.) can be done here.
| unfindableFields | List of all those fields which are expected but could not be read from XML. |
| remainingData | Data contained in XML but which haven't been read yet. |
|
static |
Method which checks whether the vertices of a polygon are given in clockwise order. If so, it will be returned unchanged. If not, a polygon with reversed vertex order is returned.
| polygon2check | Polygon to check for clockwise vertex order. |
|
static |
Method which checks whether the vertices of a polygon are given in counterclockwise order. If so, it will be returned unchanged. If not, a polygon with reversed vertex order is returned.
| polygon2check | Polygon to check for counterclockwise vertex order. |
| override bool Equals | ( | object | obj, |
| EqualityIntent | equalityIntent ) |
Equality operator.
| obj | |
| equalityIntent | Defines what kind of equality you want to check when comparing two objects, for example all values or physical equality. |
|
static |
// Calculates the area of a given polygon. Formula taken from Wikipedia. //
//
| polygon | Polygon to calculate the area for. |
//
Method which extends a convex polygon by a given point. The polygon is meant to be the convex hull of a triangulated point cloud as described in ITN.065.
| polygon | Polygon to be extended. |
| pointIndicesOfPolygonVertices | List of indices which correspond to the list of points the polygon is the convex hull for. |
| singlePoint | Outlying point to be a new vertex of the polygon. |
| pointIndexOfSinglePoint | Index of the single point in the point cloud. |
| newTrianglesForExtension | Adding the new vertex will usually remove old edges which lie inside the new polygon now. This out parameters gives all triangle which are defined by the removed edge and the new point. |
| void ExtrapolatedRegionBorders | ( | RectanglePhysical | boundingBox, |
| out List< Tuple< bool, double > > | leftBorders, | ||
| out List< Tuple< bool, double > > | topBorders, | ||
| out List< Tuple< bool, double > > | rightBorders, | ||
| out List< Tuple< bool, double > > | bottomBorders ) |
Determine region borders that can be created by 'border continuation' extrapolation. //See ITN.064 for more information.
| boundingBox | bounding box to limit the region |
| leftBorders | left horizontal extrapolated borders |
| topBorders | top vertical extrapolated borders |
| rightBorders | right horizontal extrapolated borders |
| bottomBorders | bottom vertical extrapolated borders |
| PolygonVertexList Get_EffectiveVertices | ( | ) |
Method which creates a new PolygonVertexList containing only effective vertices.
| override InsideOutside GetInOutRelation | ( | VectorD | point, |
| ExtrapolationInfo | extrapolation2use = null ) |
Method which checks whether or not a point lies inside or outside the 2D region or on its boundary.
| point | The point to be checked whether it lies inside. |
| extrapolation2use | Extrapolation info actually to be used. |
| InsideOutside InOutRelation_boundingBoxBorder_extrapolated | ( | VectorD | point, |
| RectanglePhysical | boundingBox, | ||
| List< Tuple< bool, double > > | leftBorders, | ||
| List< Tuple< bool, double > > | topBorders, | ||
| List< Tuple< bool, double > > | rightBorders, | ||
| List< Tuple< bool, double > > | bottomBorders, | ||
| ExtrapolationInfo | extrapolation2use ) |
If a simple polygon is used inside a composed region, we may need a special handling for points near a given bounding box. If there are edges of neighbored vertices exactly on a border of the bounding box, the border may effectively disappear in case of 'periodic' or 'border continuation' extrapolation. See ITN.064 for more information on the mode 'border continuation'.
| point | Point to get the InOut-relation for. |
| boundingBox | Bounding box of the parenting composed region. |
| leftBorders | Help list of extrapolated horizontal borders left of the bounding box. The list has to be created in a previous preprocessing. |
| topBorders | Help list of extrapolated vertical borders above the top of the bounding box. The list has to be created in a previous preprocessing. |
| rightBorders | Help list of extrapolated horizontal borders right of the bounding box. The list has to be created in a previous preprocessing. |
| bottomBorders | Help list of extrapolated vertical borders right of the bounding box. The list has to be created in a previous preprocessing. |
| extrapolation2use | Extrapolation info actually to be used. |
|
static |
Fast method for checking whether a point lies inside a given triangle. Important: No check for collinearity is done (for performance reasons).
| point | Point to check. |
| vertex1 | First triangle vertex. |
| vertex2 | Second triangle vertex. |
| vertex3 | Third triangle vertex. |
| useNumericalChecks | If true, NumericalChecks comparison is used in order to tolerate numerical errors. |
|
static |
Method which checks whether or not a polygon (for the given order of the vertices!) is self intersecting.
| vertices | Vertices of the polygon to be checked. The order is important. |
| areaWithSign | The area of the polygon. It is signed because the sign informs about the orientation of the polygon. |
true if the polygon is self intersecting.| override void MayBeNonzeroOutside | ( | out bool | maybeNonZeroLeft, |
| out bool | maybeNonZeroRight, | ||
| out bool | maybeNonZeroBottom, | ||
| out bool | maybeNonZeroTop ) |
Method which determines whether or not non zero values (i.e. 'inside' states) may appear outside the polygon in case of 'border continuation' extrapolation.
| maybeNonZeroLeft | Are inside states possible at the left? |
| maybeNonZeroRight | Are inside states possible at the right? |
| maybeNonZeroBottom | Are inside states possible at the bottom? |
| maybeNonZeroTop | Are inside states possible at the top? |
|
static |
Unequals operator.
| o1 | |
| o2 |
|
static |
Equals operator.
| o1 | |
| o2 |
|
static |
Method for creating a polygon without virtual vertices from an arbitrary polygon.
| polygon | Polygon which may contain virtual vertices. |
|
static |
Static method for transforming a given polygon to another one which is rotated by an angle around a given rotation center.
| polygon | The polygon to be rotated. |
| angle | The angle to rotate the polygon with (given in radian). |
| centerOfRotation | The center to rotate the polygon around. |
|
static |
Static method for scaling a given polynom while keeping the center of its bounding box. See also the more general method TransformToTargetBox.
| polygon | Polygon to be transformed. |
| factor | Scale factor. |
|
static |
Static method for transforming a given polygon to another one with defined position and size.
| polygon | Polygon to be transformed. |
| targetBoundingBox | Target position and size. |
|
static |
Static method for transforming a given polygon to another one which is translated by a given vector.
| polygon | The polygon to be shifted. |
| translationVector | The shifting vector. |
| int startIndexOfNearestEdge |
Calculates the distance of a point to the border of this polygon. Important: This method will ignore all extrapolation settings!
| point | Point to calculate the distance for. |
| ignoreVirtualVertices | If set to true, virtua vertices will be ignored. |
|
static |
Method which decomposes a suitable polygon into two separate polygonal chains, an upper and a lower one.
| polygon | Polygon to be decomposed which is at least monotone in x-direction. |
| Exception | Thrown if more than two vertices are found as left most or right most ones. |
| ArgumentException | Thrown if a non-suitable polygon is given (not monotone in x). |