@magistr/jscad-stl-slicer
v2026.04.04.2
STL slicer — Z-plane slicing, orthographic projection, symmetry analysis, feature detection, mesh comparison
Labels
cadjscadstlanalysis
Contents
Install
$ swamp extension pull @magistr/jscad-stl-slicer@magistr/jscad-stl-slicerv2026.04.04.2jscad_stl_slicer.ts
sliceFileSlice an STL file at an absolute path and produce cross-section SVG
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| sliceZ? | number | |
| referenceWidthMm? | number | |
| referenceDepthMm? | number |
sixViewsFile6-view orthographic drawing from an STL file, optionally overlaying a reference STL
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| refH | number | Reference height in mm for title |
| refW | number | Reference width in mm for title |
| refPath? | string | Absolute path to reference STL for overlay |
sixViews6-view orthographic drawing from a @magistr/jscad-cad model, optionally overlaying a reference STL
| Argument | Type | Description |
|---|---|---|
| cadModelName | string | |
| refH | number | |
| refW | number | |
| refPath? | string | Absolute path to reference STL for overlay |
analyzePCA-based rotation-invariant analysis: principal axes, profile extraction, symmetry detection
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| sliceCount | number |
analyzeSymmetryPer-axis mirror symmetry analysis — identifies symmetric and asymmetric axes
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| threshold | number | Symmetry score threshold (0-1) |
extractDirectionalProfileExtract a profile along a specified axis, measuring extent along another axis
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| sliceCount | number |
detectFeaturesDetect asymmetric feature regions (protrusions beyond the body envelope)
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| sliceCount | number |
multiSliceCross-section analysis at multiple heights with separate width and depth
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| sliceCount | number |
decomposeDecompose a reference STL into features (body, tube, loop, platform) and generate a JSCAD script
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| sliceCount | number |
surfaceDistanceCompute RMS surface distance between two STL meshes (Hausdorff, mean, percentiles)
| Argument | Type | Description |
|---|---|---|
| refPath | string | |
| modelPath | string | |
| sampleCount | number |
extractSkeletonExtract centerline skeleton of tubular features (spouts, handles) from an STL
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| sliceCount | number |
generateScriptGenerate a JSCAD script that reproduces a reference STL using polynomial profiles and directional extents
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| sliceCount | number |
fitProfilesFit polynomials to body profile curves — returns coefficients for xRadius, dP, dN vs normalized height
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| sliceCount | number | |
| maxDegree | number | |
| targetError | number | Max acceptable error in mm |
extractContoursExtract actual cross-section contour points at multiple heights along an axis
| Argument | Type | Description |
|---|---|---|
| filePath | string | |
| sliceCount | number | |
| pointsPerSlice | number |
compareFilesPCA-based rotation-invariant comparison of two STL files
| Argument | Type | Description |
|---|---|---|
| refPath | string | |
| modelPath | string |
compareModelsPCA-based comparison: reference STL file vs @magistr/jscad-cad model output
| Argument | Type | Description |
|---|---|---|
| refPath | string | |
| cadModelName | string |
enhancedCompareFilesCombined PCA + aligned AABB + symmetry comparison of two STL files
| Argument | Type | Description |
|---|---|---|
| refPath | string | |
| modelPath | string |
enhancedCompareModelsCombined PCA + aligned AABB + symmetry comparison: reference STL vs @magistr/jscad-cad model
| Argument | Type | Description |
|---|---|---|
| refPath | string | |
| cadModelName | string |
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
Files
crossSection(image/svg+xml)— SVG cross-section at the sliced Z plane
sideProfile(image/svg+xml)— SVG side profile projected onto XZ plane
sixViewSheet(image/svg+xml)— SVG 6-view engineering drawing sheet with optional reference overlay
profileData(application/json)— JSON profile curve extracted along primary axis
directionalProfile(application/json)— JSON profile curve along a specified axis with directional extents
multiSliceData(application/json)— JSON multi-height cross-section measurements with separate width and depth
2026.04.04.141.4 KBApr 4, 2026
STL slicer — Z-plane slicing, orthographic projection, symmetry analysis, feature detection, mesh comparison
@magistr/jscad-cad
linux-x86_64linux-aarch64darwin-x86_64darwin-aarch64
cadjscadstlanalysis