Repair for printing (joins loose corners, drops empty and doubled faces and inside walls, turns faces out, closes holes): a button in Print and a command; joining points by a grid (an imported STL's 100k corners: milliseconds, not minutes); tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nexoniarz 2026-10-21 07:34:47 +02:00
commit f5d1b79756
5 changed files with 159 additions and 7 deletions

View file

@ -178,6 +178,14 @@ bool overhangs(const Mesh& m, int face, float overhang, float bedZ);
int closeHoles(Mesh& m);
// Turns faces so each piece's all face the same way, outwards; how many were turned.
int faceOutward(Mesh& m);
// Made ready to print, as far as it can be without guessing: points in the same place joined (an
// STL's corners come apart), faces with no area gone, faces there twice once (back to back: both
// gone, an inside wall), faces turned the same way, holes closed. What it did.
struct Repair {
int joinedPoints = 0, emptyFaces = 0, doubledFaces = 0, turnedFaces = 0, closedHoles = 0;
int total() const { return joinedPoints + emptyFaces + doubledFaces + turnedFaces + closedHoles; }
};
Repair repairForPrint(Mesh& m);
// ── Its picture's layout ──