Skip to content

Interactive Face Align - Complete Documentation

PLACE IMAGE OF THE SELECTED FACE OVERLAY IN THE 3D VIEWPORT HERE

The "Interactive Face Align" tool in DAMTools allows aligning one or more faces of one or more objects to Z=0 visually and interactively, displaying overlays and floating help on screen. It is ideal for preparing models for 3D printing, architecture, and precise modeling.


Index


What is Interactive Face Align?

It allows selecting a face of an object (or a face per object in multi-object mode) and aligning that face to Z=0, rotating the object so that the face's normal points downwards. The entire process is visual, with overlays and on-screen help.

PLACE IMAGE OF THE SIDEBAR PANEL WITH THE "Align Face Z0 (Interactive)" OPTION IN FOCUS HERE


Workflow

  1. Select one or more mesh objects.
  2. Activate the "Align Face Z0 (Interactive)" operator from the sidebar panel or pie menu.
  3. Hover the mouse over the face to align (it will be highlighted in red).
  4. Click to fix the face.
  5. Repeat for each object (in multi-object mode).
  6. The object is rotated and translated so the face touches Z=0.
  7. ESC or right-click to cancel.

PLACE GIF OR IMAGE SEQUENCE OF THE ALIGNMENT WORKFLOW HERE


Shortcuts and Access

  • DAMTools Sidebar Panel: "Align Face Z0 (Interactive)" option.
  • DAMTools Pie Menu (Shift+W): "Align Face Z0 (Interactive)" option.
  • Operator: DAMTools.align_face_interactive

Functionality Explanation

Face Selection with Overlay

  • When hovering over a face, it's highlighted with a red overlay.
  • Faces already selected in other objects are shown in blue.
  • The overlay is drawn in 2D over the 3D Viewport.

Multi-Object Mode

  • Allows selecting one face for each selected object.
  • The overlay shows progress (e.g., "Select face per object (⅖)").

Floating Help and Visual Feedback

  • Floating text is displayed near the mouse with instructions and progress.
  • The overlay and help update in real-time.

Key Code Snippets

Face Overlay Drawing

def draw_callback_px(self, context):
    # ...
    if self.is_multi_object_mode:
        for obj, face_data in self.chosen_faces_map.items():
            # Draws blue overlay for already selected faces
    if self.selected_face_verts_world and self.hit_obj:
        # Draws red overlay for the face under the cursor

Selected Face Alignment

def _align_object(self, context, obj_to_align, face_idx_to_align, obj_matrix_at_hit):
    # Calculates the rotation needed to align the face normal to -Z
    # Applies the rotation and translates the object so the face touches Z=0

Suggested Images

  • PLACE IMAGE OF THE SELECTED FACE OVERLAY IN THE 3D VIEWPORT
  • PLACE GIF OF THE INTERACTIVE ALIGNMENT WORKFLOW
  • PLACE IMAGE OF THE SIDEBAR PANEL WITH THE OPTION IN FOCUS
  • PLACE IMAGE OF THE DAMTools PIE MENU WITH "Align Face Z0" IN FOCUS

For technical details and explanation of each file, see the technical documentation in the [DOCUMENTATION] folder.