mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-11 21:50:34 +05:00
history in revolution
This commit is contained in:
parent
44bd81f159
commit
33722fcfd6
@ -506,6 +506,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto NameVertex (string name)
|
||||||
|
{
|
||||||
|
if (!lastvertex.IsNull())
|
||||||
|
OCCGeometry::global_shape_properties[lastvertex.TShape()].name = name;
|
||||||
|
return shared_from_this();
|
||||||
|
}
|
||||||
|
|
||||||
auto Circle (double r)
|
auto Circle (double r)
|
||||||
{
|
{
|
||||||
gp_Pnt2d pos = localpos.Location();
|
gp_Pnt2d pos = localpos.Location();
|
||||||
@ -900,7 +907,18 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
|||||||
.def("Revolve", [](const TopoDS_Shape & shape, const gp_Ax1 &A, const double D) {
|
.def("Revolve", [](const TopoDS_Shape & shape, const gp_Ax1 &A, const double D) {
|
||||||
for (TopExp_Explorer e(shape, TopAbs_FACE); e.More(); e.Next())
|
for (TopExp_Explorer e(shape, TopAbs_FACE); e.More(); e.Next())
|
||||||
{
|
{
|
||||||
return BRepPrimAPI_MakeRevol (shape, A, D*M_PI/180).Shape();
|
// return BRepPrimAPI_MakeRevol (shape, A, D*M_PI/180).Shape();
|
||||||
|
BRepPrimAPI_MakeRevol builder(shape, A, D*M_PI/180);
|
||||||
|
|
||||||
|
for (auto typ : { TopAbs_EDGE, TopAbs_VERTEX })
|
||||||
|
for (TopExp_Explorer e(shape, typ); e.More(); e.Next())
|
||||||
|
{
|
||||||
|
auto prop = OCCGeometry::global_shape_properties[e.Current().TShape()];
|
||||||
|
for (auto mods : builder.Generated(e.Current()))
|
||||||
|
OCCGeometry::global_shape_properties[mods.TShape()].Merge(prop);
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder.Shape();
|
||||||
}
|
}
|
||||||
throw Exception("no face found for revolve");
|
throw Exception("no face found for revolve");
|
||||||
})
|
})
|
||||||
@ -1808,6 +1826,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
|||||||
.def("Circle", [](WorkPlane&wp, double x, double y, double r) {
|
.def("Circle", [](WorkPlane&wp, double x, double y, double r) {
|
||||||
return wp.Circle(x,y,r); }, py::arg("x"), py::arg("y"), py::arg("r"))
|
return wp.Circle(x,y,r); }, py::arg("x"), py::arg("y"), py::arg("r"))
|
||||||
.def("Circle", [](WorkPlane&wp, double r) { return wp.Circle(r); }, py::arg("r"))
|
.def("Circle", [](WorkPlane&wp, double r) { return wp.Circle(r); }, py::arg("r"))
|
||||||
|
.def("NameVertex", &WorkPlane::NameVertex, py::arg("name"))
|
||||||
.def("Offset", &WorkPlane::Offset)
|
.def("Offset", &WorkPlane::Offset)
|
||||||
.def("Reverse", &WorkPlane::Reverse)
|
.def("Reverse", &WorkPlane::Reverse)
|
||||||
.def("Close", &WorkPlane::Close)
|
.def("Close", &WorkPlane::Close)
|
||||||
|
Loading…
Reference in New Issue
Block a user