Outward pointing normal vector for 3D plane
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have the following facet of a cuboid given by the vertices: V = [-1,-1,-1; 1, 1, -1; -1,1,-1;1, -1,-1]. This facet is the bottom facet of the cuboid. So the outward pointing normal to the cuboid with respect to this facet should be [0 0 -1]. However, with the following MATLAB code, I get the normal, which is [0 0 1], which is inward pointing. What is missing here?
V=V-mean(V);
[U,S,W]=svd(V,0);
norm_vec = W(:,end)
I see at some places that the vertices should be arranged in the counterclockwise direction to calculate the outward pointing normal.
0 Commenti
Risposte (1)
Rishik Ramena
il 8 Ott 2020
There is no way for the svd function to know that the vertices you have provided are of a bottom facet of a cuboid. So there’s no inward/outward facing normal that can be ensured. Also the V generated by svd does not ensure a direction to a plane. It can only ensure that the vector will be normal to the best fit plane covering the provided vertices. You might also have noticed that the orientation of the provided vertices(clockwise/counter-clockwise) does not affect the generated normal. You might want to go through the explanation provided here to better understand how and why this method works this way.
0 Commenti
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!