本文整理汇总了C++中ON_NurbsCurve::Create方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_NurbsCurve::Create方法的具体用法?C++ ON_NurbsCurve::Create怎么用?C++ ON_NurbsCurve::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_NurbsCurve
的用法示例。
在下文中一共展示了ON_NurbsCurve::Create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNurbForm
ON_BOOL32 ON_Ellipse::GetNurbForm( ON_NurbsCurve& nurbscurve ) const
{
int rc = 0;
if ( IsValid() ) {
nurbscurve.Create( 3, true, 3, 9 );
nurbscurve.m_knot[0] = nurbscurve.m_knot[1] = 0.0;
nurbscurve.m_knot[2] = nurbscurve.m_knot[3] = 0.5*ON_PI;
nurbscurve.m_knot[4] = nurbscurve.m_knot[5] = ON_PI;
nurbscurve.m_knot[6] = nurbscurve.m_knot[7] = 1.5*ON_PI;
nurbscurve.m_knot[8] = nurbscurve.m_knot[9] = 2.0*ON_PI;
ON_4dPoint* CV = (ON_4dPoint*)nurbscurve.m_cv;
CV[0] = plane.PointAt( radius[0], 0.0);
CV[1] = plane.PointAt( radius[0], radius[1]);
CV[2] = plane.PointAt( 0.0, radius[1]);
CV[3] = plane.PointAt(-radius[0], radius[1]);
CV[4] = plane.PointAt(-radius[0], 0.0);
CV[5] = plane.PointAt(-radius[0], -radius[1]);
CV[6] = plane.PointAt( 0.0, -radius[1]);
CV[7] = plane.PointAt( radius[0], -radius[1]);
CV[8] = CV[0];
const double w = 1.0/sqrt(2.0);
int i;
for ( i = 1; i < 8; i += 2 ) {
CV[i].x *= w;
CV[i].y *= w;
CV[i].z *= w;
CV[i].w = w;
}
rc = 2;
}
return rc;
}
示例2: GetNurbForm
int ON_LineCurve::GetNurbForm(
ON_NurbsCurve& c,
double tolerance,
const ON_Interval* subdomain
) const
{
int rc = 0;
if ( c.Create( m_dim==2?2:3, false, 2, 2 ) )
{
rc = 1;
double t0 = m_t[0];
double t1 = m_t[1];
if (subdomain )
{
if ( t0 < t1 )
{
const ON_Interval& sd = *subdomain;
double s0 = sd[0];
double s1 = sd[1];
if (s0 < t0) s0 = t0;
if (s1 > t1) s1 = t1;
if (s0 < s1)
{
t0 = s0;
t1 = s1;
}
else
rc = 0;
}
else
{
rc = 0;
}
}
if ( t0 < t1 )
{
c.m_knot[0] = t0;
c.m_knot[1] = t1;
c.SetCV( 0, PointAt(t0));
c.SetCV( 1, PointAt(t1));
}
else if ( t0 > t1 )
{
rc = 0;
c.m_knot[0] = t1;
c.m_knot[1] = t0;
c.SetCV( 0, PointAt(t1));
c.SetCV( 1, PointAt(t0));
}
else
{
rc = 0;
c.m_knot[0] = 0.0;
c.m_knot[1] = 1.0;
c.SetCV( 0, m_line.from );
c.SetCV( 1, m_line.to );
}
}
return rc;
}