Ivory Siege Tower

mobile construct built of thoughts and parentheses

Experimenting with MagicaCSG Exporting to Blender

[2024-08-30]

3d_modeling blender magicacsg st_lounge st_post

Got some inspiration to toy with MagicaCSG and its export option.

First there was a rather simple model of a tokamak device (with negative triangularity plasma!).

It renders Okay in the built-in renderer. The export from the MagicaCSG Beta Version 0.4.5 is still in .PLY point cloud.

The main problem with MagicaCSG export is the size of the model. My tokamak with cross-section resulted in 48.9 Mb file with 1018696 (>1M) vertices and 509960 (>500K) triangles!

Straightforward solution: import the object to Blender and process the mesh there.

I've used Blender for re-meshing the models for 3d-printing. But for quick sharing I want decimate the mesh preserving the vertex colors of the .PLY.

A quick instruction can be found e.g. on Reddit - mind the comments, they help to solve another problem.

By the way, before exporting from MagicaCSG one should adjust the resolution via increase/decrease buttons.

I recommend decreasing it until the result still looks Ok, with the next step already being eye-watering. It will reduce the load on Blender from hours to seconds of processing time.

Decimation in Blender shows yet another problem: the polygons of the MagicaCSG model start to separate with holes appearing in between them.

This is best demonstrated by using Un-Subdivide, where I have like every second triangle missing.

Besides, it's still over 600K vertices and over 150K triangles...

The answer, as is hinted on Reddit, is in a lot of polygons in the MagicaCSG export being disconnected.

Fixing that can be done by processing the meshi in the Edit mode.

Result of Mesh->Cleanup->Degenerate_Dissolve:

Removed: 3736 vertices, 7116 edges, 3380 faces

Result of Mesh->Cleanup->Merge_by_Distance:

Removed 761976 vertices

The decimation then goes well, preserving the vertex colors but leaving no holes in the model!

And the file size is reduced to 748KB, with 18K vertices and 36.7K triangles.

Now I'm ready to embed the model. Using the Online 3D Viewer script to post it on my Org-Roam Wiki Slice. Behold:



Social Timeline: