Skip to content

Paint by face concept#21378

Draft
HellAholic wants to merge 4 commits into
mainfrom
paint_by_face_concept
Draft

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

Conversation

@HellAholic
Copy link
Copy Markdown
Contributor

@HellAholic HellAholic commented Feb 5, 2026

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 5, 2026

Test Results

24 592 tests  ±0   24 590 ✅ ±0   52s ⏱️ +2s
     1 suites ±0        2 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit ea25f42. ± Comparison against base commit 2e1a12c.

♻️ 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.
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