Part: issue #6488: Cone surface returns wrong dv derivative

This is a workaround to fix a bug in ElSLib::ConeDN
This commit is contained in:
wmayer
2022-03-01 14:59:26 +01:00
parent 6afab502ca
commit 9252f5f9ec
3 changed files with 65 additions and 10 deletions

View File

@@ -226,17 +226,13 @@ PyObject* GeometrySurfacePy::getD0(PyObject *args)
PyObject* GeometrySurfacePy::getDN(PyObject *args)
{
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
Handle(Geom_Surface) s = Handle(Geom_Surface)::DownCast(g);
try {
if (!s.IsNull()) {
int nu, nv;
double u,v;
if (!PyArg_ParseTuple(args, "ddii", &u, &v, &nu, &nv))
return nullptr;
gp_Vec v1 = s->DN(u, v, nu, nv);
return new Base::VectorPy(Base::Vector3d(v1.X(),v1.Y(),v1.Z()));
}
int nu, nv;
double u,v;
if (!PyArg_ParseTuple(args, "ddii", &u, &v, &nu, &nv))
return nullptr;
gp_Vec v1 = getGeomSurfacePtr()->getDN(u, v, nu, nv);
return new Base::VectorPy(Base::Vector3d(v1.X(),v1.Y(),v1.Z()));
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());