本文共 1253 字,大约阅读时间需要 4 分钟。
vtkPlane provides methods for various plane computations. These include projecting points onto a plane, evaluating the plane equation, and returning plane normal. vtkPlane is a concrete implementation of the abstract class vtkImplicitFunction.
在成员函数中还定义了点、矢量向某个平面投影的功能函数,如ProjectPoint、ProjectVector等。
隐函数的数学表达式为F(x,y,z)=w,平面的隐函数方程有点法式和一般式。在vtkPlane中采用的是点法式隐函数。
点法式平面隐函数方程为:A(x-x0)+B(y-y0)+C(z-z0)=w, (A,B,C)为平面法向量,即vtkPlane中的Normal,(x0,y0,z0)为平面上一点,即vtkPlane中的Origin。 平面的一般式方程为:Ax+By+Cz=wEvaluateFunction(...)函数的源代码如下:
double vtkPlane::EvaluateFunction( double x[3] ){ return ( this->Normal[0]*(x[0]-this->Origin[0]) + this->Normal[1]*(x[1]-this->Origin[1]) + this->Normal[2]*(x[2]-this->Origin[2]) );}
转载于:https://blog.51cto.com/weiyuqingcheng/2113936