fins: fins.js is the entry point; map web/fins/ in its header

Step 5 (last) of splitting fins.js. The header described the M4 fin that
stood beside the part, which is gone; it now says what buildFins builds,
keeps the horizontal-tine rationale prop/config.js cites, and maps
web/fins/. buildFins's opts.mode doc says 'stabilize' is an old name for
'auto'. Comments and docs that named fins.js for code now in web/fins/
(PAD.style, buildPad, seatingOf, unservedAfterWedges, the Onshape port's
section notes) point at the module that owns it.

No code change.
This commit is contained in:
matthewtrahan authored and Matthew Trahan committed 2026-09-27 09:05:38 -05:00
1 parent 3ce3d72d28
commit 45e3a5ff9f
10 files changed
+31 -28

No files matched your search

+1 -1
View File
@@ -98,7 +98,7 @@ welts.
tined side fins (the Onshape port's; the web tool no longer builds them) are never
cut -- their tines anchor across the whole blade.
## Bed pad styles — `PAD.style` in `web/fins.js`
## Bed pad styles — `PAD.style` in `web/fins/pad.js`
The pad goes under a part whose bed contact is under `padMinArea` (60 mm²), which is
nearly every tilted part. **Printed, 2026-09-24:** a cube on its edge in **PETG** with
+1 -1
View File
@@ -80,7 +80,7 @@ change; re-run before believing it.
- `hub_post_foot` at 0/25/40 — the part has **0.0 mm² of bed contact at every
tilt from 0° to 165°**; it balances on the tip of its own tapered foot.
Nothing you add can hold it. `seatingOf()` in `fins.js` classifies this as
Nothing you add can hold it. `seatingOf()` in `fins/seating.js` classifies this as
`point` and the UI says so. Not a bug.
- `voron_drive_frame` at 0° — its only overhangs are two 25 mm² regions sitting
0.5 mm off the plate with a 5.1 mm span. Correctly not worth a wall.
+2 -1
View File
@@ -11,7 +11,8 @@ Repo: `~/projects/support-fins` (product **Support Fins**). The generation engin
is pure mesh math (no DOM/three.js), so it profiles and runs headless with Deno.
- `web/fins.js` — `buildFins()` entry; auto mode recurses to `mode:'prop'`, then
adds wedges (`buildPerpFins`) and the bed pad (`buildPad`).
adds wedges (`buildPerpFins`, `web/fins/wedges.js`) and the bed pad (`buildPad`,
`web/fins/pad.js`).
- `web/prop.js` — `buildProps()`, which drives the per-wall pipeline in `web/prop/`:
`splitRegion`/`patchTracks` (tracks.js), `sweep` (sweep.js),
`settleTop`/`contourTop`/`lowerSag` (contact.js), `stationIsClear`/`stationCertified`
+2 -2
View File
@@ -225,7 +225,7 @@ const FIN_WIDE_AREA = 1500 * millimeter ^ 2;
const FIN_ROW_PITCH = 55.0 * millimeter;
const FIN_ROW_MAX = 20;
// Bed pad -- web/fins.js buildPad
// Bed pad -- web/fins/pad.js buildPad
const PAD_MARGIN = 4.0 * millimeter; // grip spread past the contact
const PAD_MIN_AREA = 60.0 * millimeter ^ 2; // above this much bed contact no pad is needed
const PAD_SEGS = 48;
@@ -1856,7 +1856,7 @@ function buildFinAt(context is Context, fid is Id, env is map, s is map, win is
return { "ok" : true, "tines" : count };
}
// ─── Bed pad (web/fins.js buildPad) ───────────────────────────────────────────
// ─── Bed pad (web/fins/pad.js buildPad) ───────────────────────────────────────
/**
* A part tilted onto an edge has near-zero bed contact and peels before any fin
+1 -1
View File
@@ -1,7 +1,7 @@
// UNSERVED must count dropped overhangs, not hide them. buildFins used to report
// `unserved - wedged PATCHES`: a patch count off a region count (two different
// segmentations), so wedges under one region hid others that nothing supports.
// Credit is spatial now (fins.js unservedAfterWedges): a region is served when a
// Credit is spatial now (fins/wedges.js unservedAfterWedges): a region is served when a
// wall stands under it or a wedge vertex sits just under one of its faces.
import { loadModel, analyze, fins, assert, rotX, rotY } from './_util.js';
+19 -17
View File
@@ -1,14 +1,9 @@
/**
* Fin generation -- M4. The fin stands BESIDE the part on a flat upright face,
* held off by a standoff, and horizontal tines fuse across that gap into the
* part. See planes.js for why M3's sweep-under-the-overhang geometry had to be
* abandoned, and docs/FIN-SPEC.md for where every number below comes from.
*
* A fin is three kinds of solid that overlap and get unioned by the slicer -- no
* boolean kernel anywhere, the same approach the rest of the project uses:
* 1. the WALL, a thin round-topped blade standing off the part face;
* 2. the BASE, a wide flat ellipse that keeps the wall stuck to the plate;
* 3. the TINES, tiny horizontal nubs bridging the standoff into the part.
* Combined support -- the entry point the app, the Worker and the plugins call.
* `buildFins` builds the tined breakaway walls (prop.js) under the overhangs,
* adds angled wedges under the broad downward faces no wall reached, lays a bed
* pad under a part that barely touches the plate, and runs sway braces last.
* docs/FIN-SPEC.md is where every number comes from.
*
* The tines are the point. A wall with only a gap constrains the part in one
* direction and it falls away sideways -- Slant3D demos a cube doing exactly
@@ -21,10 +16,17 @@
* a retraction each. Horizontal tines also lie in the plane of the layer lines,
* which is what lets you BEND them to snap clean instead of tearing them out.
*
* Everything about the wall is built in the patch's frame (planes.js), so a fin
* serving a leaning face leans with it. The tines are the exception: they are
* built in world axes, because a tine must occupy ONE layer, and a box that is
* flat in a leaning frame is not flat in z.
* LAYOUT. This file is the entry point: `buildFins`, `buildFinsCore` (auto and
* prop), `applyTunables`, `coverPitch`, and re-exports of everything app.js,
* orient.js, finworker.js, ui/, the plugins and the tests import. The pieces
* live in web/fins/:
*
* config.js FIN, the tine, pad and coverage numbers the UI shares
* seating.js how the part sits on the plate: contact, face/edge/point
* pad.js PAD and the bed pad (conforming oval, or the brim-style one)
* wedges.js angled wedges where no wall reaches; gripPatches for Draw
*
* Each module imports only modules above it in this list and never fins.js.
*/
import { findWallPatches } from './planes.js';
import { buildProps, noProps, PROP } from './prop.js';
@@ -90,9 +92,9 @@ export function applyTunables(t) {
* Generate supports for the part in its current orientation.
*
* @param opts.mode 'prop' (the default: a vertical breakaway wall under
* each overhang), 'stabilize' (the Brace: a tined fin
* against toppling; docs/FIN-SPEC.md), or 'auto' (props for
* the overhangs PLUS bracing fins if the part would topple)
* each overhang, no tines) or 'auto' (tined walls PLUS
* wedges under the faces no wall reached). 'stabilize' is
* an old name for 'auto'; any other mode builds 'prop'.
* @param opts.bedPad add the pad when bed contact is too small to hold
*/
export function buildFins(topo, result, rot, opts = {}) {
+1 -1
View File
@@ -223,7 +223,7 @@
is exposed. Support gap = clearance between a support top and the part (bigger
= cleaner surface / easier to remove, too big = stops holding the overhang).
Bed pad = the pad under a part that barely touches the plate (PAD.style in
fins.js): Auto (default) picks Light, or Sure hold on a small foot, and
fins/pad.js): Auto (default) picks Light, or Sure hold on a small foot, and
its option text shows which. Light is one layer standing 0.12mm off the part, like a slicer
brim; Sure hold is the thicker pad tacked into the part; Custom exposes
every pad number and is the only style that shows them. -->
+2 -2
View File
@@ -220,8 +220,8 @@ export function refreshFins() {
// reply and the inline fallback. buildFins runs in BOTH modes: in Suggest it
// places the walls; in Draw it is called only for the bed pad + seating verdict
// (a tilted part rests on an edge and needs a pad however its walls are placed,
// and that logic lives in fins.js), so Draw ignores the suggested walls and shows
// the hand-drawn ones instead.
// and that logic lives in fins/pad.js + fins/seating.js), so Draw ignores the
// suggested walls and shows the hand-drawn ones instead.
function applyBuilt(built) {
finBusy = false;
clearSpinner();
+1 -1
View File
@@ -207,7 +207,7 @@ function updateDrawReadout(built, ms) {
/**
* The Light pad grips by first-layer squish along the part's first-layer outline.
* A part on a point or a small round foot has only a few mm of it, so fins.js
* A part on a point or a small round foot has only a few mm of it, so fins/pad.js
* builds Sure hold there instead (pad.autoSure) -- say so, since the user picked
* Light. A Custom pad with a gap on such a foot gets a warning instead of a swap.
*/
+1 -1
View File
@@ -55,7 +55,7 @@ el('fin-mode').addEventListener('change', (e) => {
setGizmo();
refreshFins();
});
// Bed pad style (PAD.style in fins.js). Only Custom shows the pad's numbers; the
// Bed pad style (PAD.style in fins/pad.js). Only Custom shows the pad's numbers; the
// presets keep theirs fixed (Sure hold's follow the material profile). Switching
// to Custom starts it from whichever preset was showing, so a tweak begins from
// numbers that are known to print rather than from blanks.