Plane plotted with fimplicit3 fails to render

5 vues (au cours des 30 derniers jours)
Matt J
Matt J le 5 Fév 2024
Commenté : Adam Danz le 7 Oct 2024
load data E C ax
planefun=@(x,y,z) E(1)*x+E(2)*y+E(3)*z+E(4);
In the plot below, I successfully plot a point C and try to superimpose, with fimplicit3, the plot of a plane described by planefun. Since C nearly satisfies the plane equation,
planefun(C(1), C(2), C(3))
ans = -2.8422e-14
I think I should be able to see a portion of the plane in the figure (and it should pass through C), but I do not. Why?
plot3(C(1), C(2),C(3),'x'); axis(ax); hold on
fimplicit3(planefun,ax); hold off

Réponse acceptée

Matt J
Matt J le 6 Fév 2024
MathWorks Tech Support has classified this as a bug (Case #06788114)
  1 commentaire
Adam Danz
Adam Danz le 7 Oct 2024
Thanks for reporting this, @Matt J. As you've discovered in another thread, this bug was fixed in R2024b.

Connectez-vous pour commenter.

Plus de réponses (1)

akshatsood
akshatsood le 5 Fév 2024
I have noticed that you are experiencing difficulties with the 'fimplicit3' function during plotting. After attempting to replicate the issue, I encountered similar behavior. It appears that the problem stems from the axis limits defined by 'ax'. The 'fimplicit3' function requires an adequate range to properly visualize the surface where f(x,y,z) = 0 intersects the level f=0. In your instance, the provided 'ax' limits were insufficient, preventing the curve from rendering correctly.
Below is the revised code snippet with appropriate adjustments.
load data E C ax
planefun=@(x,y,z) E(1)*x+E(2)*y+E(3)*z+E(4);
plot3(C(1), C(2),C(3),'x','LineWidth',2,'Color','r');
hold on
f = fimplicit3(planefun,[-250 0]);
f.EdgeColor = 'none';
f.FaceAlpha = 0.8;
hold off
Have a look at the following references for a better understanding
I hope this helps.
  1 commentaire
Matt J
Matt J le 5 Fév 2024
Modifié(e) : Matt J le 5 Fév 2024
I do thank you for undertaking to study this problem. However, I don't think the span of the axes could be the issue. Here is a modified example with the same axis range, except that C has been translated to (0,0,0). The plane renders fine,
load data E C ax
ax=ax-repelem(C',2);
planefun=@(x,y,z) E(1)*x+E(2)*y+E(3)*z;
plot3(0,0,0,'x','LineWidth',2,'Color','r');
hold on
f = fimplicit3(planefun,ax);
f.EdgeColor = 'none';
f.FaceAlpha = 0.8;
hold off

Connectez-vous pour commenter.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by