UG\NX secondary development finds new coordinates after the spatial point coordinates move a certain distance in a certain direction

Author of the article: Caspian
Source website: Ace Pilot_Caspian_Caspian NX secondary development 3000 examples, Caspian BlockUI column, C\C++-CSDN blog


Introduction:

        A group of friends asked "How to calculate the coordinates (x, y, z) of a space point in ufun after moving 10mm along the z-axis of any working coordinate system in space?"

        There are many methods for this, such as mathematical calculations such as ufun's affine transformation function UF_VEC3_affine_comb.

Next, move the point point by the dis distance in the vec direction. We do this in two ways.

Effect:

Code (ufun):

#include "me.hpp"

//沿着某一向量vec(0.1,0.4,0.6)移动10mm
void doIt()
{
	double point[3] = { 1.0,2.0,3.0 };
	double vec[3] = { 0.1,0.4,0.6 };
	double dis = 10.0;
	

Guess you like

Origin blog.csdn.net/WangPaiFeiXingYuan/article/details/133069850