Skip to content

Paint by face concept - #21378

Open
HellAholic wants to merge 5 commits into
mainfrom
paint_by_face_concept
Open

Paint by face concept#21378
HellAholic wants to merge 5 commits into
mainfrom
paint_by_face_concept

Conversation

@HellAholic

@HellAholic HellAholic commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Proof of concept for paint by face

paint_face_concept

Requires Ultimaker/libUvula#9

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.
@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Test Results

24 950 tests   24 948 ✅  49s ⏱️
     1 suites       2 💤
     1 files         0 ❌

Results for commit f2fe418.

♻️ This comment has been updated with latest results.

HellAholic and others added 2 commits February 5, 2026 23:26
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.
@HellAholic
HellAholic marked this pull request as ready for review June 7, 2026 14:31
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.

2 participants