fn sliceFile(filePath: string, sliceZ?: number, referenceWidthMm?: number, referenceDepthMm?: number)
Slice an STL file at an absolute path and produce cross-section SVG
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| sliceZ? | number | no | |
| referenceWidthMm? | number | no | |
| referenceDepthMm? | number | no | |
fn sixViewsFile(filePath: string, refH: number, refW: number, refPath?: string)
6-view orthographic drawing from an STL file, optionally overlaying a reference STL
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| refH | number | yes | Reference height in mm for title |
| refW | number | yes | Reference width in mm for title |
| refPath? | string | no | Absolute path to reference STL for overlay |
fn sixViews(cadModelName: string, refH: number, refW: number, refPath?: string)
6-view orthographic drawing from a @magistr/jscad-cad model, optionally overlaying a reference STL
| Argument | Type | Required | Description |
|---|
| cadModelName | string | yes | |
| refH | number | yes | |
| refW | number | yes | |
| refPath? | string | no | Absolute path to reference STL for overlay |
fn analyze(filePath: string, sliceCount: number)
PCA-based rotation-invariant analysis: principal axes, profile extraction, symmetry detection
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| sliceCount | number | yes | |
fn analyzeSymmetry(filePath: string, threshold: number)
Per-axis mirror symmetry analysis — identifies symmetric and asymmetric axes
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| threshold | number | yes | Symmetry score threshold (0-1) |
fn extractDirectionalProfile(filePath: string, sliceCount: number)
Extract a profile along a specified axis, measuring extent along another axis
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| sliceCount | number | yes | |
fn detectFeatures(filePath: string, sliceCount: number)
Detect asymmetric feature regions (protrusions beyond the body envelope)
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| sliceCount | number | yes | |
fn multiSlice(filePath: string, sliceCount: number)
Cross-section analysis at multiple heights with separate width and depth
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| sliceCount | number | yes | |
fn decompose(filePath: string, sliceCount: number)
Decompose a reference STL into features (body, tube, loop, platform) and generate a JSCAD script
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| sliceCount | number | yes | |
fn surfaceDistance(refPath: string, modelPath: string, sampleCount: number)
Compute RMS surface distance between two STL meshes (Hausdorff, mean, percentiles)
| Argument | Type | Required | Description |
|---|
| refPath | string | yes | |
| modelPath | string | yes | |
| sampleCount | number | yes | |
fn extractSkeleton(filePath: string, sliceCount: number)
Extract centerline skeleton of tubular features (spouts, handles) from an STL
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| sliceCount | number | yes | |
fn generateScript(filePath: string, sliceCount: number)
Generate a JSCAD script that reproduces a reference STL using polynomial profiles and directional extents
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| sliceCount | number | yes | |
fn fitProfiles(filePath: string, sliceCount: number, maxDegree: number, targetError: number)
Fit polynomials to body profile curves — returns coefficients for xRadius, dP, dN vs normalized height
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| sliceCount | number | yes | |
| maxDegree | number | yes | |
| targetError | number | yes | Max acceptable error in mm |
fn extractContours(filePath: string, sliceCount: number, pointsPerSlice: number)
Extract actual cross-section contour points at multiple heights along an axis
| Argument | Type | Required | Description |
|---|
| filePath | string | yes | |
| sliceCount | number | yes | |
| pointsPerSlice | number | yes | |
fn compareFiles(refPath: string, modelPath: string)
PCA-based rotation-invariant comparison of two STL files
| Argument | Type | Required | Description |
|---|
| refPath | string | yes | |
| modelPath | string | yes | |
fn compareModels(refPath: string, cadModelName: string)
PCA-based comparison: reference STL file vs @magistr/jscad-cad model output
| Argument | Type | Required | Description |
|---|
| refPath | string | yes | |
| cadModelName | string | yes | |
fn enhancedCompareFiles(refPath: string, modelPath: string)
Combined PCA + aligned AABB + symmetry comparison of two STL files
| Argument | Type | Required | Description |
|---|
| refPath | string | yes | |
| modelPath | string | yes | |
fn enhancedCompareModels(refPath: string, cadModelName: string)
Combined PCA + aligned AABB + symmetry comparison: reference STL vs @magistr/jscad-cad model
| Argument | Type | Required | Description |
|---|
| refPath | string | yes | |
| cadModelName | string | yes | |
Resources
slice(infinite)— Z-plane slice result with cross-section measurements
sixViewReport(infinite)— 6-view projection measurements (front/back/left/right/top/bottom)
analysisReport(infinite)— PCA-based rotation-invariant mesh analysis
comparisonReport(infinite)— Rotation-invariant PCA comparison between two STL meshes
symmetryReport(infinite)— Per-axis mirror symmetry analysis
featureDetectionReport(infinite)— Detected asymmetric feature regions (protrusions, appendages)
surfaceDistanceReport(infinite)— RMS surface distance between two meshes (mean, RMS, Hausdorff, percentiles)
enhancedComparisonReport(infinite)— Combined PCA + aligned AABB + symmetry comparison