Merge branch 'master' of ssh://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad into sanguinariojoe-ship

This commit is contained in:
Jose Luis Cercós pita
2012-06-21 18:20:47 +02:00
19 changed files with 99 additions and 17 deletions

View File

@@ -2416,16 +2416,17 @@ class _Wire:
for v in shape.Vertexes: p.append(v.Point)
if fp.Points != p: fp.Points = p
elif fp.Base and fp.Tool:
if ('Shape' in fp.Base.PropertiesList) and ('Shape' in fp.Tool.PropertiesList):
sh1 = fp.Base.Shape.copy()
sh2 = fp.Tool.Shape.copy()
shape = sh1.fuse(sh2)
if DraftGeomUtils.isCoplanar(shape.Faces):
shape = DraftGeomUtils.concatenate(shape)
fp.Shape = shape
p = []
for v in shape.Vertexes: p.append(v.Point)
if fp.Points != p: fp.Points = p
if fp.Base.isDerivedFrom("Part::Feature") and fp.Tool.isDerivedFrom("Part::Feature"):
if (not fp.Base.Shape.isNull()) and (not fp.Tool.Shape.isNull()):
sh1 = fp.Base.Shape.copy()
sh2 = fp.Tool.Shape.copy()
shape = sh1.fuse(sh2)
if DraftGeomUtils.isCoplanar(shape.Faces):
shape = DraftGeomUtils.concatenate(shape)
fp.Shape = shape
p = []
for v in shape.Vertexes: p.append(v.Point)
if fp.Points != p: fp.Points = p
elif fp.Points:
if fp.Points[0] == fp.Points[-1]:
if not fp.Closed: fp.Closed = True
@@ -2857,9 +2858,13 @@ class _Clone:
if hasattr(obj,"Scale") and not sh.isNull():
m.scale(obj.Scale)
sh = sh.transformGeometry(m)
shapes.append(sh)
if not sh.isNull():
shapes.append(sh)
if shapes:
obj.Shape = Part.makeCompound(shapes)
if len(shapes) == 1:
obj.Shape = shapes[0]
else:
obj.Shape = Part.makeCompound(shapes)
if not DraftGeomUtils.isNull(pl):
obj.Placement = pl

View File

@@ -6,6 +6,7 @@ SET(Idf_SRCS
SOURCE_GROUP("" FILES ${Idf_SRCS})
SET(IdfLibs_SRCS
lib/License.txt
lib/0603_SMD.stp
lib/0805_SMD.stp
lib/1206_SMD.stp

View File

@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <BRepAlgoAPI_BooleanOperation.hxx>
# include <BRepCheck_Analyzer.hxx>
# include <memory>
#endif
@@ -82,13 +83,20 @@ App::DocumentObjectExecReturn *Boolean::execute(void)
if (resShape.IsNull()) {
return new App::DocumentObjectExecReturn("Resulting shape is invalid");
}
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean");
if (hGrp->GetBool("CheckModel", false)) {
BRepCheck_Analyzer aChecker(resShape);
if (! aChecker.IsValid() ) {
return new App::DocumentObjectExecReturn("Resulting shape is invalid");
}
}
std::vector<ShapeHistory> history;
history.push_back(buildHistory(*mkBool.get(), TopAbs_FACE, resShape, BaseShape));
history.push_back(buildHistory(*mkBool.get(), TopAbs_FACE, resShape, ToolShape));
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean");
if (hGrp->GetBool("RefineModel", false)) {
TopoDS_Shape oldShape = resShape;
BRepBuilderAPI_RefineModel mkRefine(oldShape);

View File

@@ -25,6 +25,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <BRepAlgoAPI_Common.hxx>
# include <BRepCheck_Analyzer.hxx>
# include <Standard_Failure.hxx>
#endif
@@ -112,6 +113,12 @@ App::DocumentObjectExecReturn *MultiCommon::execute(void)
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean");
if (hGrp->GetBool("CheckModel", false)) {
BRepCheck_Analyzer aChecker(resShape);
if (! aChecker.IsValid() ) {
return new App::DocumentObjectExecReturn("Resulting shape is invalid");
}
}
if (hGrp->GetBool("RefineModel", false)) {
TopoDS_Shape oldShape = resShape;
BRepBuilderAPI_RefineModel mkRefine(oldShape);

View File

@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <BRepAlgoAPI_Fuse.hxx>
# include <BRepCheck_Analyzer.hxx>
# include <Standard_Failure.hxx>
#endif
@@ -111,6 +112,12 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void)
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean");
if (hGrp->GetBool("CheckModel", false)) {
BRepCheck_Analyzer aChecker(resShape);
if (! aChecker.IsValid() ) {
return new App::DocumentObjectExecReturn("Resulting shape is invalid");
}
}
if (hGrp->GetBool("RefineModel", false)) {
TopoDS_Shape oldShape = resShape;
BRepBuilderAPI_RefineModel mkRefine(oldShape);

View File

@@ -70,6 +70,7 @@ void DlgSettingsGeneral::saveSettings()
break;
}
ui->checkBooleanRefine->onSave();
ui->checkBooleanCheck->onSave();
}
void DlgSettingsGeneral::loadSettings()
@@ -79,6 +80,7 @@ void DlgSettingsGeneral::loadSettings()
int unit = hGrp->GetInt("Unit", 0);
ui->comboBoxUnits->setCurrentIndex(unit);
ui->checkBooleanRefine->onRestore();
ui->checkBooleanCheck->onRestore();
}
/**

View File

@@ -87,6 +87,19 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="checkBooleanCheck">
<property name="text">
<string>Automatically check model after boolean operation</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>CheckModel</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Part/Boolean</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@@ -108,6 +108,7 @@ SET(Robot_Scripts
RobotExampleTrajectoryOutOfShapes.py
)
if (EXISTS ${CMAKE_SOURCE_DIR}/src/Mod/Robot/Lib/Kuka)
SET(Robot_Resources
Lib/Kuka/kr500_1.wrl
Lib/Kuka/kr500_1.csv
@@ -122,6 +123,7 @@ SET(Robot_Resources
Lib/Kuka/kr_125.csv
Lib/Kuka/kr125_2.pdf
)
endif ()
add_library(Robot SHARED ${Robot_SRCS})
target_link_libraries(Robot ${Robot_LIBS})