specify axis to plot alphaShape

17 vues (au cours des 30 derniers jours)
Juan Jose
Juan Jose le 10 Nov 2024 à 0:25
Réponse apportée : Walter Roberson le 10 Nov 2024 à 1:10
In matlab docs for alphaShape plot there is not a way to specify the axis to plot on.
x = [0 1 0 1 0 1 0 1];
y = [0 0 0 0 1 1 1 1];
z = [0 0 1 1 0 0 1 1];
shp = alphaShape(x', y', z', 1);
plot(shp)
Code above works fine, but trying to specify an axes throws error:
ax = axes;
plot(ax, shp)
Any solution?

Réponse acceptée

Juan Jose
Juan Jose le 10 Nov 2024 à 0:33
nevermind, found the solution:
[tri, pts] = boundaryFacets(shp);
trisurf(tri, pts(:,1), pts(:,2), pts(:,3), 'Parent', ax);

Plus de réponses (1)

Walter Roberson
Walter Roberson le 10 Nov 2024 à 1:10
plot(shp, 'Parent', ax)

Tags

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by