mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
fix csg extrusion
This commit is contained in:
parent
7c6296f153
commit
4e2d2943f6
@ -856,7 +856,7 @@ namespace netgen
|
|||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
if(latestfacenum >= 0)
|
if(latestfacenum >= 0)
|
||||||
return faces[latestfacenum]->VecInFace(p,v2,0);
|
return faces[latestfacenum]->VecInFace(p,v2,eps);
|
||||||
else
|
else
|
||||||
return VecInSolid(p,v2,eps);
|
return VecInSolid(p,v2,eps);
|
||||||
}
|
}
|
||||||
|
@ -330,14 +330,31 @@ 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([](shared_ptr<SplineGeometry<3>> path,
|
m.def ("Extrusion", [](shared_ptr<SplineGeometry<3>> path,
|
||||||
shared_ptr<SplineGeometry<2>> profile,
|
shared_ptr<SplineGeometry<2>> profile,
|
||||||
Vec<3> n)
|
Vec<3> d)
|
||||||
{
|
{
|
||||||
Extrusion * extr = new Extrusion (path,profile,n);
|
Extrusion * extr = new Extrusion (path,profile,d);
|
||||||
Solid * sol = new Solid(extr);
|
Solid * sol = new Solid(extr);
|
||||||
return make_shared<SPSolid> (sol);
|
return make_shared<SPSolid> (sol);
|
||||||
}));
|
}, py::arg("path"), py::arg("profile"), py::arg("d"),
|
||||||
|
R"delimiter(A body of extrusion is defined by its profile
|
||||||
|
(which has to be a closed, clockwiseoriented 2D curve),
|
||||||
|
by a path (a 3D curve) and a vector d. It is constructed
|
||||||
|
as follows: Take a point p on the path and denote the
|
||||||
|
(unit-)tangent of the path in this point by t. If we cut
|
||||||
|
the body by the plane given by p and t as normal vector,
|
||||||
|
the cut is the profile. The profile is oriented by the
|
||||||
|
(local) y-direction `y:=d−(d·t)t` and the (local) x-direction
|
||||||
|
`x:=t \times y`.
|
||||||
|
The following points have to be noticed:
|
||||||
|
* If the path is not closed, then also the body is NOT closed.
|
||||||
|
In this case e.g. planes or orthobricks have to be used to
|
||||||
|
construct a closed body.
|
||||||
|
* The path has to be smooth, i.e. the tangents at the end- resp.
|
||||||
|
start-point of two consecutive spline or line patches have to
|
||||||
|
have the same directions.
|
||||||
|
)delimiter");
|
||||||
m.def("EllipticCone", [](const Point<3>& a, const Vec<3>& v, const Vec<3>& w,
|
m.def("EllipticCone", [](const Point<3>& a, const Vec<3>& v, const Vec<3>& w,
|
||||||
double h, double r)
|
double h, double r)
|
||||||
{
|
{
|
||||||
|
@ -1272,6 +1272,98 @@
|
|||||||
"total_badness": 65897.969985
|
"total_badness": 65897.969985
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"extrusion.geo": [
|
||||||
|
{
|
||||||
|
"angles_tet": [
|
||||||
|
6.6841,
|
||||||
|
171.53
|
||||||
|
],
|
||||||
|
"angles_trig": [
|
||||||
|
11.293,
|
||||||
|
152.07
|
||||||
|
],
|
||||||
|
"ne1d": 172,
|
||||||
|
"ne2d": 286,
|
||||||
|
"ne3d": 241,
|
||||||
|
"quality_histogram": "[0, 0, 7, 56, 39, 22, 0, 0, 0, 0, 2, 0, 5, 18, 18, 29, 21, 10, 9, 5]",
|
||||||
|
"total_badness": 775.80779693
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"angles_tet": [
|
||||||
|
16.097,
|
||||||
|
160.17
|
||||||
|
],
|
||||||
|
"angles_trig": [
|
||||||
|
15.327,
|
||||||
|
149.09
|
||||||
|
],
|
||||||
|
"ne1d": 104,
|
||||||
|
"ne2d": 152,
|
||||||
|
"ne3d": 124,
|
||||||
|
"quality_histogram": "[0, 0, 0, 0, 10, 19, 39, 26, 9, 3, 1, 1, 5, 1, 3, 2, 3, 2, 0, 0]",
|
||||||
|
"total_badness": 353.53219387
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"angles_tet": [
|
||||||
|
11.505,
|
||||||
|
165.94
|
||||||
|
],
|
||||||
|
"angles_trig": [
|
||||||
|
15.054,
|
||||||
|
147.98
|
||||||
|
],
|
||||||
|
"ne1d": 134,
|
||||||
|
"ne2d": 196,
|
||||||
|
"ne3d": 167,
|
||||||
|
"quality_histogram": "[0, 0, 0, 1, 3, 35, 33, 8, 5, 21, 11, 9, 10, 11, 7, 3, 5, 3, 1, 1]",
|
||||||
|
"total_badness": 417.63980201
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"angles_tet": [
|
||||||
|
6.6841,
|
||||||
|
171.53
|
||||||
|
],
|
||||||
|
"angles_trig": [
|
||||||
|
11.293,
|
||||||
|
152.07
|
||||||
|
],
|
||||||
|
"ne1d": 172,
|
||||||
|
"ne2d": 286,
|
||||||
|
"ne3d": 241,
|
||||||
|
"quality_histogram": "[0, 0, 7, 56, 39, 22, 0, 0, 0, 0, 2, 0, 5, 18, 18, 29, 21, 10, 9, 5]",
|
||||||
|
"total_badness": 775.80779693
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"angles_tet": [
|
||||||
|
17.691,
|
||||||
|
140.88
|
||||||
|
],
|
||||||
|
"angles_trig": [
|
||||||
|
18.812,
|
||||||
|
116.06
|
||||||
|
],
|
||||||
|
"ne1d": 276,
|
||||||
|
"ne2d": 570,
|
||||||
|
"ne3d": 646,
|
||||||
|
"quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 17, 30, 51, 51, 55, 81, 69, 74, 73, 72, 52, 12, 5]",
|
||||||
|
"total_badness": 1020.0235117
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"angles_tet": [
|
||||||
|
14.402,
|
||||||
|
155.5
|
||||||
|
],
|
||||||
|
"angles_trig": [
|
||||||
|
24.071,
|
||||||
|
119.03
|
||||||
|
],
|
||||||
|
"ne1d": 442,
|
||||||
|
"ne2d": 1220,
|
||||||
|
"ne3d": 2802,
|
||||||
|
"quality_histogram": "[0, 0, 0, 0, 0, 2, 5, 2, 4, 12, 25, 55, 147, 298, 311, 503, 457, 536, 342, 103]",
|
||||||
|
"total_badness": 3603.431162
|
||||||
|
}
|
||||||
|
],
|
||||||
"fichera.geo": [
|
"fichera.geo": [
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
|
@ -63,8 +63,6 @@ def getMeshingparameters(filename):
|
|||||||
standard = [MeshingParameters()] + [MeshingParameters(ms) for ms in (meshsize.very_coarse, meshsize.coarse, meshsize.moderate, meshsize.fine, meshsize.very_fine)]
|
standard = [MeshingParameters()] + [MeshingParameters(ms) for ms in (meshsize.very_coarse, meshsize.coarse, meshsize.moderate, meshsize.fine, meshsize.very_fine)]
|
||||||
if filename == "shell.geo":
|
if filename == "shell.geo":
|
||||||
return [] # do not test this example cause it needs so long...
|
return [] # do not test this example cause it needs so long...
|
||||||
if filename == "extrusion.geo":
|
|
||||||
return [] # this segfaults right now
|
|
||||||
if filename == "manyholes2.geo":
|
if filename == "manyholes2.geo":
|
||||||
return [standard[1]] # this gets too big for finer meshsizes
|
return [standard[1]] # this gets too big for finer meshsizes
|
||||||
if filename in ("manyholes.geo", "frame.step"):
|
if filename in ("manyholes.geo", "frame.step"):
|
||||||
@ -142,7 +140,11 @@ def generateResultFile():
|
|||||||
continue
|
continue
|
||||||
meshdata = []
|
meshdata = []
|
||||||
for mp in mps:
|
for mp in mps:
|
||||||
mesh = generateMesh(_file, mp)
|
try:
|
||||||
|
mesh = generateMesh(_file, mp)
|
||||||
|
except Exception as e:
|
||||||
|
print("Meshingparameters: ", mp)
|
||||||
|
raise e
|
||||||
meshdata.append( getData(mesh, mp) )
|
meshdata.append( getData(mesh, mp) )
|
||||||
data[_file] = meshdata
|
data[_file] = meshdata
|
||||||
print("needed", time.time() - start, "seconds")
|
print("needed", time.time() - start, "seconds")
|
||||||
|
Loading…
Reference in New Issue
Block a user