本文整理汇总了C++中ON_Plane::CreateFromNormal方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_Plane::CreateFromNormal方法的具体用法?C++ ON_Plane::CreateFromNormal怎么用?C++ ON_Plane::CreateFromNormal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_Plane
的用法示例。
在下文中一共展示了ON_Plane::CreateFromNormal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
bool ON_Arc::Create( // arc is parallel to XY plane
const ON_3dPoint& center, // center
double r, // radius
double angle_radians // angle in radians
)
{
ON_Plane p;
p.CreateFromNormal( center, ON_zaxis );
return Create( ON_Circle(p,r), ON_Interval( 0.0, angle_radians ) );
}
示例2: Morph
bool ON_Plane::Morph( const ON_SpaceMorph& morph )
{
ON_Plane mp;
double s = sqrt( fabs(origin.MaximumCoordinate())*ON_SQRT_EPSILON + ON_ZERO_TOLERANCE );
mp.xaxis = morph.MorphVector(origin,s*xaxis);
mp.yaxis = morph.MorphVector(origin,s*yaxis);
mp.zaxis = morph.MorphVector(origin,s*zaxis);
origin = morph.MorphPoint(origin);
UpdateEquation();
bool bx = mp.xaxis.Unitize();
bool by = mp.yaxis.Unitize();
bool bz = mp.zaxis.Unitize();
if (!bx)
{
mp.xaxis = ON_CrossProduct(mp.yaxis,mp.zaxis);
bx = mp.xaxis.Unitize();
}
if (!by)
{
mp.yaxis = ON_CrossProduct(mp.zaxis,mp.xaxis);
by = mp.yaxis.Unitize();
}
if (!bz)
{
mp.zaxis = ON_CrossProduct(mp.xaxis,mp.yaxis);
bz = mp.zaxis.Unitize();
}
mp.origin.Set(0.0,0.0,0.0);
mp.UpdateEquation();
bool rc = mp.IsValid();
ON_3dVector x, y, z;
if ( rc )
{
x = mp.xaxis;
y = mp.yaxis;
z = mp.zaxis;
}
else
{
x = ON_CrossProduct(mp.yaxis,mp.zaxis);
y = ON_CrossProduct(mp.zaxis,mp.xaxis);
z = ON_CrossProduct(mp.xaxis,mp.yaxis);
x.Unitize();
y.Unitize();
z.Unitize();
x = mp.xaxis + x;
y = mp.yaxis + y;
z = mp.zaxis + z;
x.Unitize();
y.Unitize();
z.Unitize();
rc = mp.CreateFromFrame(ON_origin,x,y);
if (rc)
{
x = mp.xaxis;
y = mp.yaxis;
z = mp.zaxis;
}
else
{
rc = mp.CreateFromFrame(ON_origin,y,z);
if ( rc )
{
y = mp.xaxis;
z = mp.yaxis;
x = mp.zaxis;
}
else
{
rc = mp.CreateFromFrame(ON_origin,z,x);
if (rc)
{
z = mp.xaxis;
x = mp.yaxis;
y = mp.zaxis;
}
else
{
rc = mp.CreateFromNormal(ON_origin,z);
if (rc)
{
x = mp.xaxis;
y = mp.yaxis;
z = mp.zaxis;
}
}
}
}
}
if (rc)
{
xaxis = x;
yaxis = y;
zaxis = z;
UpdateEquation();
}
return rc;
//.........这里部分代码省略.........