set occparams and generate triangulation with BRepMesh

This commit is contained in:
Christoph Wintersteiger 2017-10-20 16:39:37 +02:00
parent 8f11b84911
commit a90ee2e437
2 changed files with 16 additions and 1 deletions

View File

@ -1137,7 +1137,12 @@ namespace netgen
Handle(Geom_Surface) surf = BRep_Tool::Surface (face);
Handle(Poly_Triangulation) triangulation = BRep_Tool::Triangulation (face, loc);
if (triangulation.IsNull()) continue;
if (triangulation.IsNull())
{
BRepTools::Clean (geom.shape);
BRepMesh_IncrementalMesh (geom.shape, 0.01, true);
triangulation = BRep_Tool::Triangulation (face, loc);
}
BRepAdaptor_Surface sf(face, Standard_True);
BRepLProp_SLProps prop(sf, 2, 1e-5);
@ -1286,6 +1291,10 @@ namespace netgen
int OCCGenerateMesh (OCCGeometry & geom, shared_ptr<Mesh> & mesh, MeshingParameters & mparam)
{
cout << "MeshingParameters: " << mparam << endl;
cout << "OCCParameters: " << endl;
occparam.Print(cout);
multithread.percent = 0;
if (mparam.perfstepsstart <= MESHCONST_ANALYSE)

View File

@ -33,6 +33,12 @@ DLL_HEADER void ExportNgOCC(py::module &m)
SetGlobalMesh(mesh);
mesh->SetGeometry(geo);
ng_geometry = geo;
occparam.resthcloseedgefac = 2.0;
occparam.resthcloseedgeenable = 1;
occparam.resthminedgelen = 0.2;
occparam.resthminedgelenenable = 1;
try
{
geo->GenerateMesh(mesh,param);