Merge remote-tracking branch 'origin/master' into boundarylayer_fixes

This commit is contained in:
Matthias Hochsteger 2024-10-01 13:29:27 +02:00
commit 27e594382d
2 changed files with 14 additions and 2 deletions

View File

@ -73,6 +73,7 @@ DLL_HEADER void ExportNgOCCBasic(py::module &m)
.def(py::init([] (double x, double y, double z) {
return gp_Vec(x, y, z);
}), py::arg("x"), py::arg("y"), py::arg("z"))
.def(py::init([](gp_Dir d) { return gp_Vec(d); }))
.def_property("x", [](gp_Vec&p) { return p.X(); }, [](gp_Vec&p,double x) { p.SetX(x); })
.def_property("y", [](gp_Vec&p) { return p.Y(); }, [](gp_Vec&p,double y) { p.SetY(y); })
.def_property("z", [](gp_Vec&p) { return p.Z(); }, [](gp_Vec&p,double z) { p.SetZ(z); })
@ -368,7 +369,8 @@ DLL_HEADER void ExportNgOCCBasic(py::module &m)
py::implicitly_convertible<py::tuple, gp_Pnt>();
py::implicitly_convertible<py::tuple, gp_Vec>();
py::implicitly_convertible<py::tuple, gp_Dir>();
py::implicitly_convertible<gp_Vec, gp_Dir>();
py::implicitly_convertible<gp_Vec, gp_Dir>();
py::implicitly_convertible<gp_Dir, gp_Vec>();
py::implicitly_convertible<py::tuple, gp_Pnt2d>();
py::implicitly_convertible<py::tuple, gp_Vec2d>();
py::implicitly_convertible<py::tuple, gp_Dir2d>();

View File

@ -22,6 +22,7 @@
#include <BRepAlgo_NormalProjection.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_Transform.hxx>
@ -1406,6 +1407,9 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
BRepLib::BuildCurves3d(edge);
return edge;
}))
.def(py::init([] (const TopoDS_Vertex & v1, const TopoDS_Vertex & v2) {
return BRepBuilderAPI_MakeEdge(v1, v2).Edge();
}))
.def("Value", [](const TopoDS_Edge & e, double s) {
double s0, s1;
auto curve = BRep_Tool::Curve(e, s0, s1);
@ -1671,8 +1675,14 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
py::implicitly_convertible<TopoDS_Shape, TopoDS_Face>();
py::implicitly_convertible<TopoDS_Edge, TopoDS_Wire>();
m.def("MakePolygon", [](std::vector<TopoDS_Vertex> verts)
{
BRepBuilderAPI_MakePolygon builder;
for(auto& v : verts)
builder.Add(v);
return builder.Wire();
});
class ListOfShapesIterator
{