0000531: Python API: Mirroring rotated parts produces undesired results

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5296 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer
2011-12-13 18:01:59 +00:00
parent 17fc4285d7
commit b3156069ab
2 changed files with 8 additions and 2 deletions

View File

@@ -84,8 +84,15 @@ App::DocumentObjectExecReturn *Mirroring::execute(void)
Base::Vector3f norm = Normal.getValue();
try {
const TopoDS_Shape& shape = source->Shape.getValue();
gp_Ax2 ax2(gp_Pnt(base.x,base.y,base.z), gp_Dir(norm.x,norm.y,norm.z));
this->Shape.setValue(source->Shape.getShape().mirror(ax2));
gp_Trsf mat;
mat.SetMirror(ax2);
TopLoc_Location loc = shape.Location();
gp_Trsf placement = loc.Transformation();
mat = placement * mat;
BRepBuilderAPI_Transform mkTrf(shape, mat);
this->Shape.setValue(mkTrf.Shape());
return App::DocumentObject::StdReturn;
}
catch (Standard_Failure) {

View File

@@ -1631,7 +1631,6 @@ TopoDS_Shape TopoShape::mirror(const gp_Ax2& ax2) const
mat.SetMirror(ax2);
TopLoc_Location loc = this->_Shape.Location();
gp_Trsf placement = loc.Transformation();
mat = placement * mat;
BRepBuilderAPI_Transform mkTrf(this->_Shape, mat);
return mkTrf.Shape();
}