Advertisement

Make foldable tri mesh out of triangles

Started by June 01, 2021 06:48 AM
6 comments, last by JoeJ 3 years, 8 months ago

I have problem with exporting to another file formats that are understandable by 3d printing software, basically the thing is that my exported meshes are not foldable, i am searching for a low weight code that handles that: given set of triangles in array, output foldable set of triangle array.

For now i only have found cows with tons of code that are not easy convertable, any help would be apprecieated.

Does not sound like an easy problem, but what do you mean with ‘foldable’?

Advertisement

Triangles are ordered in that manner that they form sort of a unflodable mesh, so third party 3d platters know which area is solid,(in 3d)

Some kind of stl definition

The invention of the STL file format: exploiting tessellation to encode surface geometry

Back in 1987, Chuck Hull had just invented the first stereolithographic 3D printer, and The Albert Consulting Group for 3D Systems were trying to figure out a way to transfer information about 3D CAD models to the 3D printer. They realized that they could use tessellations of the 3D model’s surface to encode this information!

The basic idea was to tessellate the 2 dimensional outer surface of 3D models using tiny triangles (also called “facets”) and store information about the facets in a file.

Let’s look at a few examples to understand how this works. For example, if you have a simple 3D cube, this can be covered by 12 triangles, as shown in the image below. As you can see, there are two triangles per face. Since the cube has six faces, it adds up to 12 triangles.

If you have a 3D model of a sphere, then it can be covered by many small triangles, also shown in the same image.

Tessellations of a cube and a sphere

Tessellations of a cube and a sphere

Here is another example of a very complicated 3D shape which has been tessellated with triangles.

Tessellation of a 3D pig (source : i.materialize)

The Albert Consulting Group for 3D Systems realized that if they could store the information about these tiny triangles in a file, then this file could completely describe the surface of an arbitrary 3D model. This formed the basic idea behind the STL file format!

Now i guess foldable refers to consistent winding order, so for each face the printer knows which side points inwards / outwards?

AFAIK, assimp library can do this as an import filter, together with merging duplicated vertices (which is necessary to get both triangles sharing an edge, so winding can be checked at all).

I don't know what foldable means either. However there is the concept of “manifold” and "non-manifold" geometry. Perhaps it's something like that. I've heard 3D printers need manifold geometry which makes sense.

Yeah the term is mainfolding

Advertisement

Ok, that's what i have assumed at the start.

I also have a need to convert any mesh into manifolds / volumetric representations. And i do this using a method similar to this: https://www.dgp.toronto.edu/projects/fast-winding-numbers/​ to get a robust volume. The method robustly handles duplicated vertices, small holes, degenerate cases. If you're interested i can show implementation which is small and fits into a single post.
After that i use isosurface extraction get a surface mesh, finally remeshing to get a high quality mesh.
But the result is different from the input. Some details get lost. To preserve them, i need very high resolutions.
Also implementing all this is at least weeks, more likely months or even years of work, and parts of that should be handled already by the printing software.


I think what you want is mesh cleanup software. To close small holes, fix degenerate cases, etc. DCC tools have that build in usually, e.g. Blender i guess. Otherwise this should be helpful: https://www.meshlab.net/​ I think it's free and offers lots of geometry processing tools. For remeshing (if necessary) this is good: https://github.com/wjakob/instant-meshes

After some trial and error you should figure out a workflow to convert your stuff successfully i think.

This topic is closed to new replies.

Advertisement