필터 지우기
필터 지우기

How does the function pdegplot(m​odel,'Face​Labels','o​n') detect the labeled Faces ?

조회 수: 2 (최근 30일)
Sleh Eddine Brika
Sleh Eddine Brika 2016년 5월 17일
답변: Damian Sheehy 2016년 5월 25일
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
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;

답변 (1개)

Damian Sheehy
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.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by