From 4718c46170c3d76d79ef5f02eae6b2724475e1e1 Mon Sep 17 00:00:00 2001 From: tetektoza Date: Sun, 26 Oct 2025 12:50:00 +0100 Subject: [PATCH] TechDraw: Fix centerlines being double Y-axis transformed As the title says. Currently when user exports to DXF, centerlines and cosmetic edges appeared offset below their correct positions. The offset was visible when opening exported DXF file in CAD software - centerlines were displaced downward where they should be. The issue was that cosmetic edges are already stored with the correct Y orientation and should not be mirrored during export, so this caused centerlines to be mirrored when they shouldn't be, resulting in incorrect Y position. So this is just a small modification to cosmetic edge export to skip the Y-axis mirroring step. --- src/Mod/TechDraw/App/AppTechDrawPy.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Mod/TechDraw/App/AppTechDrawPy.cpp b/src/Mod/TechDraw/App/AppTechDrawPy.cpp index 10926ef699..695744ff43 100644 --- a/src/Mod/TechDraw/App/AppTechDrawPy.cpp +++ b/src/Mod/TechDraw/App/AppTechDrawPy.cpp @@ -629,7 +629,7 @@ private: shape = mkTrf.Shape(); writer.exportShape(shape); } - //add the cosmetic edges also + //add the cosmetic edges also (centerlines, cosmetic lines, etc) std::vector geoms = dvp->getEdgeGeometry(); std::vector cosmeticEdges; for (auto& g : geoms) { @@ -638,9 +638,14 @@ private: } } if (!cosmeticEdges.empty()) { - shape = ShapeUtils::mirrorShape(DrawUtil::vectorToCompound(cosmeticEdges)); - mkTrf.Perform(shape); - shape = mkTrf.Shape(); + // cosmetic edges (centerlines, etc) are already in correct Y orientation + // so they only need translation, not mirroring like the regular geometry + // issue #22470 + shape = DrawUtil::vectorToCompound(cosmeticEdges); + gp_Trsf xLateCosmetics; + xLateCosmetics.SetTranslation(gp_Vec(dvpX, dvpY, 0.0)); + BRepBuilderAPI_Transform mkTrfCosmetics(shape, xLateCosmetics); + shape = mkTrfCosmetics.Shape(); writer.exportShape(shape); } }