2D polygons and regions
39 pages
-
polygon2.ofA polygon from its corners in order, checked for count and finiteness. -
polygon2.fromFlatA polygon from a flat [x0, y0, x1, y1, …] ring, checked like Polygon2.of. -
polygon2.rectangleAn axis-aligned rectangle, counter-clockwise from its lower-left corner. -
polygon2.convexHullThe smallest convex polygon containing every point, counter-clockwise. -
polygon2.pointsThe polygon’s corners in ring order. -
polygon2.signedAreaThe signed area: positive for a counter-clockwise ring, negative for clockwise (y up). -
polygon2.areaThe area the ring encloses, the absolute signed area. -
polygon2.isCounterClockwiseWhether the ring winds counter-clockwise (y up). -
polygon2.reversedThe same ring wound the other way. -
polygon2.perimeterThe total length of the ring’s edges, closing edge included. -
polygon2.boundingBoxThe ring’s bounds, as a box in the z = 0 plane. -
polygon2.windingNumberHow many times the ring winds around a point, counter-clockwise turns counting +1. -
polygon2.containsWhether the ring encloses a point under a fill rule. -
polygon2.transformedThe polygon with a transform applied, as if lying in the z = 0 plane. -
polygon2.onPlaneThe ring placed on a plane, as points in space. -
polygon2.toJSONThe polygon as plain JSON: its flat ring. -
polygon2.unionThe region covered by either polygon, by kernel2d’s exact arrangement boolean. -
polygon2.intersectionThe region covered by both polygons, by kernel2d’s exact arrangement boolean. -
polygon2.differenceThe region of a not covered by b, by kernel2d’s exact arrangement boolean; a hole appears when b lies inside a. -
polygon2.xorThe region covered by exactly one of the polygons, by kernel2d’s exact arrangement boolean. -
polygon2.minkowskiSumThe Minkowski sum a ⊕ b: every point of a plus every point of b, for convex or non-convex rings. -
polygon2.offsetThe ring moved outward or inward along its edges with chosen corners, as at most one ring. -
polygon2.insetThe ring shrunk by a distance with mitred corners, keeping every part it splits into. -
polygon2.outsetThe ring grown by a distance with mitred corners; gaps that close become holes. -
polygon2.repairedThe region a self-intersecting or mis-wound ring encloses under a fill rule, as clean polygons with holes. -
polygon2.triangulateA constrained Delaunay triangulation of the ring under a fill rule, optionally refined to a minimum angle. -
region2.ofA region of one outline and its holes, rewound so the outline is counter-clockwise and holes clockwise. -
region2.fromPartsA region of several parts, each an outline with holes, wound as Region2.of winds them. -
region2.areaThe enclosed area: every outline’s area minus its holes’. -
region2.boundingBoxThe region’s bounds, as a box in the z = 0 plane. -
region2.containsWhether a point lies inside an outline of the region and in none of that outline’s holes. -
region2.ringsEvery ring of the region: each part’s outline, then its holes. -
region2.triangulateA constrained Delaunay triangulation of the region with its holes left empty, optionally refined to a minimum angle. -
region2.unionThe union of two single-outline regions, by kernel2d’s exact arrangement boolean. -
region2.intersectionThe intersection of two single-outline regions, by kernel2d’s exact arrangement boolean. -
region2.differenceThe part of region a outside region b, by kernel2d’s exact arrangement boolean. -
region2.toJSONThe region as plain JSON: each part’s outline and holes as flat rings. -
triangulation2.minAngleDegThe smallest interior angle of any triangle, in degrees, the measure triangulate’s minAngleDeg bounds. -
triangulation2.toMeshThe triangulation as a Mesh of triangles in the z = 0 plane, facing +z.