Converting voxel data to supported 3D format

Discussion in 'Software and Applications' started by dspwhite, Jan 27, 2010.

  1. dspwhite
    dspwhite New Member
    I have 2000 PNGs, each at 2000x2000 pixel resolution. Combined, they produce an 8 billion voxel data set.

    I understand that Shapeways supports the following formats:
    .stl, .dae, .x3d, .x3db, wrl, and x3dv.

    Is there any way to easily convert aforementioned PNGs to one of the above formats to allow 3D prints?

    If there's a more 'standard' voxel format, then I would be prepared to write my own software to convert the PNGs to that format as a part of a 2-step conversion process. But obviously I would prefer the voxel format specification to be pretty simple to make this easier.

    Any ideas?
  2. virtox
    virtox Active Member Moderator
    What is your data source / what kind of object are we talking about ?

    Usually voxel data needs to be translated to a polygons to be an object as in itself it is a 3d image and not a surface.
    Using an implicit surface modeller with a threshold at the desired value should produce a closed surface that is printable.

    You could render a point set/cloud from the voxel values (above threshold -> point, otherwise not)
    Then you could use meshlab to generate a surface using marching cubes. Matlab also has plenty of functions for this.

    If you have a low resolution version and need any help just post it here. I use custom software for implicit surfaces.

    Edit :

    I thought your nick was familiar ! You're the mandelbulb guy, right ? ;) (I occasionally drop by on fractalforums)
    I guess you are after the mandel variants ? I myself had not much luck yet.

    I did manage some rudimentary quat-julias :

    But for the mandelbrots, producing anything in high-res, resulted in non-manifold objects with polygons over the 500.000 limit.
    Which would then need a lot of repairing.
    I got some simple mandel-eggs from low-itercounts, but nothing worth printing yet.
    But I didn't try the white formulas yet ;)

    Last edited: Jan 27, 2010
  3. dspwhite
    dspwhite New Member
    Hi thanks for your reply! I've searched the net, and it would seem programs to do this kind of thing are very few and far between.

    The data source is a bunch of PNGs (I wrote the program to output PNGs, it would not be trivial to output anything else). But the object itself is probably not the easiest thing in the world to convert due to its fractal-like nature. Here's a picture: mall.jpg

    By default, the inside is solid, so that would probably need hollowing out to save on material costs. How much though would be tricky to decide because of the complexity of the shape.

    I'm guessing that the thickness matters less with the tiny bits on the surface but matters more at parts which hold up more 'bulk'.

    All things considered (including the 2000*2000*2000 resolution), would Meshlab or Matlab be more appropriate do you think?
  4. virtox
    virtox Active Member Moderator
    Sorry, was still adding a whole bunch of text to my first post ;)

    Uhm, it's been a while since I used matlab, and that was for low-res mri data, so not sure how it will handle 8 billion voxels.

    Meshlab has trouble loading my 4 million polygon vrmls, so not sure how that would handle billion points :-S

    Best bet is probably downsampled data and meshlab as that is free ;)

    As to shelling, that is where I ran into the most problems.
    I used lower iter-renders as shells at first, but you always end up with very thick and very thin portions.

    Fractals are a real pain capture in real life.

    Last edited: Jan 27, 2010
  5. dspwhite
    dspwhite New Member
    Lol, word spread pretty far by the looks of it :D

    I take it that 500,000 triangles would be enough in theory, given a decent conversion? I hear that Shapeways are going to support 2,000,000 soon. I'm almost tempted to take up the challenge and write some kind of software to do it manually (what would be the simplest specification out of that 3D object list?).

    Someone who posted over at Fractalforums has also managed to make a 3D print, though he had to use his own marching cubes algorithm. Good results though.

    Haha, I can only imagine! Only the Menger sponge would be more of a nightmare - probably need carbon-fibre or stronger for that ;)

    I suppose one technique would be to always allow any voxel to contain x amount of surrounding voxels if possible. This would always maintain a minimum thickness for the hull while still allowing minute details at the edges.

    It's funny, I bet the 3D printer machine converts the mesh back to voxels for printing! The irony...
    Last edited: Jan 27, 2010
  6. virtox
    virtox Active Member Moderator
    That would be me, I think, small world ;)
    See the first reply for images.

    As to polygon count If you are able to optimize the mesh without destroying the detail, 500.000 should be enough, but I had lot's of trouble there also. Marching cubes is not the best algorithm for fractals.

    I think mesh refinement based on distance estimators would produce the best result. So for each escape count, generate a mesh shell, from each vertex project toward the next escape count and refine.
    But I stuck with the marching cubes for now.

    As to menger sponges, there are plenty in the shops here :)

    Last edited: Jan 27, 2010
  7. dspwhite
    dspwhite New Member
    Lol, that's pretty hilarious actually. The odds of that happening seem super high at first, and yet somewhat lower once you think about it :)

    Aha, you're right, though it's only level 4. I only want level 6 heh. Actually, I suppose some of the Juliabulb variants will be the most daunting to render, since they have the mandelbulb-style complexity, but with (often) a very thin frame. E.g. see this amazing picture by Paul Nylander:

    Nice Julia objects btw! Is that some kind of glass material in one of them - looks ace.
    Last edited: Jan 27, 2010
  8. crsdfr
    crsdfr New Member
    Have you tried any of the MRI/CT Scan 3D rendering software?

    I have Mimics and 3D Doctor here if you want me to give it a shot. Just attatch a few of the PNG's in order and I'll see if I can make it work.
  9. nBones
    nBones New Member

    Hey there.

    dspwhite, you can do this job with a software called "Isosurf" which implements several algorithms to take image slices from a 3D model to recreate a 3D model to regularised marching tetrahedra's. The mesh output is "off" or "wrl". Usually some interpolation operations on this and you get out a smooth model. Meshlab eats this output to convert it to binary-"stl".

    Would like to see some real 3D mandelbulbs here soon. ;)

    Last edited: Jan 27, 2010
  10. dspwhite
    dspwhite New Member
    Thanks! Worth a shot I guess - here's almost 200 PNG frames (400k). Extract zip to a new folder:

    ...and if instead you're feeling more adventurous, this is 1/4 of the whole thing, though it's 6 meg:

    nBones, that 2-step Isosurf technique sounds interesting too - cheers - I'll take a look :)