Correctly identifying faces of geometry that is displayed with pdegplot()
조회 수: 25 (최근 30일)
이전 댓글 표시
Hi community,
I know there are other people with similar problems like mine, but I wanted to ask for a different approach. My problem is the following:
I am using the pdegplot() function to plot my imported geometry and see the face numbers. However, my geometry has many faces, so that I can't clearly identify which face number belongs to which face. This problem other users seem to have, too. It is troubeling that I can't be sure which faces I am assigning my constraints to with the structuralBC() function.
What would help me is if there was a way to highlight certain faces in the figure by refering to their face number. For example, is there a way to highlight a face in a green shade? That way, I could iterate myself through the face numbers until I find the surface that I need.
If you see/know any other possibilities to correctly identify the face numbers, those are of course welcome, as well.
Thanks in advance for your support!
댓글 수: 2
AlexL
2020년 3월 20일
편집: AlexL
2020년 3월 20일
Great question.
I would also like to know about how g.faceLabelLocations() is calculated. There seems to be an offset between the face centre and the label location, and sometimes (when there are many faces), the label is so far away from the face that there isn't any correlation. Can this offset be adjusted to make it clearer which is which?
Once I guess a face in the vicinity, I plot it to check if I picked the right one...
% after you have calculated your model.Mesh with generateMesh, get all points that lie on test face 'face_ID'...
[~,e,~] = model.Mesh.meshToPet();
A = e.getElementFaces(face_ID);
all_points = cell2mat(arrayfun(@(n) model.Mesh.Nodes(:,A(n)), 1:numel(A),'UniformOutput',false))';
figure
pdegplot(model,'FaceLabels','on','FaceAlpha',0.5)
hold on, plot3(all_points(:,1), all_points(:,2),all_points(:,3),'r*')
A more robust method would be preferable
AlexL
2024년 1월 12일
Another helpful way is to first plot the model
pdegplot(model,'FaceLabels','on','FaceAlpha',0.5)
then use the data cursor (mouse, data tips) to highlight a node on the model near your face of interest. Right click and select "Export Cursor Data to Workspace". You can then run the following to give you a list of some of the faces around the node.
facesAttachedToEdges(model.Geometry,nearestEdge(model.Geometry,cursor_info.Position))
답변 (2개)
ADSW121365
2020년 7월 30일
Another workaround which I use is to find nodes associated with faces and plot them onto a pdegplot to highlight specific faces:
Totfaces = 240;
for i = 1:Totfaces %Plot to highlight faces
C_n = findNodes(model.Mesh,'Region','Face',i);
figure(); pdegplot(model,'CellLabels','on','FaceAlpha',0.5) %Geometry
hold on; scatter3(nodes(1,C_n),nodes(2,C_n),nodes(3,C_n),'r.');
end
댓글 수: 0
Waylon Puckett
2020년 7월 13일
I have a work around, it works, but it's a bad work around. I use a simplified thermal model, and I set all faces to one temperature, and then set a single face to a different temperature. Then I mesh it with a course mesh, and run the model. It's simple enough that it runs in a few seconds, but it shows the surface as a completely diffferent color. So it works.
댓글 수: 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!