diff --git a/src/Mod/TechDraw/App/AppTechDrawPy.cpp b/src/Mod/TechDraw/App/AppTechDrawPy.cpp index 92b353d631..a880a056d5 100644 --- a/src/Mod/TechDraw/App/AppTechDrawPy.cpp +++ b/src/Mod/TechDraw/App/AppTechDrawPy.cpp @@ -612,6 +612,20 @@ private: s = mkTrf.Shape(); writer.exportShape(s); } + //add the cosmetic edges also + std::vector geoms = dvp->getEdgeGeometry(); + std::vector cosmeticEdges; + for (auto& g: geoms) { + if (g->hlrVisible && g->cosmetic) { + cosmeticEdges.push_back(g->occEdge); + } + } + if (!cosmeticEdges.empty()) { + s = TechDraw::mirrorShape(DrawUtil::vectorToCompound(cosmeticEdges)); + mkTrf.Perform(s); + s = mkTrf.Shape(); + writer.exportShape(s); + } } Py::Object writeDXFView(const Py::Tuple& args) diff --git a/src/Mod/TechDraw/App/DrawUtil.cpp b/src/Mod/TechDraw/App/DrawUtil.cpp index 9c25dbe6f7..2fabb84ff1 100644 --- a/src/Mod/TechDraw/App/DrawUtil.cpp +++ b/src/Mod/TechDraw/App/DrawUtil.cpp @@ -801,6 +801,17 @@ bool DrawUtil::isCrazy(TopoDS_Edge e) return result; } +//construct a compound shape from a list of edges +TopoDS_Shape DrawUtil::vectorToCompound(std::vector vecIn) +{ + BRep_Builder builder; + TopoDS_Compound compOut; + builder.MakeCompound(compOut); + for (auto& v : vecIn) { + builder.Add(compOut, v); + } + return compOut; +} //get 3d position of a face's center Base::Vector3d DrawUtil::getFaceCenter(TopoDS_Face f) { diff --git a/src/Mod/TechDraw/App/DrawUtil.h b/src/Mod/TechDraw/App/DrawUtil.h index 08131a5268..26549a3669 100644 --- a/src/Mod/TechDraw/App/DrawUtil.h +++ b/src/Mod/TechDraw/App/DrawUtil.h @@ -79,6 +79,9 @@ class TechDrawExport DrawUtil { double xRange, double yRange) ; static Base::Vector3d vertex2Vector(const TopoDS_Vertex& v); + + static TopoDS_Shape vectorToCompound(std::vector vecIn); + static std::string formatVector(const Base::Vector3d& v); static std::string formatVector(const gp_Dir& v); static std::string formatVector(const gp_Dir2d& v);