mirror of
https://github.com/NGSolve/netgen.git
synced 2025-04-24 22:32:03 +05:00
allow writing brep in different versions and binary
This commit is contained in:
parent
788c782455
commit
5a66cbee72
@ -14,6 +14,7 @@
|
|||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
|
#include <BinTools_ShapeWriter.hxx>
|
||||||
#include <BOPAlgo_Builder.hxx>
|
#include <BOPAlgo_Builder.hxx>
|
||||||
#include <BOPTools_AlgoTools.hxx>
|
#include <BOPTools_AlgoTools.hxx>
|
||||||
#include <BRepAlgoAPI_Common.hxx>
|
#include <BRepAlgoAPI_Common.hxx>
|
||||||
@ -833,10 +834,25 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
|||||||
.def("WriteStep", [](const TopoDS_Shape & shape, string & filename)
|
.def("WriteStep", [](const TopoDS_Shape & shape, string & filename)
|
||||||
{ step_utils::WriteSTEP(shape, filename); }
|
{ step_utils::WriteSTEP(shape, filename); }
|
||||||
, py::arg("filename"), "export shape in STEP - format")
|
, py::arg("filename"), "export shape in STEP - format")
|
||||||
.def("WriteBrep", [](const TopoDS_Shape & shape, const string& filename)
|
.def("WriteBrep", [](const TopoDS_Shape & shape, const string& filename,
|
||||||
|
bool withTriangles, bool withNormals,
|
||||||
|
optional<int> version, bool binary)
|
||||||
{
|
{
|
||||||
BRepTools::Write(shape, filename.c_str());
|
if(binary)
|
||||||
}, py::arg("filename"), "export shape in BREP - format")
|
{
|
||||||
|
BinTools_FormatVersion v = version ? BinTools_FormatVersion(*version) : BinTools_FormatVersion_CURRENT;
|
||||||
|
BinTools::Write(shape, filename.c_str(), withTriangles, withNormals, v);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TopTools_FormatVersion v = version ? (TopTools_FormatVersion)(*version) : TopTools_FormatVersion_CURRENT;
|
||||||
|
BRepTools::Write(shape, filename.c_str(), withTriangles, withNormals, v);
|
||||||
|
}
|
||||||
|
}, py::arg("filename"), py::arg("withTriangles")=true,
|
||||||
|
py::arg("withNormals")=false,
|
||||||
|
py::arg("version")=py::none(),
|
||||||
|
py::arg("binary")=false,
|
||||||
|
"export shape in BREP - format")
|
||||||
.def("bc", [](const TopoDS_Shape & shape, const string & name)
|
.def("bc", [](const TopoDS_Shape & shape, const string & name)
|
||||||
{
|
{
|
||||||
for (TopExp_Explorer e(shape, TopAbs_FACE); e.More(); e.Next())
|
for (TopExp_Explorer e(shape, TopAbs_FACE); e.More(); e.Next())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user