Correctly identifying faces of geometry that is displayed with pdegplot()
26 ビュー (過去 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!