- Thank you received: 0
Loading and merging STL files using python script
5 years 9 months ago #1422
by spuri
Loading and merging STL files using python script was created by spuri
Hello,
Is it possible to do the following using a python script. I am able to do it using GUI.
1. load a binary STL file,
2. create a volume mesh,
3. merge similarly created multiple volume mesh.
Thanks for helping.
Saurabh
Is it possible to do the following using a python script. I am able to do it using GUI.
1. load a binary STL file,
2. create a volume mesh,
3. merge similarly created multiple volume mesh.
Thanks for helping.
Saurabh
5 years 9 months ago #1424
by joachim
Replied by joachim on topic Loading and merging STL files using python script
Hi Saurabh,
you can merge meshes with a little Python programming, here is a similar usecase:
ngsolve.org/docu/latest/i-tutorials/unit...e-dimensional-meshes
Joachim
you can merge meshes with a little Python programming, here is a similar usecase:
ngsolve.org/docu/latest/i-tutorials/unit...e-dimensional-meshes
Joachim
5 years 9 months ago #1426
by spuri
Replied by spuri on topic Loading and merging STL files using python script
Hello Joachim,
Thanks a lot for the quick response. I followed the link you suggested, however, I am getting following error during the creation of volume mesh.:
netgen.libngpy._meshing.NgException: Stop meshing since boundary mesh is overlapping
Could you please suggest a way to resolve this issue?
Thanks,
Saurabh
Thanks a lot for the quick response. I followed the link you suggested, however, I am getting following error during the creation of volume mesh.:
netgen.libngpy._meshing.NgException: Stop meshing since boundary mesh is overlapping
Could you please suggest a way to resolve this issue?
Thanks,
Saurabh
5 years 9 months ago #1427
by joachim
Replied by joachim on topic Loading and merging STL files using python script
Maybe something with the index conversion went wrong.
It's best to draw the merged meshes (surface and or volume). For that you have to wrap the Netgen-mesh into an NGSolve mesh first:
import ngsolve as ngs
ngsmesh = ngs.Mesh(netgenmesh)
Draw (ngsmesh)
You can also post your py-codes and meshes.
Joachim
It's best to draw the merged meshes (surface and or volume). For that you have to wrap the Netgen-mesh into an NGSolve mesh first:
import ngsolve as ngs
ngsmesh = ngs.Mesh(netgenmesh)
Draw (ngsmesh)
You can also post your py-codes and meshes.
Joachim
5 years 9 months ago #1458
by spuri
Replied by spuri on topic Loading and merging STL files using python script
Hello Joachim,
Thanks again for your response. I am still getting the issue of overlapping elements. I have attached two STL files and the python script I am using to merge them. I can mesh and merge these STL files using the GUI, but not with python.
It would be great if you could take a look at the files and guide me in sorting the issue.
Regards,
Saurabh
Thanks again for your response. I am still getting the issue of overlapping elements. I have attached two STL files and the python script I am using to merge them. I can mesh and merge these STL files using the GUI, but not with python.
It would be great if you could take a look at the files and guide me in sorting the issue.
Regards,
Saurabh
Time to create page: 0.106 seconds