1

I want to create a software that import, edit and export ASCII STL files (CAD file). Let me explain what I need and so what I mean as editing an STL file. I want to use an example. Consider the following STL file:

 solid my_created_solid
   facet normal 1.217327e-001 -6.162551e-002 -9.906480e-001
      outer loop
         vertex 9.211285e-002 8.592563e-002 1.910523e-001
         vertex 9.977442e-002 8.592563e-002 1.921054e-001
         vertex 9.954187e-002 8.500294e-002 1.921164e-001
      endloop
   endfacet
   facet normal 1.519745e-001 -3.081203e-002 -9.879041e-001
      outer loop
         vertex 9.954187e-002 8.500294e-002 1.921164e-001
         vertex 9.210512e-002 8.500294e-002 1.910942e-001
         vertex 9.211285e-002 8.592563e-002 1.910523e-001
      endloop
   endfacet
endsolid

If you know the structure of a STL file, in this specific case, it is composed of two triangles (2 lists of points) and their relative normals. What I need is a GUI that let me pick some specific triangles and create a file like this:

 solid I_part
   facet normal 1.217327e-001 -6.162551e-002 -9.906480e-001
      outer loop
         vertex 9.211285e-002 8.592563e-002 1.910523e-001
         vertex 9.977442e-002 8.592563e-002 1.921054e-001
         vertex 9.954187e-002 8.500294e-002 1.921164e-001
      endloop
   endfacet
endsolid

solid II_part
   facet normal 1.519745e-001 -3.081203e-002 -9.879041e-001
      outer loop
         vertex 9.954187e-002 8.500294e-002 1.921164e-001
         vertex 9.210512e-002 8.500294e-002 1.910942e-001
         vertex 9.211285e-002 8.592563e-002 1.910523e-001
      endloop
   endfacet
endsolid

Practically I need to select the triangles to put in I_part and those in II_part by mouse clicking.
To do that I think I need a GUI with classic zoom, rotate, pan, etc. commands, the commands to select triangles to put in a specific part (e.g. II_part) and then the possibility to split the structure of the file in the manner I explained. When you have few triangles, that is a small stl file, it's easy to do it by hand with a text editor. But the problem rises when I have a very huge STL file, with milions of triangles.
Obviuosly I'm only talking about ASCII STL files.

I've looked around for some libraries to do that, and I found just MeshLab and OpenGL, but nothing specific about that.

I need some suggestions to reach the goal easily and quickily. I don't want to be stuck in some long and difficult coding process. But I can code in C++, Python and Matlab.

What do you suggest me? Does something similar already exist in some library? What about Js, or Processing, or Matlab? How to develop that?

I'd like to do that with Processing and to put this tool on a webpage. Which open libraries in Processing give the possibility to do that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.