docs/kitbash.md: ribs as built in h2, and what a ribs call costs and why

The standoff along the plate's normal, the band and its clipping at a crease, the plate
window, a negative Solidify, and that Solidify's even thickness is not even where faces
meet at unequal angles. reeval-per-call: one whole evaluation of the cage a call stays.
Measured on the pod: hiding the shell modifiers tags the cage (1.36 s); a temporary copy
without them links and evaluates in 0.001 s, but deleting any datablock makes Blender 5.3
evaluate the cage again (1.44 to 1.54 s), and the hole cut's temporaries must be deleted.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-12-02 08:47:12 +01:00
commit 585ece4e4d

View file

@ -376,7 +376,10 @@ all the same, and is cut.
takes planes in the cage's own frame and makes, as one mesh object under the cage:
- a rib along each plane's section of the cage's surface: `thickness` across the plane, set `standoff` behind
the plate's inner face and reaching `depth` further in;
the plate's inner face and reaching `depth` further in. `standoff` is measured along the plate's own normal:
where the plate leans out of the rib's plane, the rib is set further back along the plane (the plate's
thickness and the standoff over the cosine of the lean, and what half the rib's thickness needs on the side the
plate leans over), so that no part of the rib comes nearer the inner face than `standoff`;
- lightening holes through each rib every `holes` of its length (radius 0.3 of `depth`; 0 for none);
- posts every `posts` that stand the plate off the rib: a rod from the middle of the plate into the rib, and a pad
on the plate's inner face (0 for none);
@ -385,25 +388,35 @@ takes planes in the cage's own frame and makes, as one mesh object under the cag
longeron runs through the stations in the planes' order and 0.12 of the end gaps past the end ribs, a section
`longeron` (`I`, `C`, `T`, `L` or `box`; `longeron_w`, `longeron_h`, `longeron_t`) with its up toward the plate.
Ribs, posts and longerons are one sweep of an outline along a path with mitred corners (`core.sweep`).
A rib is a band beside its section (`core.band`): the section offset twice in its plane, with mitred corners,
and clipped as a polygon offset is. Inside a turn tighter than the rib reaches (the corner of a creased shell, a
facet shorter than its two corners set the rib back) the rib's edges cut the corner and the rib follows the
crease; the cut is a chord between points `step` apart, so it leaves out less than a `step` of the true corner.
Lightening holes stand on the band's centre line, clipped the same way, so a hole (0.3 of `depth`) keeps 0.2 of
`depth` of web on both sides; a post that would end outside the rib inside such a turn is left out. Posts and
longerons are a sweep of an outline along a path with mitred corners (`core.sweep`).
The cage is read twice. Evaluated with its Solidify, Bevel and Boolean modifiers off it is the surface as
designed: each plane cuts that surface into sections, and a section may be several chains (two legs in one cage).
Evaluated whole it is the plate as it is cut: at points `step` apart along a section, a ray from just outside the
plate's outer face asks whether the plate is there. Where it is not, the plate is open. An opening shorter than
plate's outer face asks whether the plate is there, looking 1.25 of the plate's thickness deep: a recess
shallower than the plate is plate, and the far wall of a narrow cage is not. Where it is not, the plate is open. An opening shorter than
`bridge` along the section is a panel break, and the rib runs behind it; at any other the rib stops `clearance`
short, and no post or hole stands there. A recess that does not go through is plate. `ribs` reads no cutter: cut
the cage first, in any way, and the ribs follow what the plate became.
The plate's thickness and which way it grows are read from the cage's one Solidify (a cage with none has a plate
of no thickness; one with two is refused). Inward is the side the cage's normals face away from, not a guess from
of no thickness; one with two is refused; a negative thickness is the same plate grown to the other side of the
surface, and is read so). The plate is taken to be that thick along its normal everywhere. Solidify's even
thickness is not, where a vertex's faces meet at unequal angles: a wall of 0.06 on a box whose sides lean 45 and
20 degrees is 0.057 and 0.066 thick, and the standoff there is off by as much. Inward is the side the cage's normals face away from, not a guess from
the section's shape: a cage whose normals change sides along a section is refused, and one whose normals all
face inward gets its frame outside. A rib is swept through the section's own corners, so its faces lie the
standoff from the cage's facets, and an end that would fold over the corner beside it ends at that corner.
face inward gets its frame outside. A rib is built at the section's own corners, so its faces lie along the
cage's facets, and it does not depend on which way round the section was followed.
Everything is checked before the ribs object is written, and a refusal names the plane or longeron: a plane that
misses the cage or lies along its surface; a section that turns tighter than the rib reaches in, so that the rib
would fold (lower `standoff` or `depth`); a longeron that meets a plane's ribs twice, not at all, or in an opening;
misses the cage or lies along its surface; a section that leaves a rib no room, closing in on itself nearer than
the rib reaches everywhere (lower `standoff` or `depth`); a longeron that meets a plane's ribs twice, not at all, or in an opening;
holes that overlap or leave the rib; a cage that is scaled or that Blender does not evaluate; more than 64 planes or
16 longerons.
@ -415,10 +428,18 @@ the holes' own. Manifold is used here and nowhere else because these shells are
live Booleans stay Exact.
On a pod (2560 faces subdivided, a wall of 0.06, a port, a panel break and a recess; one whole evaluation
1.35 s), five ribs with 93 holes, 51 posts and four longerons took 1.60 s and the five ribs alone
1.44 s, medians of 3 interleaved with that evaluation (Blender 5.3 on Starfire). Each figure holds one whole
evaluation of the cage, which Blender makes after any action that touched it (`ribs` shows the cage's modifiers
again when it is done); the rest, 0.25 s and 0.09 s, is the action's own work.
1.36 s), five ribs with 91 holes, 51 posts and four longerons took 1.70 s and the five ribs alone
1.51 s, medians of 3 interleaved with that evaluation (Blender 5.3 on Starfire). The hole cut is the Manifold
Boolean: 0.017 s a call for those holes against 0.44 s with Exact, 26 times.
Each call costs one whole evaluation of the cage, which scales with the cage's Exact Booleans: the action's own
work is the rest, 0.34 s and 0.15 s here. No cheaper route was found in Blender 5.3. The designed surface is read by hiding the cage's
Solidify, Bevel and Boolean modifiers for the call, which tags the cage, and Blender evaluates it whole again
afterwards. Reading the surface from a temporary copy without those modifiers costs 0.001 s to link and
evaluate, but deleting the copy costs the same whole evaluation (1.44 to 1.54 s on the pod against 1.45 to
1.52 s forced): Blender 5.3 evaluates the cage again after any datablock is deleted, a bare unlinked object
included, and the hole cut's temporary objects must be deleted too. So a hull with twenty cutters pays their
evaluation once for every `ribs` call; iterate planes on the cage before it is cut, or with its Booleans off.
## Expressions
@ -452,7 +473,7 @@ vertices overflow.
| `brokkr_kitbash.cut` | `object_name` (any mesh), `cutter_name`, `part` (`box`, `cyl`, `slot`, `slab`), `params`, `origin_x/y/z`, `direction_x/y/z`, `up_x/y/z` (default 0, 0, 1), `roll` (degrees, default 0), `axis_x/y/z` (default 0, 0, 0: the surface normal) | Places a `cutters` part where the ray meets the target, parented to it, and adds it to the target's difference Boolean. Refuses a ray that misses or has no direction, a name an object has, an `up` along the cutter's axis, an `axis` into the surface and a scaled target. Reports `object`, the `cutter` with its floor sockets, and `booleans` (with `booleansOmitted`, as `boolean`). |
| `brokkr_kitbash.cut_many` | `object_name` (any mesh), `cuts` (a JSON array of 1 to 64 cutters) | `cut` for several cutters in one action: all placed or none, one evaluation of the target afterwards. Reports `object`, `cutters` (names) and `booleans` (with `booleansOmitted`, as `boolean`). |
| `brokkr_kitbash.apply` | `object_name` | Bakes the evaluated mesh into the kit part and clears its modifiers and the collections its Booleans held. Refuses a part with no modifiers, a mesh another object shares and a part Blender does not evaluate. Reports the part, `faces`, `volume`, `nonManifoldEdges` and the `cutters` it no longer refers to. |
| `brokkr_kitbash.ribs` | `object_name` (the cage), `ribs_name`, `planes` (a JSON array of 1 to 64 `{origin, normal}`), `standoff`, `depth`, `thickness`, `step`, `holes`, `posts`, `post_r`, `bridge`, `clearance`, `longerons` (a JSON array of 0 to 16 `{origin, axis, toward}`), `longeron`, `longeron_w`, `longeron_h`, `longeron_t` | Derives ribs, lightening holes, posts and longerons from the cage as it is cut, as one mesh object under it. Refuses before it writes anything, naming the plane or longeron. Reports `object`, `ribs`, `thickness`, `sections: [{plane, chains, pieces, length, open}]`, `posts`, `holes`, `longerons: [{index, stations}]` (trimmed to a receipt, with `longeronsOmitted`), `faces`, `volume` and `nonManifoldEdges`. |
| `brokkr_kitbash.ribs` | `object_name` (the cage), `ribs_name`, `planes` (a JSON array of 1 to 64 `{origin, normal}`, up to 16000 characters), `standoff`, `depth`, `thickness`, `step`, `holes`, `posts`, `post_r`, `bridge`, `clearance`, `longerons` (a JSON array of 0 to 16 `{origin, axis, toward}`, up to 8000 characters), `longeron`, `longeron_w`, `longeron_h`, `longeron_t` | Derives ribs, lightening holes, posts and longerons from the cage as it is cut, as one mesh object under it. Refuses before it writes anything, naming the plane or longeron. Reports `object`, `ribs`, `thickness`, `sections: [{plane, chains, pieces, length, open}]`, `posts`, `holes`, `longerons: [{index, stations}]` (trimmed to a receipt, with `longeronsOmitted`), `faces`, `volume` and `nonManifoldEdges`. |
`params` is `name=value; name=value`; a param left out takes the part's default (`place_part`) or keeps its stored
value (`set_params`). A value outside its bounds is refused with the bounds in the message.