From 8a1cf75c5e7f7e30c68768f2aead51fc360857aa Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Wed, 9 Nov 2016 16:10:04 +0100 Subject: [PATCH] fix init of splinesurface --- external_dependencies/pybind11 | 2 +- libsrc/csg/python_csg.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/external_dependencies/pybind11 b/external_dependencies/pybind11 index 2b92a491..030d10e8 160000 --- a/external_dependencies/pybind11 +++ b/external_dependencies/pybind11 @@ -1 +1 @@ -Subproject commit 2b92a49115657712c7dd924248df2286e6143b8d +Subproject commit 030d10e826b87f8cdf0816aa36b9a515fb7d064d diff --git a/libsrc/csg/python_csg.cpp b/libsrc/csg/python_csg.cpp index 9cd9390d..afc4836a 100644 --- a/libsrc/csg/python_csg.cpp +++ b/libsrc/csg/python_csg.cpp @@ -275,7 +275,7 @@ DLL_HEADER void ExportCSG(py::module &m) py::class_> (m, "SplineSurface", "A surface for co dim 2 integrals on the splines") - .def("__init__", FunctionPointer ([](const shared_ptr base, py::list cuts) + .def("__init__", FunctionPointer ([](SplineSurface* instance, shared_ptr base, py::list cuts) { auto primitive = dynamic_cast (base->GetSolid()->GetPrimitive()); auto acuts = new Array(); @@ -292,8 +292,8 @@ DLL_HEADER void ExportCSG(py::module &m) } if(!primitive) throw NgException("Base is not a SurfacePrimitive in constructor of SplineSurface!"); - return make_shared(primitive,acuts); - }),(py::arg("base"), py::arg("cuts")=py::list())) + new (instance) SplineSurface(primitive,acuts); + }),py::arg("base"), py::arg("cuts")=py::list()) .def("AddPoint", FunctionPointer ([] (SplineSurface & self, double x, double y, double z, bool hpref) {