AbstractThe segments between consecutive vertices, plus the closing one when isClosed.
That closing edge is the whole of what isClosed changes here, and it is not cosmetic: without
it a polygon's last side is missing from every edge-crossing test, so a query touching only
that side would report no overlap.
Total length along the edges — a perimeter when isClosed, a path length otherwise.
ProtectedcomputeThe points this shape is made of, in order.
A curve tessellates here — there is no exact vertex list for a circle, and the subclass that draws one decides how finely to approximate it. A shape whose test does not need an approximation overrides the methods that would use it instead.
Implemented rather than exposed directly so the result can be held: see the class note.
Whether point is inside this shape's outline.
Always false for an unfilled shape: there is no inside to be in. Callers wanting "on or near the outline" want hitTestPoint.
Distance from point to this shape's outline. Zero on the outline, positive on either side.
Whether point hits this shape, allowing margin of slack around its outline.
Inside a filled shape counts however far from the outline it is — that is what filled means.
ProtectedmapThis shape's points carried through matrix, for a subclass to hand to the shape it builds.
Exact however the matrix turns or scales — a point maps to a point, with nothing to approximate and no accumulated tessellation error to carry.
Whether this shape and an axis-aligned query box share any area.
Concrete, and the generic answer for anything made of straight edges: the shape sits inside the query, or an edge crosses it, or — for a filled shape only — the query sits inside the shape.
A subclass overrides this when it has an exact test of its own that a vertex list can only approximate, which for a curve it always can.
ProtectedrotatedThis shape's frame angle after matrix is applied — for an implementation of
Geometry2d.transform to hand to the shape it builds.
AbstracttransformThis shape carried through matrix.
Abstract because only the shape knows what it stays under a transform: a circle scaled by different factors on each axis is an ellipse, not a circle, and not a tessellation of one either. Returning the exact shape is what lets a moved symbol keep an exact test, where mapping a fixed vertex list forward would bake in whatever approximation the vertices already carried.
An implementation must carry frameAngle forward too, adding the matrix's own rotation to it — Geometry2d.rotatedFrameAngle does that. Dropping it silently widens the shape's box the first time anything turns it.
ReadonlyframeReadonlyisReadonlyisReadonlypaddingProtected ReadonlypointsRead directly rather than through Geometry2d.vertices by subclasses on a hot path: the getter memoizes, so both give the same array, but hit-testing calls this once per sample.
The smallest box containing every vertex, measured in this shape's own frame.
Axis-aligned while frameAngle is zero, and turned with the shape once it is not — which is what keeps a rotated shape's box tight instead of letting it grow to the axis-aligned box around the turned one.