CSG - consistent parameters for FindIdenticSurfaces, call it in Draw() before CalcTriangleApproximation

This commit is contained in:
Matthias Hochsteger 2022-07-11 10:43:35 +02:00
parent 69f990d8bf
commit fa05864df4
2 changed files with 4 additions and 2 deletions

View File

@ -949,6 +949,7 @@ namespace netgen
{ {
int inv; int inv;
int nsurf = GetNSurf(); int nsurf = GetNSurf();
identicsurfaces.DeleteData();
isidenticto.SetSize(nsurf); isidenticto.SetSize(nsurf);

View File

@ -676,6 +676,7 @@ However, when r = 0, the top part becomes a point(tip) and meshing fails!
.def("Draw", FunctionPointer .def("Draw", FunctionPointer
([] (shared_ptr<CSGeometry> self) ([] (shared_ptr<CSGeometry> self)
{ {
self->FindIdenticSurfaces(1e-8 * self->MaxSize());
self->CalcTriangleApproximation(0.01, 20); self->CalcTriangleApproximation(0.01, 20);
ng_geometry = self; ng_geometry = self;
}) })
@ -705,8 +706,8 @@ However, when r = 0, the top part becomes a point(tip) and meshing fails!
auto surf = csg_geo->GetSurface(i); auto surf = csg_geo->GetSurface(i);
surfnames.push_back(surf->GetBCName()); surfnames.push_back(surf->GetBCName());
} }
csg_geo->FindIdenticSurfaces(1e-6); csg_geo->FindIdenticSurfaces(1e-8 * csg_geo->MaxSize());
csg_geo->CalcTriangleApproximation(0.01,100); csg_geo->CalcTriangleApproximation(0.01,20);
auto nto = csg_geo->GetNTopLevelObjects(); auto nto = csg_geo->GetNTopLevelObjects();
size_t np = 0; size_t np = 0;
size_t ntrig = 0; size_t ntrig = 0;