[Maths/3D] How do I thicken my surface ?

Discussion in 'Technologies and Hardware' started by ttoinou, Jan 4, 2013.

  1. ttoinou
    ttoinou New Member
    Hi all,

    I'm generating a fractal shape in C# to a binary STL file. This surface is made of triangles and is not watertight since it is only a surface withouth a volume inside.
    How do I create the "other" parallel surface (the distance between the two surfaces being a variable D) so that I can build my object ?

    I've tried to loop all triangles, and create another triangle made of the first triangle translated by D in the direction of the unit normal vector of the triangle. But that doesn't do the suff...

    Thanks in advance.
    Last edited: Jan 5, 2013
    JACANT Well-Known Member
    The easiest way is to import it into Blender http://www.blender.org/download/get-blender/ Then use a solidify modifier while in 'object mode'. Or when in 'edit mode' pick face, in 'mesh' - 'extrude individual' to the thickness you want, export to STL.
  3. ttoinou
    ttoinou New Member
    Okay thank you I'll try to become familiar with Blender.
    Since I made this fractal from scratch I would like to know the Algorithm for it.. that would be interesting I think :) !

    It works with Solidify !
    Last edited: Jan 5, 2013
  4. stonysmith
    stonysmith Well-Known Member Moderator
    You didn't set the model to public so that we could see it.

    One answer to your request is to lookup the "Ball Pivoting Algorithm", one paper on it is here: http://www.research.ibm.com/vistechnology/pdf/bpa_tvcg.pdf

    The other answer: (non-programmers stop reading here!)

    You can't do the entire surface in a single step. You must treat each triangle separately. For every triangle you have currently, it must become a solid with "thickness", rather than a single surface. Then, add all the solids together using Constructive Solid Geometry (CSG). May I suggest you spend some time with Openscad? It has CSG algorithims it uses, and the source is freely available.

    For every triangle:
    -Compute the surface normal to your triangle.
    -Add a new triangle A,B,C some delta distance away from the original (half of the desired thickness) along the positive surface normal.
    -Add a new triangle with the opposite "winding order" (C,B,A) offset in the negative surface normal direction. We'll call this triangle D,E,F
    ---This gives you the two "plates" (top and bottom) for the new solid.
    -Now, work around the edges of the plates, filling in the "side" triangles: (A,B,D) and (D,B,E) and so forth.
    -Each final solid will be made up of 8 triangles instead of just one.
    Once all the new solids have been generated, use CSG-union to combine all them into a single solid.

    Hint: if you produce all the separate solids into a single STL, then Netfabb-Cloud has a free service to union them all together.

    Last edited: Jan 5, 2013
  5. Fredd
    Fredd New Member
    Sorry tt. I have a bad habit of including improperly facing normals with nonmanifold objects. For solidify make sure all normals are oriented correctly and scale has been applied to the mesh in object mode.

    Oh my poor brain!!(Should have listened to Stoneys warning.)
  6. ttoinou
    ttoinou New Member
    Thank you for your answers !
    Okay I understand. I tried just to create the parallela triangle with the normal unit vector but it looked awful. Maybe the normal unit vector wasn't directed outside or inside uniformly...
    "and so forth." = I create ADC and CDF ?
    But could I only create the other parallela surface AND then fill the "rim" ?
    8 triangles is for thickening a wire, and I would say 4 triangles only are really useful if thickening a surface.
    Thanks for the BPA paper that seems to be interesting.

    Here is what I've done thanks to Blender solidify : http://www.shapeways.com/model/857223/developing-koch-snowfl ake-with-holes-bigger.html (but then here I would need 8 triangles because there is holes).
    JACANT Well-Known Member
    Intriguing Model. Although the file uploaded OK to Shapeways, it can not be printed. It will be rejected if you try to order it. The walls are too thin. Take a look at the materials available with the 'Design Guidelines' especially the minimum 'wire' sizes The screen shot is from Netfabb http://www.netfabb.com/basic.php You can check, repair, scale and measure your model.

  8. ttoinou
    ttoinou New Member
    Hi Jacant, thank you for noticing the fact that walls were too thin. I've finally managed to create two printable (and printed ! :) ) models :

    For the surface thickening algorithm I realized I misunderstood what you were saying stonysmith...
    My algorithm doesn't work at all..