本文整理汇总了C++中Handle_Geom_BSplineSurface::InsertVKnot方法的典型用法代码示例。如果您正苦于以下问题:C++ Handle_Geom_BSplineSurface::InsertVKnot方法的具体用法?C++ Handle_Geom_BSplineSurface::InsertVKnot怎么用?C++ Handle_Geom_BSplineSurface::InsertVKnot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Handle_Geom_BSplineSurface
的用法示例。
在下文中一共展示了Handle_Geom_BSplineSurface::InsertVKnot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reparametrize
PyObject* BSplineSurfacePy::reparametrize(PyObject * args)
{
int u,v;
double tol = 0.000001;
if (!PyArg_ParseTuple(args, "ii|d", &u, &v, &tol))
return 0;
// u,v must be at least 2
u = std::max<int>(u, 2);
v = std::max<int>(v, 2);
try {
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
(getGeometryPtr()->handle());
double maxU = surf->UKnot(surf->NbUKnots()); // 1.0 if normalized surface
double maxV = surf->VKnot(surf->NbVKnots()); // 1.0 if normalized surface
GeomBSplineSurface* geom = new GeomBSplineSurface();
Handle_Geom_BSplineSurface spline = Handle_Geom_BSplineSurface::DownCast
(geom->handle());
for (int i=1; i<u-1; i++) {
double U = i * 1.0 / (u-1.0);
spline->InsertUKnot(U,i,tol,Standard_True);
}
for (int i=1; i<v-1; i++) {
double V = i * 1.0 / (v-1.0);
spline->InsertVKnot(V,i,tol,Standard_True);
}
for (int j=0; j<u; j++) {
double U = j * maxU / (u-1.0);
double newU = j * 1.0 / (u-1.0);
for (int k=0; k<v; k++) {
double V = k * maxV / (v-1.0);
double newV = k * 1.0 / (v-1.0);
// Get UV point and move new surface UV point
gp_Pnt point = surf->Value(U,V);
int ufirst, ulast, vfirst, vlast;
spline->MovePoint(newU, newV, point, j+1, j+1, k+1, k+1, ufirst, ulast, vfirst, vlast);
}
}
return new BSplineSurfacePy(geom);
}
catch (Standard_Failure) {
Handle_Standard_Failure e = Standard_Failure::Caught();
PyErr_SetString(PyExc_Exception, e->GetMessageString());
return 0;
}
}
示例2: insertVKnot
PyObject* BSplineSurfacePy::insertVKnot(PyObject *args)
{
double V, tol = 0.0;
int M=1;
PyObject* add = Py_True;
if (!PyArg_ParseTuple(args, "did|O!", &V, &M, &tol, &PyBool_Type, &add))
return 0;
try {
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
(getGeometryPtr()->handle());
surf->InsertVKnot(V,M,tol,PyObject_IsTrue(add));
}
catch (Standard_Failure) {
Handle_Standard_Failure e = Standard_Failure::Caught();
PyErr_SetString(PyExc_Exception, e->GetMessageString());
return 0;
}
Py_Return;
}