aws-cqc / aws-cqc/DeviceLayout.jl

Canonical geometry entity form

Open
#293 0 comments 0 reactions 0 assignees View on GitHub
2.0 enhancement
Dominant language
Julia
Stars
67
Forks
14
Avg merge
1d 19h
Merged PRs (30d)
24

Description

#286 required subtle coordinated changes for a simple behavior change. Some of these were missed and fixed in #289, and even the first commit there missed cases one wrapper type deeper. As discussed there, it would be nice to have a canonical form with some guarantees before rounding, mesh sizing, or rendering to any backend; this is already almost a `Vector{CurvilinearRegion{T}}` of non-overlapping regions, but for rounding we also need to heal or mark seams between regions.

- Flatten wrapper types (resolve OptionalStyles, extract geometry-transparent styles; resolve compound paths, unwrap decorated paths)
- Resolve offset curves (at least curves that can participate in rounding, so corner classifiers see Turns -- it's expensive to resolve arbitrary offsets) or (better) define the segment interface so that the rounding engine handles all roundable curves without explicitly asking about its type
- Heal internal boundaries (`union2d_curved`), change conventions to avoid producing internal boundaries at all (compound segments used to do this, full turns could do this, keyhole polygons are still in trouble), or identify non-roundable seam corners in the canonical `Vector{CurvilinearRegion{T}}` based on tangency or provenance (tricky since you can have roundable concave corners on seams, e.g. a compound style that abruptly changes width)

Then `to_polygons(ent::GeometryEntity{T}) = discretize(to_canonical(ent))::Vector{Polygon{T}}` universally for curve-bearing entities (including styled entities). Adding a new entity type only needs a `to_canonical(ent)::Vector{CurvilinearRegion{T}}` method for lowering to canonical form, adding a new style needs `to_canonical(ent, sty)` (or to be marked as geometry-transparent / whatever is needed to handle it in the style flattening pass). (Always returning a vector is breaking but avoids a lot of awkwardness, and there are ways to make the extra vectors less annoying. Some of the rest can be done pre-2.0.)

Contributor guide

Open the contributing guide

Research direction

Read issues #286 and #289 first to understand the missed wrapper cases and the proposed guarantees. Then trace the named entry points to_canonical, to_polygons, and union2d_curved across geometry entities and styles. Done means curve-bearing entities, including styled entities, lower to a canonical Vector{CurvilinearRegion{T}} before universal polygon discretization, with seams handled as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
computer-graphics
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.