Error Importing STL into PDE model using importGeometry()

조회 수: 86 (최근 30일)
Nikolaus Mackay
Nikolaus Mackay 2020년 4월 28일
댓글: ADSW121365 2020년 6월 1일
Hello
I have seen a few tickets on this problem but no resolution was found. When I try to import an STL, I get the following error
model=createpde('structural')
importGeometry(model,'Gyro.stl')
'Error using pde.DiscreteGeometry'
'Failed to create geometry. The stl file is invalid, more than two facets share an edge.'
'Error in pde.EquationModel/importGeometry (line 60)'
'gm = pde.DiscreteGeometry(geofilename);'
'Error in Soft_Lattice_Struct_Analysis (line 4)'
'importGeometry(model,''Gyro.stl')
I found an explanation saying that Matlab versions after 2019b, no longer support import STL's with "multidomain geometries". If true, this feels extremely limiting on the part of Mathworks.
In addition, I have found some people suggesting to use "stlread()", then use the resulting triangulation to create a geometry using "geometryFromMesh()". However geometryFromMesh requires nodes and indices which seem impossible to know when your STL has many nodes.
Any help would be greatly appreciated!!
Thanks!
  댓글 수: 1
ADSW121365
ADSW121365 2020년 6월 1일
As a work-around, you can make use of gmsh (I posted an answer to a question which needed a similar approach here: https://uk.mathworks.com/matlabcentral/answers/483115-reading-msh-files-3d-in-matlab).
If you import your .stl file into gmsh and mesh it, as well as assigning physical groups for each subdomain you can utalise geometryFromMesh to import the entire mesh.
If you're performing FEM, gmsh also has a bunch of mesh optimisation tools which may help improve results/code running time. As an example for a 3D DC Conductivity problem in the PDE Toolbox, a linear optimised mesh can achieve better results than a quadratic mesh (which fills my RAM) generated by MATLABs approach of just filling the volume with elements.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by