Blade Profile Generation Process

Complete Technical Reference: From 3D Cross-Section to Flat Cutting Profile

v1.0 — January 14, 2026

Table of Contents

  1. Process Overview
  2. Coordinate Systems
  3. Step 1: Input Configuration
  4. Step 2: Blade Plane Definition
  5. Step 3: Cross-Section Slicing
  6. Step 4: Profile Extraction
  7. Step 5: Flatten to 2D
  8. Step 6: Apply Offset
  9. Step 7: Extrude to 3D Body
  10. Step 8: Width Trimming
  11. Step 9: Edge Modifications
  12. Transformation Sequences
  13. Current Issues & Status
  14. JSON Parameters Reference

0 Process Overview

The blade profile generation system creates fixture blades that precisely cradle parts for waterjet/laser cutting operations. The process transforms a 3D solid model into a 2D cutting profile through a series of geometric operations.

Key Insight: The blade is manufactured as a flat 2D profile on a waterjet/laser table. When installed in the fixture at the correct angle, this flat profile becomes the 3D cradle shape that matches the part geometry.
Simpler Width Trim Approach (Jan 14): Instead of transforming the cutter to match the tilted blade, rotate the blade to flat around its baseline pivot (at half-thickness), do the cut with a simple 2D cutter, then rotate it back.

1 Coordinate Systems

Understanding the coordinate systems is critical for the transformation sequence. There are three frames of reference:

World Space (Machine Coordinates)
  • X Typically the blade's profile direction (left/right)
  • Y Typically along the blade line (front/back)
  • Z Up/down (gravity is -Z)
Blade-Local Space
  • X Profile direction (perpendicular to blade face)
  • Y Along blade width (from→to line)
  • Z Blade height (normal to blade plane)
Flat Cutting Plane (2D)
  • X Horizontal on cutting table
  • Y Vertical on cutting table
  • Z Material thickness (negligible)

Deriving Rotation Angles

// Azimuth: rotation around world Z axis
w_azimuth = atn2(normal.y, normal.x)

// Elevation: tilt from XY plane
w_elevation = asn(normal.z)
PEPS Note: atn2(y, x) returns degrees, not radians.

6 Step 5: Flatten to 2D (The Critical Transform)

THIS IS WHERE THE CURRENT BUG LIVES. The transformation from 3D blade-local coordinates to flat 2D cutting coordinates is not working correctly for compound angles.

Transformation Sequence

1
Translate to Origin

Move the blade center to world origin (0,0,0)

tra m1 x(-w_posX) y(-w_posY) z(-w_posZ)
2
Undo Elevation (Tilt)

Rotate around X by negative elevation to flatten the tilt

rot m1 x(-w_elevation)
3
Undo Azimuth (Rotation)

Rotate around Z by negative azimuth to align with world X

rot m1 z(-w_azimuth)

9 Step 8: Width Trimming

The Width Trim Transformation Problem

🐛 Current Bug: Double Transformation

The cutter kurve is drawn using bounding box coordinates that are already in world space (rotated). Then the cutter body is rotated AGAIN.

Simpler Fix (Baseline Pivot Approach):

  1. Identify the baseline pivot (bottom edge where left/right meet, offset by half blade thickness)
  2. Rotate blade to FLAT around this baseline pivot
  3. Apply simple 2D cutter (no rotation needed)
  4. Rotate blade BACK to original position

The baseline stays fixed during rotation, so the blade ends up exactly where it started, but trimmed.

Baseline Pivot Approach

'*** Calculate pivot point at blade baseline + half thickness
w_pivotX = w_bladeX + (w_thickness / 2) * w_normalX
w_pivotY = w_bladeY + (w_thickness / 2) * w_normalY
w_pivotZ = w_bladeZ + (w_thickness / 2) * w_normalZ

'*** Step 1: Rotate blade to flat around baseline pivot
set m1
tra m1 x(0-w_pivotX) y(0-w_pivotY) z(0-w_pivotZ)
rot m1 x(0-w_FX_BLADE_ELEVATION)
rot m1 z(0-w_FX_BLADE_AZIMUTH)
sld bod tra i_bladeBody m1

'*** Step 2: Apply simple 2D cutter (blade is now flat!)
'*** No rotation needed - just a simple box/wedge cut
sld sub i_bladeBody i_simpleCutter i_result i_ret

'*** Step 3: Rotate blade back to original position
set m2
rot m2 zw_FX_BLADE_AZIMUTH
rot m2 xw_FX_BLADE_ELEVATION
tra m2 xw_pivotX yw_pivotY zw_pivotZ
sld bod tra i_bladeBody m2

12 Current Issues & Status

Feature Status Matrix

FeatureStatusNotes
JSON ParsingWorking6/6 tests pass
Cross-Section (sld sec)WorkingMode A profile generation
Profile Flatten (simple)WorkingX-normal blades only
Profile Flatten (compound)Broken3D rotation not working
Width Trim (simple blades)WorkingX-normal only
Width Trim (3D rotation)BrokenDouble transform bug - use baseline pivot approach
Safety BlendSkeletonFile exists, logic incomplete
Plunger SlotsTODOTrapezoidal, wider at top