1 Commits

Author SHA1 Message Date
superGeometry 337c802689 Engine review: memory given back, meshes come in as solids, sweeps that say why
Memory. The kernel build frees nothing when most of its things are deleted
(one do-nothing function stands in for their destructors): a deleted handle
still counted as a user of its shape, so no body the engine made was ever
freed, and each tool kept what it had worked out. Now each is told to let go
before it is deleted (release.ts): shape handles emptied, explorers pointed
at nothing, booleans cleared and given a last tiny job so they drop their
bodies. The validity check, which left over half a megabyte behind per check
of a 35-face part, is pointed at nothing before it goes. A body's copy is
written out and read back (the kernel's copier keeps both bodies for good).
Rebuilding a hole 1500 times took the engine from 100 MB to 595 MB, now to
199 MB; a face pushed on a 44-face plate 400 times, 1871 MB, now 811 MB; a
shell on it 200 times broke the engine, now it doesn't.

Meshing. A body is meshed a few hundred faces at a time (meshing.ts): the
kernel's mesher kept working notes on every face and edge at once - a body
of 4 500 faces took 1.3 GB, one of 40 000 the 4 GB a browser allows. Same
triangles, same order. STL is written from that mesh, of a copy of the body
(the print mesh no longer stays on the model). A face's own triangles are
made for that face alone, not by meshing its whole body.

STL and 3MF meshes in. A closed mesh comes in as one solid, its flat
triangles merged (the reader hands back loose triangles; every file came in
as loose faces until Repaired, a 12-triangle block too). A binary file is
told from a text one by its length (a blank heading and round sizes made the
reader take it for text: a 10 mm cube out of a 3MF couldn't be read). Up to
250 000 triangles; more is refused at once with the count (it used to run
the engine out of memory). A broken-down engine is no longer taken for an
unreadable file.

Sweep. Facing the same way along a path that runs in the profile's own
plane never returned; a profile that changes size or turns left a sweep in
pieces at a sharp corner: both refused in words. Joins and cuts made by a
step go through one checked boolean. An unknown mode is a damaged step, not
a step that does nothing.

Tests: gridloft (340), gridio (51: up to a face or plane, STEP and STL out
and back, meshes in, split by a body, copies, memory over 400 rebuilds).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 12:59:39 +02:00