2d drawing

This commit is contained in:
Joachim Schoeberl 2021-09-09 14:12:06 +02:00
parent 93d3a7ce4b
commit 6a6a98dcea
2 changed files with 22 additions and 0 deletions

View File

@ -1544,6 +1544,21 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
.def_property_readonly("end", [](Handle(Geom2d_Curve) curve) {
return curve->Value(curve->LastParameter());
})
.def("Edge", [](Handle(Geom2d_Curve) curve) {
// Geom_Plane surf{gp_Ax3()};
auto surf = new Geom_Plane{gp_Ax3()};
auto edge = BRepBuilderAPI_MakeEdge(curve, surf).Edge();
BRepLib::BuildCurves3d(edge);
return edge;
})
.def("Face", [](Handle(Geom2d_Curve) curve) {
// static surf = new Geom_Plane{gp_Ax3()};
static Geom_Plane surf{gp_Ax3()};
auto edge = BRepBuilderAPI_MakeEdge(curve, &surf).Edge();
BRepLib::BuildCurves3d(edge);
auto wire = BRepBuilderAPI_MakeWire(edge).Wire();
return BRepBuilderAPI_MakeFace(wire).Face();
})
;

View File

@ -19,3 +19,10 @@ gp_Ax1 = Axis
Translation = gp_Trsf.Translation
Rotation = gp_Trsf.Rotation
Mirror = gp_Trsf.Mirror
wp2d = WorkPlane()
def Rectangle(l,w): return wp2d.Rectangle(l,w)
def MoveTo(x,y): return wp2d.MoveTo(x,y)
def LineTo(x,y): return wp2d.LineTo(x,y)
def Line(l): return wp2d.Line(l)