Skip to content

Add Circle type#258

Open
gpeairs wants to merge 2 commits into
mainfrom
gp/issue-251
Open

Add Circle type#258
gpeairs wants to merge 2 commits into
mainfrom
gp/issue-251

Conversation

@gpeairs

@gpeairs gpeairs commented Jul 13, 2026

Copy link
Copy Markdown
Member

Close #251. Adds AbstractEllipse abstract type and makes both Ellipse and new Circle concrete subtypes. This allows Circle methods to take fast paths, as well as participate in curve recovery by resolving to a CurvilinearPolygon with four 90 degree arcs. (CurvilinearPolygon doesn't like single closed curves (see #256), and SolidModel wants arcs strictly less than 180 degrees anyway; four arcs is also nice because it's equivalent to a fully rounded square.)

gpeairs added 2 commits July 10, 2026 13:26
Circle{T} stores center and radius directly instead of constructing an
equal-radii Ellipse. Shared behavior (discretization, perimeter, SolidModel
primitive rendering, mesh sizing) moves to a new AbstractEllipse supertype
dispatching through the center/r1/r2/angle accessors, so rendered geometry
is bit-identical to before. Angle-preserving transformations return a
Circle; general transformations still widen to Ellipse. Adds bounds and
perimeter fast paths for Circle.

Breaking: Circle constructors no longer return Ellipse; code relying on
`Circle(...) isa Ellipse` should use AbstractEllipse.
… Phase 2)

A new CurvilinearPolygon(::Circle) constructor builds the circle from four
90-degree Turn arcs meeting at the axis-aligned extreme points, avoiding the
degeneracies of single-curve (constructor dedup, zero-length assert, mod2pi
collapse) and semicircle (OCC split path, collinear-endpoint guard) forms.
Circles now participate in curve recovery through both the unstyled clip path
(_normalize_curved_clip_arg) and the styled path (to_curvilinear), recovering
their arcs through boolean operations instead of warning and discretizing.
Ellipse behavior is unchanged (unequal radii are not representable as arcs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Circle type

1 participant