a first step-writer

This commit is contained in:
Joachim Schoeberl 2021-09-02 23:18:54 +02:00
parent 2a4eaa60cd
commit ed2b67f5bd

View File

@ -56,6 +56,7 @@
#include <BOPTools_AlgoTools.hxx>
#include <IntTools_Context.hxx>
#include <STEPControl_Writer.hxx>
#include <python_occ.hpp>
@ -734,6 +735,15 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
// ...
}, py::arg("p"), py::arg("s"))
.def("WriteStep", [](TopoDS_Shape shape, string filename)
{
STEPControl_Writer writer;
writer.Transfer(shape, STEPControl_ManifoldSolidBrep);
// Translates TopoDS_Shape into manifold_solid_brep entity
writer.Write(filename.c_str());
})
.def("bc", [](const TopoDS_Shape & shape, const string & name)
{
for (TopExp_Explorer e(shape, TopAbs_FACE); e.More(); e.Next())