Merge branch 'copy_occ_shapes_on_transform' into 'master'

copy shape in BRepBuilderAPI_Transform (to avoid identical TShapes with different locations)

See merge request jschoeberl/netgen!453
This commit is contained in:
Joachim Schöberl 2021-11-26 21:50:00 +00:00
commit 2744d80aa3

View File

@ -794,7 +794,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
// version 1: Transoformation
gp_Trsf trafo;
trafo.SetTranslation(v);
BRepBuilderAPI_Transform builder(shape, trafo);
BRepBuilderAPI_Transform builder(shape, trafo, true);
PropagateProperties(builder, shape);
return builder.Shape();
// version 2: change location
@ -806,7 +806,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
{
gp_Trsf trafo;
trafo.SetRotation(ax, ang*M_PI/180);
BRepBuilderAPI_Transform builder(shape, trafo);
BRepBuilderAPI_Transform builder(shape, trafo, true);
PropagateProperties(builder, shape);
return builder.Shape();
}, py::arg("axis"), py::arg("ang"),
@ -816,7 +816,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
{
gp_Trsf trafo;
trafo.SetMirror(ax.Ax2());
BRepBuilderAPI_Transform builder(shape, trafo);
BRepBuilderAPI_Transform builder(shape, trafo, true);
PropagateProperties(builder, shape);
return builder.Shape();
}, py::arg("axes"),
@ -826,7 +826,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
{
gp_Trsf trafo;
trafo.SetMirror(ax);
BRepBuilderAPI_Transform builder(shape, trafo);
BRepBuilderAPI_Transform builder(shape, trafo, true);
PropagateProperties(builder, shape);
return builder.Shape();
}, py::arg("axes"),
@ -836,7 +836,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
{
gp_Trsf trafo;
trafo.SetScale(p, s);
BRepBuilderAPI_Transform builder(shape, trafo);
BRepBuilderAPI_Transform builder(shape, trafo, true);
PropagateProperties(builder, shape);
return builder.Shape();
}, py::arg("p"), py::arg("s"),