Skip to content

Filters part 3: Add new Geometry.getRenderShapes method - #98

Merged
1egoman merged 22 commits into
mainfrom
add-get-render-shapes
Aug 1, 2026
Merged

1egoman merged 22 commits into
mainfrom
add-get-render-shapes

Conversation

@1egoman

@1egoman 1egoman commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

This change reworks how shapes are drawn and how filters work. Two big ideas appear.

The first idea: all drawing flows through one GeometryRenderer rather than previously how it worked through PolygonRenderer / RectangleRenderer / EllipseRenderer. A new method, GeometryComponent.getRenderShapes, sits on the geometry component. It takes any shape and returns the lines and arcs to draw. Before, each shape type had its own renderer. Now one method does the job.

The second idea: getRenderShapes takes a list of filters asociated with each geometry and applies them at render time. Each filter changes the shapes before they are drawn. A mirror flips a shape over a line. A fillet rounds a corner. A chamfer cuts a corner. The stored shape data stays plain. Only the display changes. This is much better than how it worked before for fillets and chamfers (and is a requirement to implement the mirror filter) - filters are non destructive.

The old fillet and chamfer tool has a large amount of corner rendering and math logic. It was about 785 lines. That logic was refactored out into a new CornerReplacement utility. A new action applies the filter to the shape called ApplyFilterToGeometryAction. The tool is thin now. It gathers the corner and the offset, and the action does the "cutting:.

Filters now stack - you can fillet one corner and chamfer another. They apply in a fixed order. Corner edits come first. Mirrors come last.

One new rule: you cannot put a second fillet or chamfer on the same corner. The app blocks it.

This is also the first release where a mirror shows on screen. Before, it stored the data. Now it actually draws the output!

Screenshot 2026-08-01 at 1 01 10 PM

@vercel

vercel Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cad2d Ready Ready Preview Aug 1, 2026 5:23pm

1egoman added 22 commits August 1, 2026 13:22
… ApplyFilterToGeometryAction

This means that fillet / chamfer destructive operations are only applied
now once a filter is officially "applied" to the geometry it is
associated with
Always render mirror filters after filter / chamfer ones.
@1egoman
1egoman force-pushed the add-get-render-shapes branch from 1e7eb44 to 3c1c817 Compare August 1, 2026 17:22
@1egoman
1egoman merged commit 486280d into main Aug 1, 2026
2 of 3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 3c1c8175 Deployed Aug 1, 2026 by vercel[bot]
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.

1 participant