How does the function pdegplot(model,'FaceLabels','on') detect the labeled Faces ?
3 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Damian Sheehy
on 25 May 2016
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 Comments
See Also
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!