Importing STL file with 4 objects turning into 1

Hi! I have a simple object comprised of four blocks as shown in the CAD below. I'm modeling it as 4 separate objects with different material properties. My problem is that when I import it in matlab using the code below, it turns it into a single object, as shown
Is there a way for the stl file to accurately be imported?
Is there a quick way to edit this object in matlab to mirror the CAD file?
structuralmodel = createpde('structural','modal-solid');
importGeometry(structuralmodel, 'plateproblem2.stl');
figure
pdegplot(structuralmodel,'EdgeLabels','on');
view(100,100)

3 comentarios

darova
darova el 22 de Mzo. de 2021
I think you should import each body separately
Ammiel Barros
Ammiel Barros el 23 de Mzo. de 2021
Tried, but as expected, assemblies of models aren't currently supported. Thanks anyway
Bastiaan
Bastiaan el 10 de Sept. de 2024
Ammiel Barros, how is it now? multiple bodies cant be assembled into the Matlab PDE Modeler?
Best regards
Bastiaan Pierik

Iniciar sesión para comentar.

 Respuesta aceptada

Cris LaPierre
Cris LaPierre el 22 de Mzo. de 2021
Editada: Cris LaPierre el 22 de Mzo. de 2021

1 voto

Perhaps the tip on the importGeometry page is applicable here:
The STL format approximates the boundary of a CAD geometry by a collection of triangles, and the importGeometry function reconstructs the faces and edges from this data. Reconstruction from STL data is not precise and can result in a loss of edges and, therefore, the merging of adjacent faces. Typically, lost edges are the edges between two adjacent faces meeting at a small angle, or smooth edges bounding blend surfaces. Usually, the loss of such edges does not affect the analysis workflow.
Can you share your stl? You'll have to either change the extension or zip it first, then attach it using the paperclip icon.

7 comentarios

Ammiel Barros
Ammiel Barros el 23 de Mzo. de 2021
Hi Cris! Thanks for the response. I see what you mean.
"Usually, the loss of such edges does not affect the analysis workflow." - Do you think this is the reason why there's no AddEdge function?
Attached is the stl file. This is generated using export from AutoCAD.
Thanks.
Cris LaPierre
Cris LaPierre el 23 de Mzo. de 2021
Editada: Cris LaPierre el 23 de Mzo. de 2021
Your issue appears to be with how you have exported your stl. It is a solid body, so you likely lost any internal faces when exported. When I view the slt in an stl viewer, it does not detect any internal faces.
In other words, MATLAB has not removed the faces. AutoCAD did.
Ammiel Barros
Ammiel Barros el 23 de Mzo. de 2021
I see. Let me see how I can export it properly, and then import it in MATLAB. I'll get back to you afterwards.
Thank you!
Ammiel Barros
Ammiel Barros el 23 de Mzo. de 2021
Hi Cris, I edited the stl file before importing it. Solved my problem. Appreciate the help.
Cris LaPierre
Cris LaPierre el 23 de Mzo. de 2021
That's looking more like it.
I have a similar problem I get this error message from matlab
Error using pde.DiscreteGeometry
Failed to create geometry. The stl file is invalid, more than two facets share an edge.
I have created the stl file from FreeCAD of three separate parts that fit together. Stl file of one part works just with more than one part. Can I import a number of parts and join them? Any help much appreciated.
Julian
Cris LaPierre
Cris LaPierre el 21 de Nov. de 2023
You will need to combine your stl files in FreeCAD. A quick google search shows there are results for this. I obvioulsy can't comment on if this is a valid solution for you or not, but here's one result that looked promising: https://grabcad.com/tutorials/how-to-combine-stl-files-freecad-combine-stl-files-stl-format-stl-3d-printing

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2020b

Preguntada:

el 22 de Mzo. de 2021

Comentada:

el 10 de Sept. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by