From 861dc42d333ba44e0d468ab2d72faa53615be9af Mon Sep 17 00:00:00 2001 From: WandererFan Date: Tue, 9 Jan 2018 19:01:10 -0500 Subject: [PATCH] Fix Section Line Wrong Position - Section cut line Y coord needs to be mirrored to be position correctly on Page. --- src/Mod/TechDraw/App/DrawViewPart.cpp | 8 +++++++- src/Mod/TechDraw/App/GeometryObject.cpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index 9055c9da62..7b41e981a8 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -656,7 +656,13 @@ QRectF DrawViewPart::getRect() const //used to project pt (ex SectionOrigin) onto paper plane Base::Vector3d DrawViewPart::projectPoint(const Base::Vector3d& pt) const { - Base::Vector3d centeredPoint = pt - shapeCentroid; + gp_Trsf mirrorTransform; + mirrorTransform.SetMirror( gp_Ax2(gp_Pnt(shapeCentroid.x,shapeCentroid.y,shapeCentroid.z), + gp_Dir(0, -1, 0)) ); + gp_Pnt basePt(pt.x,pt.y,pt.z); + gp_Pnt mirrorGp = basePt.Transformed(mirrorTransform); + Base::Vector3d mirrorPt(mirrorGp.X(),mirrorGp.Y(), mirrorGp.Z()); + Base::Vector3d centeredPoint = mirrorPt - shapeCentroid; Base::Vector3d direction = Direction.getValue(); gp_Ax2 viewAxis = getViewAxis(centeredPoint,direction); HLRAlgo_Projector projector( viewAxis ); diff --git a/src/Mod/TechDraw/App/GeometryObject.cpp b/src/Mod/TechDraw/App/GeometryObject.cpp index d5455ec3a4..283e76d6a4 100644 --- a/src/Mod/TechDraw/App/GeometryObject.cpp +++ b/src/Mod/TechDraw/App/GeometryObject.cpp @@ -555,7 +555,7 @@ TopoDS_Shape TechDrawGeometry::mirrorShape(const TopoDS_Shape &input, gp_Trsf tempTransform; tempTransform.SetScale(inputCenter, scale); gp_Trsf mirrorTransform; - mirrorTransform.SetMirror( gp_Ax2(inputCenter, gp_Dir(0, 1, 0)) ); + mirrorTransform.SetMirror( gp_Ax2(inputCenter, gp_Dir(0, -1, 0)) ); tempTransform.Multiply(mirrorTransform); // Apply that transform to the shape. This should preserve the centre.