Skip to content

Feature/ feat( text emboss): 3-axis text bend & arc deformation with interactive viewport gizmo controls - #15770

Open
DDS-Solutions wants to merge 13 commits into
prusa3d:masterfrom
DDS-Solutions:feature/emboss-bend-gizmo
Open

Feature/ feat( text emboss): 3-axis text bend & arc deformation with interactive viewport gizmo controls#15770
DDS-Solutions wants to merge 13 commits into
prusa3d:masterfrom
DDS-Solutions:feature/emboss-bend-gizmo

Conversation

@DDS-Solutions

Copy link
Copy Markdown

Some background here : #10169

This PR introduces 3-axis text deformation capabilities to the Emboss Text tool, allowing text to bend horizontally, curl vertically, and curve along an in-plane arc. It also adds interactive gizmo handles in the 3D plater viewport for real-time manipulation alongside dialog slider controls, complete with full persistence in 3MF project files, presets, and undo/redo history.

Key Features

3-Axis Text Deformation:
Horizontal Bend: Bends text around the vertical axis (conforming around cylinders/columns).
Vertical Curl: Curls text around the horizontal axis (conforming along arches or curved profiles).
In-Plane Arc: Curves text along the surface plane (circular text layout).
Interactive Viewport Gizmo:
Adds interactive sliding cube handles directly to the RotationGizmo when an embossed text volume is selected.
Supports live real-time mesh deformation feedback during dragging while maintaining correct volume selection IDs.
Plater Dialog & Slider Controls:
Integrated with RotationDialog and SliderWithInput widgets for fine-tuned numerical input and slider adjustments. Persistence & Serialization:

  • Full save/load roundtripping in 3MF project files via cereal serialization.
  • Preserved in undo/redo stack (ModelSerialize) and text preset management (TextPresetManager).

Technical Highlights

Face-Normal Extrusion Thickness:
Deforms text by arcing along the plane and rotating the cross-section through depth bends, ensuring the text retains its exact intended extrusion thickness normal to the curved surface rather than losing thickness or shearing.
Adaptive Subdivision & Chord Error Control:
Edge subdivision (subdivide_edges) bounds chord error across composed deformations to produce smooth curved geometry
without facet artifacts.
Fixed-Point Mesh Recovery (unbend_mesh):
Recovers original undeformed mesh bounds through iterative fixed-point estimation, accounting for bounding box growth when curved surfaces rotate in 3D.
Clean Architecture & Separation:
Geometry and deformation logic encapsulated in TextBender and BendedProjection.
Presentation and interaction cleanly bound in RotationGizmo and RotationDialog.


Test Coverage

TextBenderTests: Tests deformation mathematics, roundtrip bend/unbend coordinate invariance, and face-normal extrusion thickness preservation.
EmbossBendTests: End-to-end integration tests verifying mesh generation, surface distance preservation across multi-axis combinations, and undo serialization.
SliderWithInputTests: Unit tests covering UI input validation, slider bounds, and event callbacks.
3MFTests: Unit tests verifying 3MF export/import roundtripping of bend parameters.

Screenshot 2026-09-05 150326 Screenshot 2026-09-05 150101 Screenshot 2026-09-05 150038

- Recover original baseline dimensions upon unbending via analytical arc ratio
- Protect in-flight drag angles from being overwritten during selection updates
- Automatically reapply bend deformation upon text/font regeneration in EmbossJob
- Implement adaptive edge subdivision in TextBender for smooth glyph curvature
- Prevent duplicate bend slider cubes on temporary highlight/dragging nodes
- Add dragging_bend_slider guard to transient mouse handler to prevent axis drops
- Clamp numeric inputs to [-180 deg, 180 deg] and [-pi, pi]
- Refresh slider positions on bounding box updates for standalone text
- Conform BendedProjection project() and unproject() to IProjection contract
- Integrate and pass all review regression tests (24/24 assertions passing)
…tions

- Keep text extrusion normal to face across horizontal bend, curl, and arc
- Update subdivision chord error bounds and unbend fixed-point mesh bounds estimation
- Add unit tests for depth and normal preservation in EmbossBendTests and TextBenderTests
- Update .gitignore for compile_commands.json, .clangd, and Run_PrusaSlicer.bat
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