Mesh the Inside of a 3D Patch
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to solve a PDE via the PDE Toolbox and am having trouble building the mesh/geometry. I have built the volume via the patch function (see image). Here's how I made it:
fac = [1 2 6 5;2 6 7 3;1 2 3 4;1 5 8 4;5 6 7 8;9 4 8 12;9 12 11 10;10 13 14 11;3 7 14 13;9 3 13 10;12 7 14 11];
vert = [0 0 0;1 0 0;1 0 1; 0 0 1; 0 1 0; 1 1 0; 1 1 1; 0 1 1;-1 0 1; -1 0 3; -1 1 3;-1 1 1; 1 0 3; 1 1 3];
patch('Vertices',vert,'Faces',fac,...
'FaceVertexCData',hsv(size(fac,1)),'FaceColor','flat')
view(3)
axis vis3d
I need to find a way to make this a geometry that I can mesh and then solve a PDE within. I have tried writing this as an STL file with the command:
stlwrite('test.stl',fac,vert)
which throws an error instructing me to use the command triangulateFaces first, as:
[fac, inds] = triangulateFaces(fac);
Then, the call to stlwrite works. However, when I load the geometry with the command importGeometry I get the following error:
model = createpde();
importGeometry(model,'test.stl');
Error using pde.DiscreteGeometry
Failed to create geometry, the input does not form a closed volume.
This may be due to missing faces or gaps in the input.
Error in pde.EquationModel/importGeometry (line 60)
gm = pde.DiscreteGeometry(geofilename);
Can anyone offer any suggestions?
Thanks!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/279861/image.png)
댓글 수: 1
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Geometry and Mesh에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!