Add Circle type#258
Open
gpeairs wants to merge 2 commits into
Open
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #251. Adds
AbstractEllipseabstract type and makes bothEllipseand newCircleconcrete subtypes. This allowsCirclemethods 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.)