Outward pointing normal vector for 3D plane
7 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Rishik Ramena
2020 年 10 月 8 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!