Complete Technical Reference: From 3D Cross-Section to Flat Cutting Profile
v1.0 — January 14, 2026The 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.
Understanding the coordinate systems is critical for the transformation sequence. There are three frames of reference:
// Azimuth: rotation around world Z axis
w_azimuth = atn2(normal.y, normal.x)
// Elevation: tilt from XY plane
w_elevation = asn(normal.z)
atn2(y, x) returns degrees, not radians.
Move the blade center to world origin (0,0,0)
tra m1 x(-w_posX) y(-w_posY) z(-w_posZ)
Rotate around X by negative elevation to flatten the tilt
rot m1 x(-w_elevation)
Rotate around Z by negative azimuth to align with world X
rot m1 z(-w_azimuth)
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):
The baseline stays fixed during rotation, so the blade ends up exactly where it started, but trimmed.
'*** 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
| Feature | Status | Notes |
|---|---|---|
| JSON Parsing | Working | 6/6 tests pass |
| Cross-Section (sld sec) | Working | Mode A profile generation |
| Profile Flatten (simple) | Working | X-normal blades only |
| Profile Flatten (compound) | Broken | 3D rotation not working |
| Width Trim (simple blades) | Working | X-normal only |
| Width Trim (3D rotation) | Broken | Double transform bug - use baseline pivot approach |
| Safety Blend | Skeleton | File exists, logic incomplete |
| Plunger Slots | TODO | Trapezoidal, wider at top |