Paint by face concept#21378
Draft
HellAholic wants to merge 4 commits into
Draft
Conversation
Introduce a FACE brush shape and implement painting/preview logic that targets whole visual faces instead of individual triangles. Adds Shape.FACE enum and two helpers: _getCoplanarConnectedFaces (flood-fill neighbor faces by normal similarity, default angle_threshold 0.99) and _getUvAreasForFace (collects UV polygons for all connected coplanar triangles, scales by texture dimensions). Integrates face-mode in event handling so the cursor and painting operations use the full face UV areas; falls back to existing stroke-based behavior for other brush shapes and handles missing UVs or mesh data gracefully.
Introduce a new BrushShapeButton for the Face brush (Cura.PaintToolBrush.FACE) with icon and localized label. Disable the "Brush Size" label and slider when the selected BrushShape is FACE, since size is not applicable for this brush.
Contributor
Replace list-based flood-fill with collections.deque for O(1) pops, using popleft() to traverse connected faces. Add a brush-size -> angle_threshold mapping and pass it into _getCoplanarConnectedFaces so brush size controls coplanarity. Optimize neighbor enqueueing with deque.extend and tighten docstrings. Simplify UV polygon collection by skipping None coords, building/scaling UV arrays, and collecting Polygons. In QML, remove the disabled condition on the shape size slider so it is always enabled. These changes improve traversal performance and make face selection responsive to brush size.
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.
Proof of concept for paint by face
Requires Ultimaker/libUvula#9