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!