diff --git a/src/Base/VectorPy.xml b/src/Base/VectorPy.xml index 81cd9b0051..2549c5bfb8 100644 --- a/src/Base/VectorPy.xml +++ b/src/Base/VectorPy.xml @@ -32,6 +32,13 @@ + + + negative() + returns the negative (opposite) of this vector + + + scale(Float,Float,Float) diff --git a/src/Base/VectorPyImp.cpp b/src/Base/VectorPyImp.cpp index 830ec386e6..c86902c689 100644 --- a/src/Base/VectorPyImp.cpp +++ b/src/Base/VectorPyImp.cpp @@ -215,6 +215,16 @@ PyObject* VectorPy::sub(PyObject *args) return new VectorPy(v); } +PyObject* VectorPy::negative(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return 0; + + VectorPy::PointerType this_ptr = reinterpret_cast(_pcTwinPointer); + Base::Vector3d v = -(*this_ptr); + return new VectorPy(v); +} + PyObject* VectorPy::richCompare(PyObject *v, PyObject *w, int op) { if (PyObject_TypeCheck(v, &(VectorPy::Type)) &&