From ba721cb0e422906d56917246ae5d8a698b524a32 Mon Sep 17 00:00:00 2001 From: wandererfan Date: Sun, 20 Aug 2023 09:25:33 -0400 Subject: [PATCH] [TD]Fix section of section --- src/Mod/TechDraw/App/DrawUtil.cpp | 2 +- src/Mod/TechDraw/App/DrawViewSection.cpp | 6 ++++-- src/Mod/TechDraw/App/DrawViewSection.h | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawUtil.cpp b/src/Mod/TechDraw/App/DrawUtil.cpp index 4212df5fb8..986c4a43be 100644 --- a/src/Mod/TechDraw/App/DrawUtil.cpp +++ b/src/Mod/TechDraw/App/DrawUtil.cpp @@ -579,7 +579,7 @@ TopoDS_Shape DrawUtil::shapeVectorToCompound(std::vector vecIn, bo } } if (invert) { - return TechDraw::mirrorShape(compOut); + return ShapeUtils::mirrorShape(compOut); } return compOut; } diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index 9c00c6a522..e61946f848 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -278,7 +278,7 @@ TopoDS_Shape DrawViewSection::getShapeToCut() TopoDS_Shape shapeToCut; if (base->getTypeId().isDerivedFrom(TechDraw::DrawViewSection::getClassTypeId())) { dvs = static_cast(base); - shapeToCut = dvs->getCutShape(); + shapeToCut = dvs->getCutShapeRaw(); } else if (base->getTypeId().isDerivedFrom(TechDraw::DrawViewDetail::getClassTypeId())) { dvd = static_cast(base); shapeToCut = dvd->getDetailShape(); @@ -463,7 +463,8 @@ void DrawViewSection::makeSectionCut(const TopoDS_Shape& baseShape) waitingForCut(false); } -//position, scale and rotate shape for buildGeometryObject +//! position, scale and rotate shape for buildGeometryObject +//! save the cut shape for further processing TopoDS_Shape DrawViewSection::prepareShape(const TopoDS_Shape& rawShape, double shapeSize) { // Base::Console().Message("DVS::prepareShape - %s - rawShape.IsNull: %d shapeSize: %.3f\n", @@ -479,6 +480,7 @@ TopoDS_Shape DrawViewSection::prepareShape(const TopoDS_Shape& rawShape, double inputCenter = ShapeUtils::findCentroid(rawShape, m_projectionCS); Base::Vector3d centroid(inputCenter.X(), inputCenter.Y(), inputCenter.Z()); + m_cutShapeRaw = rawShape; preparedShape = ShapeUtils::moveShape(rawShape, centroid * -1.0); m_cutShape = preparedShape; m_saveCentroid = centroid; diff --git a/src/Mod/TechDraw/App/DrawViewSection.h b/src/Mod/TechDraw/App/DrawViewSection.h index afc4230636..5e8982a735 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.h +++ b/src/Mod/TechDraw/App/DrawViewSection.h @@ -153,6 +153,7 @@ public: std::vector getDecodedSpecsFromFile(std::string fileSpec, std::string myPattern); TopoDS_Shape getCutShape() const { return m_cutShape; } + TopoDS_Shape getCutShapeRaw() const { return m_cutShapeRaw; } TopoDS_Shape getShapeForDetail() const override; @@ -182,7 +183,8 @@ protected: int prefCutSurface() const; bool trimAfterCut() const; - TopoDS_Shape m_cutShape; + TopoDS_Shape m_cutShape; // centered, scaled, rotated result of cut + TopoDS_Shape m_cutShapeRaw; // raw result of cut w/o center/scale/rotate void onDocumentRestored() override; void setupObject() override;