I am trying to mesh a simple volume (into tetrahedrons. I obtained the 3D geometry by extruding a 2-D geometry. From what I understand I can only mesh a volume by first writing an stl-file, then importing it into MATLAB and then meshing the volume. But how do I export my 3-D geometry to an stl-file?
I somehow managed successfully to mesh the brick without the hole using the function Delaunay, triangulation and stl-write.
Below is some code.
Thank you so much for any help you could offer
Ansgar
g = decsg(gm,sf,ns)
g =
2 2 2 2 2 2 2 2
4 4 0 -2 0 2 -4 -4
4 -4 -2 0 2 0 -4 4
-4 4 -2 0 2 0 -4 -4
4 4 0 2 0 -2 4 -4
1 1 1 1 1 1 0 1
0 0 0 0 0 0 1 0
g1=geometryFromEdges(model,g)
g1 =
AnalyticGeometry with properties:
NumCells: 0
NumFaces: 1
NumEdges: 8
NumVertices: 8
Vertices: [8×2 double]
mesh=generateMesh(model,'GeometricOrder','linear','Hmax',1,'Hmin',.3)
mesh =
FEMesh with properties:
Nodes: [2×88 double]
Elements: [3×132 double]
MaxElementSize: 1
MinElementSize: 0.3000
MeshGradation: 1.5000
GeometricOrder: 'linear'
g2=extrude(g1,1)
g2 =
DiscreteGeometry with properties:
NumCells: 1
NumFaces: 10
NumEdges: 24
NumVertices: 16
Vertices: [16×3 double]
pdegplot(g2,'FaceLabels','on','facealpha',.2)