Skip to content

VOXEDIT: add 3D print preparation pipeline (faceclassify, fillholes, flatbase, thicken, regrid) - #868

Open
Tudi wants to merge 1 commit into
vengi-voxel:masterfrom
Tudi:bundle/3dprint
Open

VOXEDIT: add 3D print preparation pipeline (faceclassify, fillholes, flatbase, thicken, regrid)#868
Tudi wants to merge 1 commit into
vengi-voxel:masterfrom
Tudi:bundle/3dprint

Conversation

@Tudi

@Tudi Tudi commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Adds a self-contained 3D-print preparation pipeline under voxedit-util/3dprint, exposed through a single 3dprint <subcommand> console command and wired into SceneManager via command registration.

Subcommands

  • faceclassify - classify and recolor voxels by surface role: outer surface, inner cavity surface, thin wall, buried interior.
  • fillholes - wall-walking chunked hole fill that seals cavities so the model is watertight/printable.
  • thicken - add a 1-voxel interior wall layer (run after fillholes; rerun for thicker walls; run before erode).
  • erode - hollow the model, keeping only exterior-facing voxels.
  • flatbase - voxel-perfect flat min-Y base plane across the bottom nodes.
  • regrid - rebucket all model nodes into world-aligned cellSize^3 cells, applied through SceneManager::onRegridComplete which updates the renderer and marks dirty without per-node O(N^2) transform updates.
  • Plus diagnostics: holemap, debugfrontier, recolor.

Implementation notes

  • FaceClassify builds a coarse exterior/interior shell (flood from outside), then refines it to finer cell sizes; an auto-fallback halves the coarse cell size for non-regridded (single-node) models so a sealed cavity can still be detected.
  • Progress provides lightweight progress reporting shared by the passes.
  • PrintCommands registers the user-facing command; hooked in from SceneManager::construct via printing::registerCommands(this).
  • The only SceneManager additions are the command-registration hook and onRegridComplete; the rest is isolated under 3dprint/.

Tests

  • 8 RegridTest cases (cell assignment, boundary spanning, overlapping sources last-wins, world-position preservation, deletion).

Built against the release tree; the fill/classify/thicken passes were validated manually on real gothic-style models.

@Tudi

Tudi commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Command list :
3dprint regrid 128
3dprint recolor 8355711
3dprint flatbase
3dprint faceclassify
3dprint debugfrontier
3dprint holemap
3dprint fillholes
3dprint erode
3dprint thicken
These commands were tested on model with 200 million voxels ... 5000 scene nodes ... Not an everyday test.
The main reason is to make a vengi model 3D printable. Most important one is to make a model manifold ( no holes but empty + have thick walls ( but not too thick ) )
All commands are destructive and non revertible.

In this image the green voxels are the ones that got added to fill in holes automatically
image

This image is for thicken. Adds interior layers to make walls thicker to avoid them getting marked as thin walls and removed by some 3D printers
image

This image is mostly for debug purpuses, it analyses the walls of the model and recolors voxels to see visually what is what
image

@Tudi
Tudi force-pushed the bundle/3dprint branch 2 times, most recently from 8149667 to 0c7213d Compare June 4, 2026 20:03
…icken, regrid)

Adds a self-contained 3D-print preparation pipeline under
voxedit-util/3dprint, wired into SceneManager via command registration.

- FaceClassify: outer/inner/thin/buried surface voxel classification and
  the wall-walking chunked hole-fill (fillholes) and interior-wall
  thicken passes used to make a model watertight and printable.
- FlatBase: voxel-perfect flat min-Y base plane across the bottom nodes.
- Regrid: bulk re-cellation of the scene into a uniform grid, applied
  through SceneManager::onRegridComplete which updates the renderer and
  marks dirty without per-node O(N^2) transform updates.
- Progress: lightweight progress reporting shared by the passes.
- PrintCommands: registers the user-facing commands; hooked in from
  SceneManager::construct via printing::registerCommands(this).

Tests: 8 RegridTest cases (cell assignment, boundary spanning,
overlapping sources, world-position preservation, deletion).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Tudi
Tudi force-pushed the bundle/3dprint branch from 0c7213d to 978f00b Compare June 4, 2026 20:28
@mgerhardy

Copy link
Copy Markdown
Collaborator

this takes a lot more time to review - but i am on vacations for some time now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants