diff --git a/libsrc/csg/extrusion.cpp b/libsrc/csg/extrusion.cpp index 29676395..8b257c20 100644 --- a/libsrc/csg/extrusion.cpp +++ b/libsrc/csg/extrusion.cpp @@ -186,7 +186,7 @@ namespace netgen for(int i=0; iGetNSplines(); i++) { - if(mindist[i] > cutdist) continue; + if(mindist[i] > cutdist*(1+1e-10)) continue; double thist = CalcProj(point3d,testpoint2d,i); diff --git a/libsrc/csg/extrusion.hpp b/libsrc/csg/extrusion.hpp index 189639bd..e80ac244 100644 --- a/libsrc/csg/extrusion.hpp +++ b/libsrc/csg/extrusion.hpp @@ -110,7 +110,7 @@ namespace netgen { private: const SplineGeometry<3> & path; - const SplineGeometry<2> & profile; + const SplineGeometry<2> & profile; // closed, clockwise oriented curve const Vec<3> & z_direction; diff --git a/libsrc/csg/python_csg.cpp b/libsrc/csg/python_csg.cpp index 94c5074d..b8c4ffbf 100644 --- a/libsrc/csg/python_csg.cpp +++ b/libsrc/csg/python_csg.cpp @@ -187,6 +187,7 @@ DLL_HEADER void ExportCSG(py::module &m) ; py::class_,shared_ptr>> (m,"SplineCurve3d") + .def(py::init<>()) .def ("AddPoint", FunctionPointer ([] (SplineGeometry<3> & self, double x, double y, double z) { @@ -301,6 +302,12 @@ DLL_HEADER void ExportCSG(py::module &m) Solid * sol = new Solid (brick); return make_shared (sol); })); + m.def ("Torus", FunctionPointer([](Point<3> c, Vec<3> n, double R, double r) + { + Torus * torus = new Torus (c,n,R,r); + Solid * sol = new Solid (torus); + return make_shared (sol); + })); m.def ("Revolution", FunctionPointer([](Point<3> p1, Point<3> p2, const SplineGeometry<2> & spline) { @@ -308,6 +315,14 @@ DLL_HEADER void ExportCSG(py::module &m) Solid * sol = new Solid(rev); return make_shared (sol); })); + m.def ("Extrusion", FunctionPointer([](const SplineGeometry<3> & path, + const SplineGeometry<2> & profile, + Vec<3> n) + { + Extrusion * extr = new Extrusion (path,profile,n); + Solid * sol = new Solid(extr); + return make_shared (sol); + })); m.def ("Or", FunctionPointer([](shared_ptr s1, shared_ptr s2) { diff --git a/libsrc/gprim/geomtest3d.cpp b/libsrc/gprim/geomtest3d.cpp index 5036d2a7..0c117a10 100644 --- a/libsrc/gprim/geomtest3d.cpp +++ b/libsrc/gprim/geomtest3d.cpp @@ -92,8 +92,8 @@ IntersectTriangleLine (const Point<3> ** tri, const Point<3> ** line) << "line = " << *line[0] << " - " << *line[1] << endl << "tri = " << *tri[0] << " - " << *tri[1] << " - " << *tri[2] << endl << "lami = " << lami << endl - << "pc = " << ( *line[0] + lami.Get(1) * vl ) << endl - << " = " << ( *tri[0] + lami.Get(2) * vt1 + lami.Get(3) * vt2) << endl + << "pc = " << ( *line[0] + lami(0) * vl ) << endl + << " = " << ( *tri[0] + lami(1) * vt1 + lami(2) * vt2) << endl << " a = " << a << endl << " ainv = " << ainv << endl << " det(a) = " << det << endl