How does the function pdegplot(model,'FaceLabels','on') detect the labeled Faces ?
2 次查看(过去 30 天)
显示 更早的评论
I am using PDE toolbox, when reading an STL file with importGeometry function, and plotted the result with the command pdegplot(model,'FaceLabels','on') I get this kind of result
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164462/image.png)
Do you know how could I get the information of an arbitrary face, let's say I need to manipulate the face F4 how to access to the face F4? I tried to extract the faces, vertices and Edges like this E= [(hc(2).XData)' (hc(2).YData)' (hc(2).ZData)']%Edges V=hc(1).Vertices;%Vertices F=hc(1).Faces;%Faces but the faces that I extracted my self are not the same as the ones plotted. For exemple I have a square, the command pdegplot(model,'FaceLabels','on') will label one face, but the matrix F will have 2. I don't know how it's work ! I think that the fonction find a relation between faces/edges/vertices to detect the labeled faces but I didn't figure out how it's work.
N = 3; model = createpde(N); p=importGeometry(model,'cube.stl');
figure hc=pdegplot(model,'FaceLabels','on'); E= [(hc(2).XData)' (hc(2).YData)' (hc(2).ZData)']%Edge V=hc(1).Vertices; F=hc(1).Faces;
0 个评论
回答(1 个)
Damian Sheehy
2016-5-25
The PDE toolbox does not support the editing of STL geometry at this time. You would need to edit the geometry in the CAD application where you created the file and then import the revision.
For a simple geometry like a cube you could create a triangulation representing the cube and then create geometry from that triangulation. You could then edit the triangulation in MATLAB. For example:
[X, Y, Z] = meshgrid(0:1);
P = [X(:), Y(:), Z(:)];
K = convhull(P);
pdem = createpde;
geometryFromMesh(pdem,P',K')
pdegplot(pdem)
You could then manipulate P.
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!