[Gmsh] Modification of .stl file

Geordie McBain gdmcbain at freeshell.org
Thu Jun 25 05:54:28 CEST 2009


> 2009/6/15 Dimitrios Eftaxiopoulos <eftaxiop at central.ntua.gr>:
>> Hello,
>> I have an .stl (or .vtk or .vtp) closed surface file and I have successfully
>> meshed the volume of it, in a variety of ways, using gmsh. Now I want to
>> create circular cylindrical holes on it. To the best of my knowledge, this is
>> not possible in a straightforward manner, due to the limitations of
>> information included in the .stl file (just surface triangles). I tried to
>> drill a simple cube.stl surface using gmsh, at no success.
>>
>> Most probably I have to convert the .stl file to another cad file format, like
>> the open formats .iges, .step or .brep and open the holes on this file, using a
>> cad package. I have tried FreeCAD, but the conversion to .brep results in an
>> empty file.
>>
>> Can anyone suggest a way and a tool for modifying an .stl file?

Besides D. L.'s suggestions (I can confirm Blender will certainly do
the job), another way to do Boolean operations on StL surfaces is with
GTS <gts.sf.net>.  The GTS format is equivalent to the StL for
triangulated surfaces and comes with stl2gts and gts2stl converters.
It also has a "set" program for the operations you want.  Some time
ago I wrote an example of just what you wanted: how to drill a
circular-section hole through a solid defined by a triangulated
surface at http://gdmcbain.freeshell.org/fluids/gerris under the
heading `The GTS set tool'.  Hope this helps.