From f20ea86d137fb7e48bb157a2b755d6be80ca2d4c Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Tue, 27 Jun 2023 11:16:02 +0200 Subject: [PATCH 1/6] Draft: Add macOS paths to importDWG.py --- src/Mod/Draft/importDWG.py | 40 +++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/Mod/Draft/importDWG.py b/src/Mod/Draft/importDWG.py index 967040a839..a33b0e3963 100644 --- a/src/Mod/Draft/importDWG.py +++ b/src/Mod/Draft/importDWG.py @@ -135,8 +135,8 @@ def export(objectslist, filename): def get_libredwg_converter(typ): """Find the LibreDWG converter. - It searches the FreeCAD parameters database, then searches the OS search path - on Linux and Windows systems. There are no standard installation paths. + It searches the FreeCAD parameters database, then searches the OS search path. + There are no standard installation paths. `typ` is required because LibreDWG uses two converters and we store only one. @@ -161,14 +161,14 @@ def get_libredwg_converter(typ): path = os.path.dirname(path) + "/" + typ + os.path.splitext(path)[1] if os.path.exists(path) and os.path.isfile(path): return path - elif platform.system() == "Linux": - for sub in os.getenv("PATH").split(":"): - path = sub + "/" + typ + elif platform.system() == "Windows": + for sub in os.getenv("PATH").split(os.pathsep): + path = sub.replace("\\", "/") + "/" + typ + ".exe" if os.path.exists(path) and os.path.isfile(path): return path - elif platform.system() == "Windows": - for sub in os.getenv("PATH").split(";"): - path = sub.replace("\\", "/") + "/" + typ + ".exe" + else: # for Linux and macOS + for sub in os.getenv("PATH").split(os.pathsep): + path = sub + "/" + typ if os.path.exists(path) and os.path.isfile(path): return path @@ -178,8 +178,7 @@ def get_libredwg_converter(typ): def get_oda_converter(): """Find the ODA converter. - It searches the FreeCAD parameters database, then searches for common - paths on Linux and Windows systems. + It searches the FreeCAD parameters database, then searches for common paths. Parameters ---------- @@ -199,10 +198,6 @@ def get_oda_converter(): if "ODAFileConverter" in path: # path set manually if os.path.exists(path) and os.path.isfile(path): return path - elif platform.system() == "Linux": - path = "/usr/bin/ODAFileConverter" - if os.path.exists(path) and os.path.isfile(path): - return path elif platform.system() == "Windows": odadir = os.path.expandvars("%ProgramFiles%\\ODA").replace("\\", "/") if os.path.exists(odadir): @@ -210,6 +205,14 @@ def get_oda_converter(): path = odadir + "/" + sub + "/" + "ODAFileConverter.exe" if os.path.exists(path) and os.path.isfile(path): return path + elif platform.system() == "Linux": + path = "/usr/bin/ODAFileConverter" + if os.path.exists(path) and os.path.isfile(path): + return path + else: # for macOS + path = "/Applications/ODAFileConverter.app/Contents/MacOS/ODAFileConverter" + if os.path.exists(path) and os.path.isfile(path): + return path return None @@ -217,8 +220,7 @@ def get_oda_converter(): def get_qcad_converter(): """Find the QCAD converter. - It searches the FreeCAD parameters database, then searches for common - paths on Linux and Windows systems. + It searches the FreeCAD parameters database, then searches for common paths. Parameters ---------- @@ -237,6 +239,8 @@ def get_qcad_converter(): if "dwg2dwg" in path: # path set manually pass + elif platform.system() == "Windows": + path = os.path.expandvars("%ProgramFiles%\\QCAD\\dwg2dwg.bat").replace("\\", "/") elif platform.system() == "Linux": # /home/$USER/opt/qcad-3.28.1-trial-linux-qt5.14-x86_64/dwg2dwg path = os.path.expandvars("/home/$USER/opt") @@ -244,8 +248,8 @@ def get_qcad_converter(): if "qcad" in sub: path = path + "/" + sub + "/" + "dwg2dwg" break - elif platform.system() == "Windows": - path = os.path.expandvars("%ProgramFiles%\\QCAD\\dwg2dwg.bat").replace("\\", "/") + else: # for macOS + path = "/Applications/QCAD.app/Contents/Resources/dwg2dwg" if os.path.exists(path) and os.path.isfile(path): return path From 0bd56851acbcc341437053cfe6b940ad51a2363b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Insaurralde=20Avalos?= <36372335+adrianinsaval@users.noreply.github.com> Date: Tue, 27 Jun 2023 13:49:16 -0400 Subject: [PATCH 2/6] update libpack download hint [skip ci] --- cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake b/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake index c0d98a2517..ed66121d38 100644 --- a/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake +++ b/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake @@ -54,7 +54,7 @@ macro(InitializeFreeCADBuildOptions) endif() else() message("Libpack NOT found.\nIf you intend to use a Windows libpack, set the FREECAD_LIBPACK_DIR to the libpack directory.") - message(STATUS "Visit: https://github.com/apeltauer/FreeCAD/releases/ for Windows libpack downloads.") + message(STATUS "Visit: https://github.com/FreeCAD/FreeCAD-Libpack/releases/ for Windows libpack downloads.") endif() else(MSVC) option(FREECAD_LIBPACK_USE "Use the LibPack to Build FreeCAD (only Win32 so far)." OFF) From 45141df33e2b7b2d206bf71ec76d7c666a76f32b Mon Sep 17 00:00:00 2001 From: Pesc0 Date: Wed, 28 Jun 2023 16:01:46 +0200 Subject: [PATCH 3/6] Add Pesc0 to contributors --- src/Doc/CONTRIBUTORS | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Doc/CONTRIBUTORS b/src/Doc/CONTRIBUTORS index 3007bd167a..f2d9bada42 100644 --- a/src/Doc/CONTRIBUTORS +++ b/src/Doc/CONTRIBUTORS @@ -50,6 +50,7 @@ Eric Trombly (etrombly) Ettore Atalan fandaL flachyjoe +Francesco Conti (Pesc0) Федір Gabriel Wicke (gwicke) George Shuklin From f44fa7a835a1e03ed5d57acc4f4e8b4d1f1d6b5a Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 14 May 2023 18:12:50 +0200 Subject: [PATCH 4/6] Part: fixes #5967: Weird behavior in Placement dialog when using "center of mass" with Datum Plane --- src/Mod/Part/App/TopoShape.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 98a6428d0b..36ce36688a 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -1223,6 +1223,9 @@ bool TopoShape::getCenterOfGravity(Base::Vector3d& center) const // Computing of CentreOfMass GProp_GProps prop; if (getShapeProperties(_Shape, prop)) { + if (prop.Mass() > Precision::Infinite()) { + return false; + } gp_Pnt pnt = prop.CentreOfMass(); center.Set(pnt.X(), pnt.Y(), pnt.Z()); return true; From 7633b3ce93b74b8a27c8ac581a021ae5b6344829 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 29 May 2023 05:36:27 +0200 Subject: [PATCH 5/6] Unused variable --- src/Mod/Part/App/PartFeature.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/Part/App/PartFeature.cpp b/src/Mod/Part/App/PartFeature.cpp index 3453ad1515..fffa371a18 100644 --- a/src/Mod/Part/App/PartFeature.cpp +++ b/src/Mod/Part/App/PartFeature.cpp @@ -270,6 +270,8 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna bool resolveLink, bool noElementMap, std::vector &linkStack) { + (void) noElementMap; + TopoShape shape; if(!obj) From 35cedd6270b40c1587a07f4dedaf88ee13319e1b Mon Sep 17 00:00:00 2001 From: wandererfan Date: Thu, 29 Jun 2023 18:20:29 -0400 Subject: [PATCH 6/6] [TD]fix missing section svg hatch in pdf --- src/Mod/TechDraw/Gui/MDIViewPage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.cpp b/src/Mod/TechDraw/Gui/MDIViewPage.cpp index 6049aafcc7..15467bc1d1 100644 --- a/src/Mod/TechDraw/Gui/MDIViewPage.cpp +++ b/src/Mod/TechDraw/Gui/MDIViewPage.cpp @@ -288,7 +288,9 @@ void MDIViewPage::printPdf() Gui::WaitCursor wc; std::string utf8Content = fn.toUtf8().constData(); + m_scene->setExporting(true); printPdf(utf8Content); + m_scene->setExporting(false); } void MDIViewPage::printPdf(std::string file)