|
|
|
|
|
- Properties specific to Polygon2D variables
- Functions that use the Polygon2D type
Polygon2D (Variable type) In french: Polygone2D
The Polygon2D type is used to define all the advanced characteristics of a 2D polygon. You can define and change the characteristics of this polygon using different WLanguage properties. Characteristics of a 2D polygon: A 2D polygon consists of: - a boundary, which is a simple, closed 2D linestring.
- one or more optional holes, which are also simple, closed 2D linestrings.
Holes can't be nested, nor can they intersect with each other or with boundaries.
To be considered valid, a polygon must meet certain criteria: - Its boundary is a simple and closed linestring, i.e., it does not intersect itself and its last and first points are equal.
- The points of the boundary must be ordered clockwise.
- Holes must be oriented counterclockwise.
- Holes are also simple and closed.
- The holes of a polygon cannot cross. They can intersect, but cannot have points of their interiors in common. Therefore, intersections (if any) occur at a tangent point. This also applies to intersections between the boundary and holes of a polygon.
- A polygon cannot have spikes or lines without an interior.
- The interior of a polygon is a connected set of points. It should always be possible to go from one point of the interior of the polygon to another without crossing the boundary. This means that a hole should never split the interior of a polygon into more parts.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
p is Polygon2D
Linestring2DAddPoint(p.Outline, 0, 0)
Linestring2DAddPoint(p.Outline, 1, 0)
Linestring2DAddPoint(p.Outline, 1, 1)
Linestring2DAddPoint(p.Outline, 0, 1)
Linestring2DAddPoint(p.Outline, 0, 0)
AHole is Linestring2D
Linestring2DAddPoint(AHole, 0.4, 0.4)
Linestring2DAddPoint(AHole, 0.4, 0.6)
Linestring2DAddPoint(AHole, 0.6, 0.6)
Linestring2DAddPoint(AHole, 0.6, 0.4)
Linestring2DAddPoint(AHole, 0.4, 0.4)
p.Hole.Add(AHole)
p is Polygon2D
p.Outline.AddPoint(0, 0)
p.Outline.AddPoint(1, 0)
p.Outline.AddPoint(1, 1)
p.Outline.AddPoint(0, 1)
p.Outline.AddPoint(0, 0)
AHole is Linestring2D
AHole.AddPoint(0.4, 0.4)
AHole.AddPoint(0.4, 0.6)
AHole.AddPoint(0.6, 0.6)
AHole.AddPoint(0.6, 0.4)
AHole.AddPoint(0.4, 0.4)
p.Hole.Add(AHole)
Properties Properties specific to Polygon2D variables The following properties can be used to manipulate a 2D polygon: | | | Property name | Type used | Effect |
---|
Outline | Linestring2D | Exterior ring of the polygon. This outline is a simple, closed linestring defined in 2D coordinates. | Hole | Array of Linestring2D | Simple, closed linestrings (defined in 2D coordinates) inside the exterior ring of the polygon. | Type | Integer constant | Type of the current geometry. For a 2D polygon, corresponds to the gtPolygon2D constant. Remark: Until version 2024 Update 2, this constant was named stPolygon2D.This property is available in read-only. |
Remarks Functions that use the Polygon2D type The following functions use Polygon2D variables:
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|