本文整理汇总了C++中ON_NurbsSurface::SetKnot方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_NurbsSurface::SetKnot方法的具体用法?C++ ON_NurbsSurface::SetKnot怎么用?C++ ON_NurbsSurface::SetKnot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_NurbsSurface
的用法示例。
在下文中一共展示了ON_NurbsSurface::SetKnot方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreatePlanarSurface
static ON_Surface* CreatePlanarSurface(
const ON_3dPoint& SW, const ON_3dPoint& SE,
const ON_3dPoint& NE, const ON_3dPoint& NW
)
{
ON_NurbsSurface* pNurbsSurface = new ON_NurbsSurface(
3, // dimension (>= 1)
FALSE, // not rational
2, // "u" order (>= 2)
2, // "v" order (>= 2)
2, // number of control vertices in "u" dir (>= order)
2 // number of control vertices in "v" dir (>= order)
);
// corner CVs in counter clockwise order starting in the south west
pNurbsSurface->SetCV( 0,0, SW );
pNurbsSurface->SetCV( 1,0, SE );
pNurbsSurface->SetCV( 1,1, NE );
pNurbsSurface->SetCV( 0,1, NW );
// "u" knots
pNurbsSurface->SetKnot( 0,0, 0.0 );
pNurbsSurface->SetKnot( 0,1, 1.0 );
// "v" knots
pNurbsSurface->SetKnot( 1,0, 0.0 );
pNurbsSurface->SetKnot( 1,1, 1.0 );
return pNurbsSurface;
}
示例2: TwistedCubeSideSurface
static ON_Surface* TwistedCubeSideSurface(
const ON_3dPoint& SW, const ON_3dPoint& SE,
const ON_3dPoint& NE, const ON_3dPoint& NW
)
{
ON_NurbsSurface* pNurbsSurface = new ON_NurbsSurface(
3, // dimension
false, // not rational
2, // "u" order
2, // "v" order
2, // number of control vertices in "u" dir
2 // number of control vertices in "v" dir
);
// corner CVs in counter clockwise order starting in the south west
pNurbsSurface->SetCV( 0,0, SW );
pNurbsSurface->SetCV( 1,0, SE );
pNurbsSurface->SetCV( 1,1, NE );
pNurbsSurface->SetCV( 0,1, NW );
// "u" knots
pNurbsSurface->SetKnot( 0,0, 0.0 );
pNurbsSurface->SetKnot( 0,1, 1.0 );
// "v" knots
pNurbsSurface->SetKnot( 1,0, 0.0 );
pNurbsSurface->SetKnot( 1,1, 1.0 );
return pNurbsSurface;
}
示例3: log
extern "C" void
rt_nurb_brep(ON_Brep **b, const struct rt_db_internal *ip, const struct bn_tol *)
{
int i, j, k;
struct rt_nurb_internal *nip;
RT_CK_DB_INTERNAL(ip);
nip = (struct rt_nurb_internal *)ip->idb_ptr;
RT_NURB_CK_MAGIC(nip);
ON_TextLog log(stderr);
for (i = 0; i < nip->nsrf; i++) {
struct face_g_snurb *surface = nip->srfs[i];
NMG_CK_SNURB(surface);
ON_NurbsSurface *nurb = ON_NurbsSurface::New(3, true, surface->order[0], surface->order[1], surface->s_size[0], surface->s_size[1]);
/* set 'u' knots */
/* skip first and last (duplicates?) */
for (j = 1; j < surface->u.k_size - 1; j++) {
nurb->SetKnot(0, j-1, surface->u.knots[j]);
/* bu_log("u knot %d is %f\n", j-1, surface->u.knots[j]); */
}
/* set 'v' knots */
/* skip first and last (duplicates?) */
for (j = 1; j < surface->v.k_size - 1; j++) {
nurb->SetKnot(1, j-1, surface->v.knots[j]);
/* bu_log("v knot %d is %f\n", j-1, surface->u.knots[j]); */
}
/* set control points */
for (j = 0; j < surface->s_size[0]; j++) {
for (k = 0; k < surface->s_size[1]; k++) {
ON_3dPoint point = &RT_NURB_GET_CONTROL_POINT(surface, j, k);
nurb->SetCV(k, j, point);
}
}
/* nurb->Dump(log); */
bu_log("NURBS surface %d %s valid\n", i, nurb->IsValid(&log) ? "is" : "is not");
(*b)->m_S.Append(nurb);
int sindex = (*b)->m_S.Count();
(*b)->NewFace(sindex - 1);
int findex = (*b)->m_F.Count();
(*b)->NewOuterLoop(findex - 1);
}
bu_log("BREP object %s a single surface\n", (*b)->IsSurface() ? "is" : "is not");
bu_log("BREP object %s valid\n", (*b)->IsValid(&log) ? "is" : "is not");
bu_log("BREP object %s valid topology\n", (*b)->IsValidTopology(&log) ? "is" : "is not");
bu_log("BREP object %s valid geometry\n", (*b)->IsValidGeometry(&log) ? "is" : "is not");
bu_log("BREP object %s solid\n", (*b)->IsSolid() ? "is" : "is not");
bu_log("BREP object %s manifold\n", (*b)->IsManifold() ? "is" : "is not");
}
示例4:
HIDDEN ON_Surface*
sideSurface(const ON_3dPoint& SW, const ON_3dPoint& SE, const ON_3dPoint& NE, const ON_3dPoint& NW)
{
ON_NurbsSurface *surf = ON_NurbsSurface::New(3, 0, 2, 2, 2, 2);
surf->SetCV(0, 0, SW);
surf->SetCV(1, 0, SE);
surf->SetCV(1, 1, NE);
surf->SetCV(0, 1, NW);
surf->SetKnot(0, 0, 0.0);
surf->SetKnot(0, 1, 1.0);
surf->SetKnot(1, 0, 0.0);
surf->SetKnot(1, 1, 1.0);
return surf;
}