Blade Generation Macro Reference

Last Updated: 21 January 2026

Legend: PRODUCTION - Ready for production use TEST - Test harness / debugging only UTILITY - Helper / support macro INTERNAL - Called by other macros, not directly DEPRECATED - Do not use

Quick Reference: Primary Entry Points

For Production Use: Start with fxCreateBladeFromIntersect or the JSON workflow via fxIntegrationTest
For Testing: Use fxTestBladeFromIntersect with modes 0-4 to test all orientations

1. Production Macros (Core Pipeline)

Macro Type Purpose Key Parameters Returns
fxCreateBladeFromIntersect PRODUCTION PRIMARY ENTRY POINT
Creates complete blade solid from part body. Handles profile extraction, stock creation, pocket cutting, and final positioning.
i_partBody - Part to create blade for
w_centerX/Y/Z - Blade center position
w_normX/Y/Z - Blade normal vector
w_thickness - Material thickness
w_stockMargin - Extra margin around profile
i_return = Blade body ID
fxBladeEdgeFeatures PRODUCTION BLADE FACE DETECTION
Identifies and selects blade faces by topology type: inside pocket faces, outside perimeter faces, top faces, and thickness (reference) faces. Uses transform-first approach for orientation-independent detection.
i_bladeBody - Blade solid body ID
$_zone - Face selection mode (see table below)
i_debug - Debug output level (0=off, 1=summary, 2=verbose)
i_return = Face count
Picklist populated with selected faces
fxBladeProfileVector PRODUCTION Generates blade profile kurve(s) using vector-based positioning. Supports compound angles. i_mode - 1=TwoPoints, 2=PointNormalLength, 3=PointNormalAuto
p1-p6 - Position/normal values
p7 - Length (mode 2) or unused
i_kurveOut - Output kurve number
i_return = i_OK/i_ERROR
w_return2 = Kurve count
fxBladeProfileIntersect PRODUCTION Creates profile sheets by sectioning part at blade thickness boundaries. i_partBody - Part body
w_centerX/Y/Z - Blade center
w_normX/Y/Z - Normal vector
w_thickness - Blade thickness
i_return = Sheet count
w_return = VDM handle
fxMakeWatertight PRODUCTION Heals holes in solid bodies using sld fac rem. Essential for clean profile extraction. i_body - Body to heal
i_skipGravity - Skip gravity-facing faces
i_debug - Debug output level
i_return = Healed body ID
fxBuildGravityAwareOffset PRODUCTION Applies selective offset based on gravity direction. Contact faces get zero offset, clearance faces get full offset. i_kurve - Input profile kurve
w_offset - Offset distance
$_gravityDir - "BOTTOM", "TOP", etc.
i_return = Result kurve ID

2. fxBladeEdgeFeatures - Face Selection Modes

Algorithm: Uses topology-based detection with transform-first approach. The blade is temporarily aligned to axis coordinates, face detection is performed in simplified XYZ space, then results are transformed back. This ensures orientation-independent functionality for compound-angle blades.

Face Type Legend

Face Type Description Detection Method
Inside Faces Pocket surfaces (floor and walls) - where grippers contact the part Edge topology walk from pocket floor, normal direction toward blade center
Outside Faces External perimeter surfaces of the blade X position at blade extents (minX/maxX) with outward-facing normals
Top Faces Upward-facing surfaces at top of blade Normal pointing +Z, tracked by left/right X position
Thickness Faces Reference faces on blade thickness sides (Y-facing) Normal pointing ±Y (perpendicular to blade plane)
Base Face Bottom outside face of blade Lowest Z position with downward normal (-Z)

Available Modes (13 Total)

Mode String Category Selects Excludes
LEFT-INSIDE Inside Left inside pocket wall All other faces
RIGHT-INSIDE Inside Right inside pocket wall All other faces
BOTTOM-INSIDE Inside Pocket floor (bottom inside) All other faces
ALL-INSIDE Inside Left + Right + Bottom inside faces Outside, top, thickness faces
LEFT-OUTSIDE Outside Left outside perimeter wall All other faces
RIGHT-OUTSIDE Outside Right outside perimeter wall All other faces
BOTTOM-OUTSIDE Outside Blade base (bottom outside) All other faces
ALL-OUTSIDE Outside Left + Right + Bottom outside + Top faces Inside, thickness faces
ALL-OUTSIDE-EXCEPT-BASE Outside Left + Right outside + Top faces Base, inside, thickness faces
TOP-LEFT Top Leftmost top face only All other faces
TOP-RIGHT Top Rightmost top face only All other faces
ALL-NO-TOPZFACES Combined All inside + All outside (no top faces) Top faces, thickness faces
ALL-EVERYTHING Everything Every face on the blade body Nothing excluded

JSON Schema for fxBladeEdgeFeatures

{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "fxBladeEdgeFeatures Parameters", "description": "Configuration for blade face detection and selection", "type": "object", "properties": { "bladeBody": { "type": "integer", "description": "Blade solid body ID", "minimum": 1 }, "zone": { "type": "string", "description": "Face selection mode", "enum": [ "LEFT-INSIDE", "RIGHT-INSIDE", "BOTTOM-INSIDE", "ALL-INSIDE", "LEFT-OUTSIDE", "RIGHT-OUTSIDE", "BOTTOM-OUTSIDE", "ALL-OUTSIDE", "ALL-OUTSIDE-EXCEPT-BASE", "TOP-LEFT", "TOP-RIGHT", "ALL-NO-TOPZFACES", "ALL-EVERYTHING" ] }, "debug": { "type": "integer", "description": "Debug output level: 0=off, 1=summary, 2=verbose", "enum": [0, 1, 2], "default": 0 } }, "required": ["bladeBody", "zone"] }

Usage Example

'*** Select all inside pocket faces for gripper placement call fxBladeEdgeFeatures i_bladeBody 'ALL-INSIDE' 1 i_faceCount = i_return '*** Select outside faces except base for trimming operations call fxBladeEdgeFeatures i_bladeBody 'ALL-OUTSIDE-EXCEPT-BASE' 0 '*** Get only the left top face call fxBladeEdgeFeatures i_bladeBody 'TOP-LEFT' 0

3. JSON/IO Macros

Macro Type Purpose Location
fxReadBladeJSON PRODUCTION Parses blade parameters from JSON file. Populates FX_JSON_* globals. Supports vector, twoPointsXY, twoPointsXYZ modes. io\json\fxReadBladeJSON.ovm
fxIntegrationTest TEST JSON INTEGRATION TEST
End-to-end test: JSON → Parse → Profile → Blade Solid. Uses NucleoSphere progress.
io\json\testing\fxIntegrationTest.ovm
fxTestJSONParsing TEST Tests JSON parsing against example files. Validates all blade definition modes. io\json\fxTestJSONParsing.ovm

4. Test Harness Macros

Macro Type Purpose Modes/Usage
fxTestBladeFromIntersect TEST PRIMARY TEST HARNESS
Tests blade creation at 5 orientations. Creates hollow test part or reuses existing.
Mode 0: Normal (1,0,0)
Mode 1: Normal (0,1,0)
Mode 2: Normal (0,0,1)
Mode 3: 45° XY compound
Mode 4: 3D diagonal
fxTestEdgeFeatures TEST EDGE FEATURES TEST
Tests all 13 face selection modes on axis-aligned blades.
modeling\blade\testing\fxTestEdgeFeatures.ovm
fxTestEdgeFeaturesCompound TEST Tests face selection modes on compound-angle blades. modeling\blade\testing\fxTestEdgeFeaturesCompound.ovm
fxTestBladeProfileVectorFull TEST Tests fxBladeProfileVector on multiple parts. Creates normal + watertight copies in rows. Mode 0: All tests
Mode 1-3: Individual blade modes
fxTestCreateBlade TEST Full pipeline test: envelope → mosaic → profile → blade solid. Uses body 80 as default part
fxTestGravityOffset TEST Tests gravity-aware offset in multiple directions. Mode 99=all tests, Mode 100=grid. modeling\blade\testing\

5. Internal/Helper Macros

Macro Type Purpose Called By
fxxCreateCuttingPlane3D_Compound INTERNAL Creates cutting plane sheet at specified position/orientation for sectioning. fxBladeProfileVector
fxxProfileToKurve3D_Compound INTERNAL Extracts kurve from profile body faces. Handles compound angle rotation. fxBladeProfileVector
fxxGroupKurvesIntoIslands INTERNAL Groups kurves by bounding box overlap into disconnected islands. fxCreateBladeFromIntersect
fxxScanKurveForCorners INTERNAL Finds divergence corners requiring cylinder clearance. fxCreateBladeFromIntersect
fxValidateMosaicKurves INTERNAL Validates and scores kurves, selects best (largest area). fxBladeProfileVector
fxProfileToKurve3D INTERNAL Converts 3D profile body edges to 2D kurve. Various profile macros
fxGetBladeNormalFromBody INTERNAL Extracts blade normal vector from thickness face analysis. fxBladeEdgeFeatures

6. Visualization/Progress Macros

Macro Type Purpose Parameters
fxNucleoSphere UTILITY 8-shell rotating sphere progress indicator. Rainbow colors, 5 position modes. w_progress - 0-100, -1=init, i_NOT_SET=cleanup
i_displayMode - 0=overlay, 1=isolated
i_positionMode - 0-4 corner positions
fxNucleoEventColors UTILITY Sets event-based color scheme for NucleoSphere (e.g., red for errors). $_eventName - Event identifier
fxProgressUpdate UTILITY Wrapper for progress updates with throttling. -

7. Deprecated/Backup Files

Do NOT use these files: They are backups or deprecated versions kept for reference only.

8. Workflow Diagram

┌─────────────────────────────────────────────────────────────────────────────┐
│                         BLADE GENERATION WORKFLOW                            │
└─────────────────────────────────────────────────────────────────────────────┘

  +------------------+     +------------------+     +----------------------+
  |   JSON Config    |---->| fxReadBladeJSON  |---->|  FX_JSON_* Globals   |
  | blade_params.json|     |  (parse config)  |     | (position, normal,   |
  +------------------+     +------------------+     |  thickness, etc.)    |
                                                     +----------+-----------+
                                                                |
                           +------------------------------------+
                           |
                           v
  +--------------------------------------------------------------------------+
  |                    fxCreateBladeFromIntersect                            |
  |                    ===========================                           |
  |  +-----------------+    +-----------------+    +-----------------+       |
  |  | fxBladeProfile  |--->| fxMakeWatertight|--->| Create Stock    |       |
  |  |   Intersect     |    | (heal holes)    |    | (blade blank)   |       |
  |  +-----------------+    +-----------------+    +--------+--------+       |
  |                                                          |               |
  |  +-----------------+    +-----------------+    +--------v--------+       |
  |  | Subtract        |<---| Thicken Profile |<---| Apply Gravity   |       |
  |  | Cutouts         |    | Sheets          |    | Offset          |       |
  |  +--------+--------+    +-----------------+    +-----------------+       |
  |           |                                                              |
  |  +--------v--------+    +-----------------+                              |
  |  | Edge Blend      |--->| Transform to    |---> BLADE BODY OUTPUT        |
  |  | (optional)      |    | Final Position  |                              |
  |  +-----------------+    +-----------------+                              |
  +--------------------------------------------------------------------------+

                         POST-PROCESSING WITH EDGE FEATURES
  +--------------------------------------------------------------------------+
  |  BLADE BODY ---> fxBladeEdgeFeatures ---> SELECTED FACES (picklist)      |
  |                         |                                                |
  |                         +---> ALL-INSIDE        ---> Gripper placement   |
  |                         +---> ALL-OUTSIDE       ---> Perimeter operations|
  |                         +---> TOP-LEFT/RIGHT    ---> Label positioning   |
  |                         +---> ALL-EVERYTHING    ---> Full body operations|
  +--------------------------------------------------------------------------+

                           TEST ENTRY POINTS
  +--------------------------------------------------------------------------+
  |  fxTestBladeFromIntersect     - Tests 5 orientations (modes 0-4)         |
  |  fxTestEdgeFeatures           - Tests all 13 face selection modes        |
  |  fxIntegrationTest            - JSON > Profile > Blade (with progress)   |
  |  fxTestBladeProfileVectorFull - Tests profile generation on many parts   |
  +--------------------------------------------------------------------------+

9. Global Variables Reference

Variable File Purpose
i_FX_DEBUG_LEVEL fxGlobals.var 0=OFF, 1=SUMMARY, 2=VERBOSE
w_FX_PROFILE_CLEARANCE fxGlobals.var Divergence corner cylinder radius / edge blend
i_FX_CONTACT_ARC_MODE fxGlobals.var 0=NONE, 1=GRAVITY, 2=PERPENDICULAR
i_FX_SHOW_PROGRESS fxGlobals.var Enable/disable NucleoSphere progress
FX_JSON_* fxJSON.var All JSON-parsed blade parameters (60+ globals)

Generated: 21 January 2026 | Fixture Development Q1 2026