Skip to main content

Jscad Stl Slicer

@magistr/jscad-stl-slicerv2026.05.25.1· 5d agoMODELS
01README

STL slicer — Z-plane slicing, orthographic projection, symmetry analysis, feature detection, mesh comparison

02Release Notes

Merge pull request #5 from umag/extensions/jscad-stl-pair

extensions: add 15 more @magistr extensions + auto-discover CI

03Models1
@magistr/jscad-stl-slicerv2026.05.25.1jscad_stl_slicer.ts
fn sliceFile(filePath: string, sliceZ?: number, referenceWidthMm?: number, referenceDepthMm?: number)
Slice an STL file at an absolute path and produce cross-section SVG
ArgumentTypeDescription
filePathstring
sliceZ?number
referenceWidthMm?number
referenceDepthMm?number
fn sixViewsFile(filePath: string, refH: number, refW: number, refPath?: string)
6-view orthographic drawing from an STL file, optionally overlaying a reference STL
ArgumentTypeDescription
filePathstring
refHnumberReference height in mm for title
refWnumberReference width in mm for title
refPath?stringAbsolute 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
ArgumentTypeDescription
cadModelNamestring
refHnumber
refWnumber
refPath?stringAbsolute path to reference STL for overlay
fn analyze(filePath: string, sliceCount: number)
PCA-based rotation-invariant analysis: principal axes, profile extraction, symmetry detection
ArgumentTypeDescription
filePathstring
sliceCountnumber
fn analyzeSymmetry(filePath: string, threshold: number)
Per-axis mirror symmetry analysis — identifies symmetric and asymmetric axes
ArgumentTypeDescription
filePathstring
thresholdnumberSymmetry score threshold (0-1)
fn extractDirectionalProfile(filePath: string, sliceCount: number)
Extract a profile along a specified axis, measuring extent along another axis
ArgumentTypeDescription
filePathstring
sliceCountnumber
fn detectFeatures(filePath: string, sliceCount: number)
Detect asymmetric feature regions (protrusions beyond the body envelope)
ArgumentTypeDescription
filePathstring
sliceCountnumber
fn multiSlice(filePath: string, sliceCount: number)
Cross-section analysis at multiple heights with separate width and depth
ArgumentTypeDescription
filePathstring
sliceCountnumber
fn decompose(filePath: string, sliceCount: number)
Decompose a reference STL into features (body, tube, loop, platform) and generate a JSCAD script
ArgumentTypeDescription
filePathstring
sliceCountnumber
fn surfaceDistance(refPath: string, modelPath: string, sampleCount: number)
Compute RMS surface distance between two STL meshes (Hausdorff, mean, percentiles)
ArgumentTypeDescription
refPathstring
modelPathstring
sampleCountnumber
fn extractSkeleton(filePath: string, sliceCount: number)
Extract centerline skeleton of tubular features (spouts, handles) from an STL
ArgumentTypeDescription
filePathstring
sliceCountnumber
fn generateScript(filePath: string, sliceCount: number)
Generate a JSCAD script that reproduces a reference STL using polynomial profiles and directional extents
ArgumentTypeDescription
filePathstring
sliceCountnumber
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
ArgumentTypeDescription
filePathstring
sliceCountnumber
maxDegreenumber
targetErrornumberMax acceptable error in mm
fn extractContours(filePath: string, sliceCount: number, pointsPerSlice: number)
Extract actual cross-section contour points at multiple heights along an axis
ArgumentTypeDescription
filePathstring
sliceCountnumber
pointsPerSlicenumber
fn compareFiles(refPath: string, modelPath: string)
PCA-based rotation-invariant comparison of two STL files
ArgumentTypeDescription
refPathstring
modelPathstring
fn compareModels(refPath: string, cadModelName: string)
PCA-based comparison: reference STL file vs @magistr/jscad-cad model output
ArgumentTypeDescription
refPathstring
cadModelNamestring
fn enhancedCompareFiles(refPath: string, modelPath: string)
Combined PCA + aligned AABB + symmetry comparison of two STL files
ArgumentTypeDescription
refPathstring
modelPathstring
fn enhancedCompareModels(refPath: string, cadModelName: string)
Combined PCA + aligned AABB + symmetry comparison: reference STL vs @magistr/jscad-cad model
ArgumentTypeDescription
refPathstring
cadModelNamestring

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
04Previous Versions2
2026.04.04.2Apr 4, 2026
2026.04.04.1Apr 4, 2026
05Stats
A
100 / 100
Downloads
4
Archive size
54.7 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels