mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 04:40:34 +05:00
Merge branch 'csgfeatures' into 'master'
Csgfeatures See merge request !31
This commit is contained in:
commit
d718e86081
@ -186,7 +186,7 @@ namespace netgen
|
|||||||
|
|
||||||
for(int i=0; i<path->GetNSplines(); i++)
|
for(int i=0; i<path->GetNSplines(); i++)
|
||||||
{
|
{
|
||||||
if(mindist[i] > cutdist) continue;
|
if(mindist[i] > cutdist*(1+1e-10)) continue;
|
||||||
|
|
||||||
double thist = CalcProj(point3d,testpoint2d,i);
|
double thist = CalcProj(point3d,testpoint2d,i);
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
const SplineGeometry<3> & path;
|
const SplineGeometry<3> & path;
|
||||||
const SplineGeometry<2> & profile;
|
const SplineGeometry<2> & profile; // closed, clockwise oriented curve
|
||||||
|
|
||||||
const Vec<3> & z_direction;
|
const Vec<3> & z_direction;
|
||||||
|
|
||||||
|
@ -187,6 +187,7 @@ DLL_HEADER void ExportCSG(py::module &m)
|
|||||||
;
|
;
|
||||||
|
|
||||||
py::class_<SplineGeometry<3>,shared_ptr<SplineGeometry<3>>> (m,"SplineCurve3d")
|
py::class_<SplineGeometry<3>,shared_ptr<SplineGeometry<3>>> (m,"SplineCurve3d")
|
||||||
|
.def(py::init<>())
|
||||||
.def ("AddPoint", FunctionPointer
|
.def ("AddPoint", FunctionPointer
|
||||||
([] (SplineGeometry<3> & self, double x, double y, double z)
|
([] (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);
|
Solid * sol = new Solid (brick);
|
||||||
return make_shared<SPSolid> (sol);
|
return make_shared<SPSolid> (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<SPSolid> (sol);
|
||||||
|
}));
|
||||||
m.def ("Revolution", FunctionPointer([](Point<3> p1, Point<3> p2,
|
m.def ("Revolution", FunctionPointer([](Point<3> p1, Point<3> p2,
|
||||||
const SplineGeometry<2> & spline)
|
const SplineGeometry<2> & spline)
|
||||||
{
|
{
|
||||||
@ -308,6 +315,14 @@ DLL_HEADER void ExportCSG(py::module &m)
|
|||||||
Solid * sol = new Solid(rev);
|
Solid * sol = new Solid(rev);
|
||||||
return make_shared<SPSolid> (sol);
|
return make_shared<SPSolid> (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<SPSolid> (sol);
|
||||||
|
}));
|
||||||
|
|
||||||
m.def ("Or", FunctionPointer([](shared_ptr<SPSolid> s1, shared_ptr<SPSolid> s2)
|
m.def ("Or", FunctionPointer([](shared_ptr<SPSolid> s1, shared_ptr<SPSolid> s2)
|
||||||
{
|
{
|
||||||
|
@ -92,8 +92,8 @@ IntersectTriangleLine (const Point<3> ** tri, const Point<3> ** line)
|
|||||||
<< "line = " << *line[0] << " - " << *line[1] << endl
|
<< "line = " << *line[0] << " - " << *line[1] << endl
|
||||||
<< "tri = " << *tri[0] << " - " << *tri[1] << " - " << *tri[2] << endl
|
<< "tri = " << *tri[0] << " - " << *tri[1] << " - " << *tri[2] << endl
|
||||||
<< "lami = " << lami << endl
|
<< "lami = " << lami << endl
|
||||||
<< "pc = " << ( *line[0] + lami.Get(1) * vl ) << endl
|
<< "pc = " << ( *line[0] + lami(0) * vl ) << endl
|
||||||
<< " = " << ( *tri[0] + lami.Get(2) * vt1 + lami.Get(3) * vt2) << endl
|
<< " = " << ( *tri[0] + lami(1) * vt1 + lami(2) * vt2) << endl
|
||||||
<< " a = " << a << endl
|
<< " a = " << a << endl
|
||||||
<< " ainv = " << ainv << endl
|
<< " ainv = " << ainv << endl
|
||||||
<< " det(a) = " << det << endl
|
<< " det(a) = " << det << endl
|
||||||
|
Loading…
Reference in New Issue
Block a user