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) 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 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 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) 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; 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)