Merge branch 'master' of https://github.com/FreeCAD/FreeCAD into path_custom_source
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -50,6 +50,7 @@ Eric Trombly (etrombly)
|
||||
Ettore Atalan
|
||||
fandaL
|
||||
flachyjoe
|
||||
Francesco Conti (Pesc0)
|
||||
Федір
|
||||
Gabriel Wicke (gwicke)
|
||||
George Shuklin
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -270,6 +270,8 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna
|
||||
bool resolveLink, bool noElementMap, std::vector<App::DocumentObject*> &linkStack)
|
||||
|
||||
{
|
||||
(void) noElementMap;
|
||||
|
||||
TopoShape shape;
|
||||
|
||||
if(!obj)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user