Effacer les filtres
Effacer les filtres

Stl file pdegplot in App designer

10 vues (au cours des 30 derniers jours)
Jigar
Jigar le 17 Mai 2024
Modifié(e) : Cris LaPierre le 20 Mai 2024
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 commentaire
Cris LaPierre
Cris LaPierre le 17 Mai 2024
What error are you getting? Please share all the red text.

Connectez-vous pour commenter.

Réponse acceptée

Adam Danz
Adam Danz le 17 Mai 2024
Modifié(e) : Adam Danz le 17 Mai 2024
> 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 commentaires
Jigar
Jigar le 19 Mai 2024
Modifié(e) : Jigar le 19 Mai 2024
editing
I take my words back. It is working with an app property. Thanks for all the help!
Adam Danz
Adam Danz le 20 Mai 2024
Glad that it all worked out, thanks for the demo @Cris LaPierre!

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by