Creating stl files

Submitted by ullassssss on Fri, 12/18/2015 - 06:05

Hi, How can i create surface files in stl format so that it can be opened in paraview

richti83's picture

richti83 | Fri, 12/18/2015 - 08:08

There are more than one ways, my prefered workflow is to draw the geometry in any CAD programm, export it as step file and meshing it with netgen.
(this is how to have more control over the triangle-size, I usually use max-elementsize=min-elementsize+1 to have equilateral tris, bc. most cad programms produces triangles with a high aspect ratio which is bad for parallelisation and leads to curvature errors in wall-contact-modell)
Another way is to use paraview sources (plane, circle, cylinder ..) and to export them as vtk file (bc. the save as stl file export function in PV is totaly crap) and than use gmesh

gmsh -2 -o outfile.stl infile.vtk

to remesh it as nice stl.

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

ullassssss | Tue, 12/29/2015 - 06:28

How can i create surface models in stl format using Pro E? I tried to create one, but save as stl format is not showing under save a copy menu. Solid models can be saved as stl format in Pro E. Is there any converting tool to convert *.prt to *.stl ? Or is it possible to create surface models as stl files in other modelling softwares like Solid Works, AutoCAD 3D...?

richti83's picture

richti83 | Mon, 01/04/2016 - 18:32

Many 3D cad programs don't have the ability to save surface modells as STL (I know Autodesk Inventor can only save volumes as stl meshes). The "normal" (means not academic) Version of solidworks can save surface modells als STL. The problem is, that the resulting mesh is in bad quality for LIGGGHTS(R) (high aspect ratio, bad curvature -> bad to parallize). The best workflow is to save as STEP file (almost every 3d cad programm I know can export surfaces as step file) and than mesh it with netgen (with OCC enabled) and save as stl.

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

yirenxindudu | Mon, 01/21/2019 - 05:34

Thank you very much, you suggestion is rather helpful!
I used solidworks to export stl files to LIGGGHTS, the calculation is not good even the structure of model is very simple.
I'll try this method: solidworks>>STEP file>>netgen>>stl

ullassssss | Tue, 02/02/2016 - 07:05

@ richti83 Thank you sir installed netgen 4.9.13 in ubuntu 15.10 using the command
sudo apt-get install netgen
Installation completed without any issue. But i coudnt open Netgen. How can i open netgen?

ullassssss | Tue, 02/02/2016 - 07:36

dem@dem-desktop:~/netgen-5.3.1$ netgen
NETGEN-4.9.13
Developed at RWTH Aachen University, Germany
and Johannes Kepler University Linz, Austria
Including OpenCascade geometry kernel
Parsing ng.tcl
optfile ./ng.opt does not exist - using default values
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 155 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 533
Current serial number in output stream: 534

richti83's picture

richti83 | Tue, 02/02/2016 - 17:55

This seems to be related to graphic card driver / system libs / 32bit vs 64bit libraries .. google "X Error of failed request: BadValue (integer parameter out of range for operation)" to find some hints ..
I would compile netgen from source (which is pain with occ enabled, but possible (I did it under fedora))
Do you have a radeon or a NVIDIA GPU ? Is it netgen 4 or 5 ? (I'm asking bc. the path says 5.3.1 but the first stdout is 4.9.13 ? Maybe you mixed two versions ? (one by apt-get and one by download) and started the systemwide netgen from /usr/bin/ instead the executable from download directory ? Is it netgen x64 or i386 ?

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

ullassssss | Tue, 02/09/2016 - 06:21

I tried to install netgen in ubuntu. For windows it works without any issue. And I got the stl file. Thanks a lot for replying. I need 1 more help. I need to insert particles into the container i made in stl format (as servo wall). Can u send me the command for running it in liggghts. I tried the commands on tutorial but it doesnt work. A lot of error and warning messages are showing. Some may be due to the version change. Could u pls send me a working command in txt format