필터 지우기
필터 지우기

Stl file pdegplot in App designer

조회 수: 9 (최근 30일)
Jigar
Jigar 2024년 5월 17일
편집: Cris LaPierre 2024년 5월 20일
Hi,
I am looking for a solution to find names of the faces after importing the stl file. pdegplot command does that but how can I use it in App Designer. I am trying the command but it throws different error. Looked for a solution but it isn't available.
Is there any other command where i can use it to see name faces in the App designer so that i can use it to apply BC.
Thanks,
Jigar
  댓글 수: 1
Cris LaPierre
Cris LaPierre 2024년 5월 17일
What error are you getting? Please share all the red text.

댓글을 달려면 로그인하십시오.

채택된 답변

Adam Danz
Adam Danz 2024년 5월 17일
편집: Adam Danz 2024년 5월 17일
> pdegplot command does that but how can I use it in App Designer?
pdegplot does not have an input argument or property to specify the parent axes. This often poses a propblem in AppDesigner and uifigures in general since the default HandleVisible property in uifigures is 'off'. This prevents pdegplot from finding the axes within the uifigure resulting in the generation of a new figure external to the app.
I suppose this is the problem you're running into.
This workaround describes how to temporarily make the app's axes accessible and current so that the pdegplot will add content to the existing axes.
Here's a quick example. See the previous link for details.
% Mimick an app
app.UIFigure = uifigure();
app.UIAxes = uiaxes(app.UIFigure);
% Change handle visibility
origState = app.UIFigure.HandleVisibility;
handleVisCleanup = onCleanup(@()set(app.UIFigure,'HandleVisibility',origState));
app.UIFigure.HandleVisibility = 'on';
% Make axes current
set(groot, 'CurrentFigure', app.UIFigure)
set(app.UIFigure,'CurrentAxes',app.UIAxes)
% Plot pdegplot
g = [2 1 1 1 1 1 1 1 1 4 4;
-1 -0.6 -0.5 -0.4 -0.5 0.4 0.5 0.6 0.5 -1 0.17;
1 -0.5 -0.4 -0.5 -0.6 0.5 0.6 0.5 0.4 0.17 1;
0 -0.25 -0.35 -0.25 -0.15 -0.25 -0.35 -0.25 -0.15 0 -0.74;
0 -0.35 -0.25 -0.15 -0.25 -0.35 -0.25 -0.15 -0.25 -0.74 0;
0 0 0 0 0 0 0 0 0 1 1;
1 1 1 1 1 1 1 1 1 0 0;
0 -0.5 -0.5 -0.5 -0.5 0.5 0.5 0.5 0.5 0 0;
0 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 0 0;
0 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 1 1;
0 0 0 0 0 0 0 0 0 0.75 0.75;
0 0 0 0 0 0 0 0 0 0 0];
pdegplot(g)
  댓글 수: 10
Jigar
Jigar 2024년 5월 19일
편집: Jigar 2024년 5월 19일
editing
I take my words back. It is working with an app property. Thanks for all the help!
Adam Danz
Adam Danz 2024년 5월 20일
Glad that it all worked out, thanks for the demo @Cris LaPierre!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by