mirror of
https://github.com/NGSolve/netgen.git
synced 2025-05-19 00:30:48 +05:00
Added support for using TopoDS_Shape directly
This commit is contained in:
parent
2800d6c291
commit
242fb6caff
@ -1670,6 +1670,23 @@ namespace netgen
|
||||
return occgeo;
|
||||
}
|
||||
|
||||
OCCGeometry *FromOCC (const TopoDS_Shape& s)
|
||||
{
|
||||
OCCGeometry * occgeo;
|
||||
occgeo = new OCCGeometry;
|
||||
|
||||
occgeo->shape = s;
|
||||
|
||||
occgeo->face_colours = Handle_XCAFDoc_ColorTool();
|
||||
occgeo->face_colours.Nullify();
|
||||
occgeo->changed = 1;
|
||||
occgeo->BuildFMap();
|
||||
|
||||
occgeo->CalcBoundingBox();
|
||||
PrintContents (occgeo);
|
||||
|
||||
return occgeo;
|
||||
}
|
||||
|
||||
void OCCGeometry :: Save (string sfilename) const
|
||||
{
|
||||
|
@ -452,6 +452,8 @@ namespace netgen
|
||||
DLL_HEADER OCCGeometry * LoadOCC_IGES (const char * filename);
|
||||
DLL_HEADER OCCGeometry * LoadOCC_STEP (const char * filename);
|
||||
DLL_HEADER OCCGeometry * LoadOCC_BREP (const char * filename);
|
||||
DLL_HEADER OCCGeometry * FromOCC (const TopoDS_Shape& s);
|
||||
|
||||
|
||||
// Philippose - 31.09.2009
|
||||
// External access to the mesh generation functions within the OCC
|
||||
|
@ -65,6 +65,13 @@ DLL_HEADER void ExportNgOCC(py::module &m)
|
||||
return geo;
|
||||
}), py::arg("filename"),
|
||||
"Load OCC geometry from step, brep or iges file")
|
||||
.def(py::init([] ( const TopoDS_Shape* s)
|
||||
{
|
||||
shared_ptr<OCCGeometry> geo;
|
||||
geo.reset(FromOCC(*s));
|
||||
return geo;
|
||||
}), py::arg("shape"),
|
||||
"Load OCC geometry from an existing TopoDS_Shape object")
|
||||
.def(NGSPickle<OCCGeometry>())
|
||||
.def("Glue", &OCCGeometry::GlueGeometry)
|
||||
.def("Heal",[](OCCGeometry & self, double tolerance, bool fixsmalledges, bool fixspotstripfaces, bool sewfaces, bool makesolids, bool splitpartitions)
|
||||
|
Loading…
x
Reference in New Issue
Block a user