转换CATIA VBA中的3D点投影为2D平面

To determine the position of a target point P with coordinates r_P = (x,y,z) in relation to a plane with a normal vector n=(nx,ny,nz), you must establish an origin on the plane and define two perpendicular directions for the x and y axes. If the origin is located at r_O=(ox,oy,oz) and the two coordinate axes on the plane are represented by e_1=(ex_1,ey_1,ez_1) and e_2=(ex_2,ey_2,ez_2), then the orthogonality condition is satisfied when Dot(n,e_1)=0, Dot(n,e_2)=0, and Dot(e_1,e_2)=0 (vector dot product). It is important to ensure that all direction vectors are normalized, meaning their magnitudes are equal to one.


The position of target point P can be expressed as r_P = r_O + t_1*e_1 + t_2*e_2 + s*n, where t_1 and t_2 are the 2D coordinates along e_1 and e_2, and s is the normal separation (distance) between the plane and the point. These scalar values are determined through projections: s=Dot(n, r_P-r_O), t_1=Dot(e_1, r_P-r_O), and t_2=Dot(e_2, r_P-r_O).


For instance, consider a plane with origin r_O=(-1,3,1) and normal vector n=(-1/√11, 3/√11, 1/√11). Choose orthogonal directions for the 2D coordinates, such as e_1=(1/√2, 0, 1/√2) and e_2=(-3/√22, -2/√22, 3/√22), ensuring that Dot(n,e_1)=0, Dot(n,e_2)=0, and Dot(e_1,e_2)=0.


For a point P with coordinates r_P=(1,7,-3), the 2D coordinates can be calculated as follows: t_1 = Dot(e_1, r_P-r_O) = (1/√2,0,1/√2)·( (1,7,-3)-(-1,3,1) = -√2 t_2 = Dot(e_2, r_P_O) = (-3/√22, -2/√22, 3/√22)·( (1,7,-3)-(-1,3,1) ) = -26/√22 and the out of plane separation: s = Dot(n, r_P-r_O) = 6/√11.

QR Code
微信扫一扫,欢迎咨询~

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 155-2731-8020
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

手机不正确

公司不为空