opencascade-sys 0.3.0

Rust bindings to the OpenCascade CAD Kernel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <BinTools.hxx>
#include <TopoDS_Shape.hxx>
#include <bindings_common.hxx>

inline bool write_brep_bin(const TopoDS_Shape &shape, rust::String path) {
  return BinTools::Write(shape, path.c_str());
}

inline std::unique_ptr<TopoDS_Shape> read_brep_bin(rust::String path) {
  auto shape = std::unique_ptr<TopoDS_Shape>(new TopoDS_Shape());

  if (BinTools::Read(*shape, path.c_str())) {
    return shape;
  } else {
    return std::unique_ptr<TopoDS_Shape>(nullptr);
  }
}