mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
shape.Move, Rotate, Mirror
This commit is contained in:
parent
cb5eb98f12
commit
0b926bcbf4
@ -628,6 +628,32 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
|||||||
return props.CentreOfMass();
|
return props.CentreOfMass();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
.def("Move", [](const TopoDS_Shape & shape, const gp_Vec v)
|
||||||
|
{
|
||||||
|
// which one to choose ?
|
||||||
|
// version 1: Transoformation
|
||||||
|
gp_Trsf trafo;
|
||||||
|
trafo.SetTranslation(v);
|
||||||
|
return BRepBuilderAPI_Transform(shape, trafo).Shape();
|
||||||
|
// version 2: change location
|
||||||
|
// ...
|
||||||
|
}, py::arg("v"))
|
||||||
|
|
||||||
|
|
||||||
|
.def("Rotate", [](const TopoDS_Shape & shape, const gp_Ax1 ax, double ang)
|
||||||
|
{
|
||||||
|
gp_Trsf trafo;
|
||||||
|
trafo.SetRotation(ax, ang*M_PI/180);
|
||||||
|
return BRepBuilderAPI_Transform(shape, trafo).Shape();
|
||||||
|
}, py::arg("axis"), py::arg("ang"))
|
||||||
|
|
||||||
|
.def("Mirror", [] (const TopoDS_Shape & shape, const gp_Ax3 & ax)
|
||||||
|
{
|
||||||
|
gp_Trsf trafo;
|
||||||
|
trafo.SetMirror(ax.Ax2());
|
||||||
|
return BRepBuilderAPI_Transform(shape, trafo).Shape();
|
||||||
|
})
|
||||||
|
|
||||||
.def("bc", [](const TopoDS_Shape & shape, const string & name)
|
.def("bc", [](const TopoDS_Shape & shape, const string & name)
|
||||||
{
|
{
|
||||||
for (TopExp_Explorer e(shape, TopAbs_FACE); e.More(); e.Next())
|
for (TopExp_Explorer e(shape, TopAbs_FACE); e.More(); e.Next())
|
||||||
|
Loading…
Reference in New Issue
Block a user