Repository navigation
Filters part 3: Add new Geometry.getRenderShapes method - #98
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…mponent rendering
… 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
…r than hand rolling it
Always render mirror filters after filter / chamfer ones.
1egoman
force-pushed
the
add-get-render-shapes
branch
from
August 1, 2026 17:22
1e7eb44 to
3c1c817
Compare
This branch was successfully deployed
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.
This change reworks how shapes are drawn and how filters work. Two big ideas appear.
The first idea: all drawing flows through one
GeometryRendererrather than previously how it worked throughPolygonRenderer/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:
getRenderShapestakes 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
CornerReplacementutility. A new action applies the filter to the shape calledApplyFilterToGeometryAction. 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!