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:
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user