本文整理汇总了C++中ON_NurbsSurface::IsValid方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_NurbsSurface::IsValid方法的具体用法?C++ ON_NurbsSurface::IsValid怎么用?C++ ON_NurbsSurface::IsValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_NurbsSurface
的用法示例。
在下文中一共展示了ON_NurbsSurface::IsValid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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");
}
示例2: ON_NurbsSurface_CreateRuledSurface
RH_C_FUNCTION ON_NurbsSurface* ON_NurbsSurface_CreateRuledSurface( const ON_Curve* pConstA, const ON_Curve* pConstB )
{
ON_NurbsSurface* rc = NULL;
if( pConstA && pConstB )
{
rc = new ON_NurbsSurface();
rc->CreateRuledSurface(*pConstA, *pConstB);
if( !rc->IsValid() )
{
delete rc;
rc = NULL;
}
}
return rc;
}