-
Notifications
You must be signed in to change notification settings - Fork 0
Geometry Model
This page documents how CutCase thinks about box geometry.
CutCase uses inside dimensions internally:
-
W: inside width -
D: inside depth -
H: inside height -
T: material thickness
If the user enters outside dimensions, the app converts those values to inside dimensions before panel generation.
Open box:
outsideWidth = W + 2T
outsideDepth = D + 2T
outsideHeight = H + T
Closed box:
outsideWidth = W + 2T
outsideDepth = D + 2T
outsideHeight = H + 2T
The open box only adds bottom thickness vertically. The closed box adds bottom and top thickness.
Panel base sizes:
| Panel | Size |
|---|---|
| front | W x H |
| back | W x H |
| left | D x H |
| right | D x H |
| bottom | W x D |
| top | W x D |
The top panel exists only when the box is closed.
CutCase uses three edge types:
ABflat
A and B are complementary finger patterns. Flat edges do not add tabs.
For an open box:
| Panel | Top | Right | Bottom | Left |
|---|---|---|---|---|
| front | flat | B | A | B |
| back | flat | B | A | B |
| left | flat | A | A | A |
| right | flat | A | A | A |
| bottom | B | B | B | B |
For a closed box:
| Panel | Top | Right | Bottom | Left |
|---|---|---|---|---|
| front | A | B | A | B |
| back | A | B | A | B |
| left | A | A | A | A |
| right | A | A | A | A |
| bottom | B | B | B | B |
| top | B | B | B | B |
The finger pattern is generated from:
- edge length
- target finger width
- material thickness
- effective kerf
The segment count is adjusted:
- Start with
floor(edgeLength / desiredFingerWidth). - If the count is even, subtract one.
- Ensure at least one segment.
- Center the remaining margin.
- If a small end margin would be weaker than material thickness, reduce count by two when possible.
Tabs appear on alternating segments:
- A: odd segments
- B: even segments
Using an odd segment count keeps A and B complementary along mating edges.
CutCase currently applies a simple effective-kerf model to tab widths.
Effective kerf:
effectiveKerf = kerf * fitScale
Fit scales:
| Fit | Scale |
|---|---|
| loose | 0.65 |
| standard | 1.0 |
| tight | 1.35 |
This is useful for fast iteration, but it is not a full polygon offset engine.
A lift-off lid adds five generated parts:
- lid top
- lid front lip
- lid back lip
- lid left lip
- lid right lip
The lid top size:
lidWidth = W + 2T + 2 * overhang
lidDepth = D + 2T + 2 * overhang
The lip strips sit inside the box footprint and are reduced by clearance.
Divider positions are evenly distributed across the inside box span.
For N dividers:
position(i) = length * i / (N + 1)
Front-back dividers:
- span the inside depth
- stand vertically
- are placed across the width
Left-right dividers:
- span the inside width
- stand vertically
- are placed across the depth
When enabled, crossing dividers receive half-depth slots.
Slot width:
slotWidth = materialThickness + effectiveKerf
Slot depth is approximately half the divider height.
The goal is to let divider panels slide into each other in a grid.
Features are normalized against the selected panel.
Each feature has:
- stable id
- type
- panel name
- local x/y position
- shape dimensions
- operation
- warnings
Feature coordinates are clamped so the shape remains inside the panel bounding area.
Validation runs after panel layout and feature normalization. This matters because the validator uses final dimensions, clamped finger width, effective kerf, generated add-ons, and actual feature positions.
The validator returns issue objects:
{
severity: "warning",
code: "feature-overlap",
message: "Cut features on front overlap or leave less than 0.15 mm between cuts.",
panel: "front",
featureId: "hole-a",
relatedFeatureId: "hole-b"
}Validation results are:
- shown in the production summary
- included in
buildSvg()results - embedded in exported SVG metadata
- covered by geometry tests
Panel polygons are generated in local coordinates, then placed onto the sheet layout with a row-based layout engine.
Each laid-out panel receives:
- translated polygon points
- bounds
- origin
- label location
The same normalized panel list drives SVG export and feature hit testing.
Each panel receives a 3D placement basis:
- center
- right axis
- up axis
- outward axis
The Three.js preview extrudes the 2D panel polygon by material thickness and applies the placement matrix.
- no full polygon boolean engine
- no full contour offsetting
- no dogbone generation
- no DXF output
- no automatic nesting
- no collision detection between arbitrary features and finger joints