Mesh the Inside of a 3D Patch

조회 수: 8 (최근 30일)
Paul Safier
Paul Safier 2020년 3월 26일
댓글: Akshay Kumar Pakala 2022년 3월 26일
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!
  댓글 수: 1
Akshay Kumar Pakala
Akshay Kumar Pakala 2022년 3월 26일
Hey
Were you able to solve your problem
Thank you

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

답변 (0개)

카테고리

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by