mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
create occ geometry from TopoDS_Shape and export constructor
this only works if OCC bindings are done using pybind11!
This commit is contained in:
parent
8926d93e07
commit
fb13152004
@ -40,6 +40,14 @@
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
OCCGeometry::OCCGeometry(const TopoDS_Shape& _shape)
|
||||
{
|
||||
shape = _shape;
|
||||
changed = true;
|
||||
BuildFMap();
|
||||
CalcBoundingBox();
|
||||
}
|
||||
|
||||
string STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * aReader)
|
||||
{
|
||||
const Handle(XSControl_WorkSession)& theSession = aReader->Reader().WS();
|
||||
|
@ -261,6 +261,8 @@ namespace netgen
|
||||
vmap.Clear();
|
||||
}
|
||||
|
||||
OCCGeometry(const TopoDS_Shape& _shape);
|
||||
|
||||
Mesh::GEOM_TYPE GetGeomType() const override
|
||||
{ return Mesh::GEOM_OCC; }
|
||||
|
||||
|
@ -50,6 +50,8 @@ DLL_HEADER void ExportNgOCC(py::module &m)
|
||||
m.attr("occ_version") = OCC_VERSION_COMPLETE;
|
||||
py::class_<OCCGeometry, shared_ptr<OCCGeometry>, NetgenGeometry> (m, "OCCGeometry", R"raw_string(Use LoadOCCGeometry to load the geometry from a *.step file.)raw_string")
|
||||
.def(py::init<>())
|
||||
.def(py::init<const TopoDS_Shape&>(), py::arg("shape"),
|
||||
"Create Netgen OCCGeometry from existing TopoDS_Shape")
|
||||
.def(py::init([] (const string& filename)
|
||||
{
|
||||
shared_ptr<OCCGeometry> geo;
|
||||
|
Loading…
Reference in New Issue
Block a user