Merge branch 'master' into patharray_multibase
This commit is contained in:
@@ -737,20 +737,18 @@ class Component(ArchIFC.IfcProduct):
|
||||
base = base.fuse(add)
|
||||
|
||||
elif hasattr(o,'Shape'):
|
||||
if o.Shape:
|
||||
if not o.Shape.isNull():
|
||||
if o.Shape.Solids:
|
||||
s = o.Shape.copy()
|
||||
if placement:
|
||||
s.Placement = s.Placement.multiply(placement)
|
||||
if base:
|
||||
if base.Solids:
|
||||
try:
|
||||
base = base.fuse(s)
|
||||
except Part.OCCError:
|
||||
print("Arch: unable to fuse object ", obj.Name, " with ", o.Name)
|
||||
else:
|
||||
base = s
|
||||
if o.Shape and not o.Shape.isNull() and o.Shape.Solids:
|
||||
s = o.Shape.copy()
|
||||
if placement:
|
||||
s.Placement = s.Placement.multiply(placement)
|
||||
if base:
|
||||
if base.Solids:
|
||||
try:
|
||||
base = base.fuse(s)
|
||||
except Part.OCCError:
|
||||
print("Arch: unable to fuse object ", obj.Name, " with ", o.Name)
|
||||
else:
|
||||
base = s
|
||||
|
||||
# treat subtractions
|
||||
subs = obj.Subtractions
|
||||
@@ -1420,11 +1418,7 @@ class ViewProviderComponent:
|
||||
if hasattr(self,"Object"):
|
||||
c = []
|
||||
if hasattr(self.Object,"Base"):
|
||||
if Draft.getType(self.Object) != "Wall":
|
||||
c = [self.Object.Base]
|
||||
elif Draft.getType(self.Object.Base) == "Space":
|
||||
c = []
|
||||
else:
|
||||
if not (Draft.getType(self.Object) == "Wall" and Draft.getType(self.Object.Base) == "Space"):
|
||||
c = [self.Object.Base]
|
||||
if hasattr(self.Object,"Additions"):
|
||||
c.extend(self.Object.Additions)
|
||||
|
||||
@@ -110,7 +110,7 @@ def mirror(objlist, p1, p2):
|
||||
|
||||
for obj in objlist:
|
||||
mir = App.ActiveDocument.addObject("Part::Mirroring", "mirror")
|
||||
mir.Label = obj.Label + " (" + translate("draft","mirrored" + ")")
|
||||
mir.Label = obj.Label + " (" + translate("draft","mirrored") + ") "
|
||||
mir.Source = obj
|
||||
mir.Base = p1
|
||||
mir.Normal = pnorm
|
||||
|
||||
@@ -258,7 +258,7 @@ class SetAutoGroup(gui_base.GuiCommandSimplest):
|
||||
s = Gui.Selection.getSelection()
|
||||
if len(s) == 1:
|
||||
if (utils.get_type(s[0]) == "Layer") or \
|
||||
- (App.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM").GetBool("AutogroupAddGroups", False)
|
||||
(App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("AutogroupAddGroups", False)
|
||||
and (s[0].isDerivedFrom("App::DocumentObjectGroup")
|
||||
or utils.get_type(s[0]) in ["Site", "Building",
|
||||
"Floor", "BuildingPart"])):
|
||||
@@ -269,7 +269,7 @@ class SetAutoGroup(gui_base.GuiCommandSimplest):
|
||||
# including the options "None" and "Add new layer".
|
||||
self.groups = ["None"]
|
||||
gn = [o.Name for o in self.doc.Objects if utils.get_type(o) == "Layer"]
|
||||
if App.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM").GetBool("AutogroupAddGroups", False):
|
||||
if App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("AutogroupAddGroups", False):
|
||||
gn.extend(groups.get_group_names())
|
||||
if gn:
|
||||
self.groups.extend(gn)
|
||||
|
||||
@@ -79,10 +79,7 @@ class Circle(DraftObject):
|
||||
|
||||
if obj.FirstAngle.Value == obj.LastAngle.Value:
|
||||
shape = Part.Wire(shape)
|
||||
if hasattr(obj,"MakeFace"):
|
||||
if obj.MakeFace:
|
||||
shape = Part.Face(shape)
|
||||
else:
|
||||
if getattr(obj,"MakeFace",True):
|
||||
shape = Part.Face(shape)
|
||||
|
||||
obj.Shape = shape
|
||||
|
||||
@@ -102,10 +102,7 @@ class Wire(DraftObject):
|
||||
if obj.Base.isDerivedFrom("Sketcher::SketchObject"):
|
||||
shape = obj.Base.Shape.copy()
|
||||
if obj.Base.Shape.isClosed():
|
||||
if hasattr(obj,"MakeFace"):
|
||||
if obj.MakeFace:
|
||||
shape = Part.Face(shape)
|
||||
else:
|
||||
if getattr(obj,"MakeFace",True):
|
||||
shape = Part.Face(shape)
|
||||
obj.Shape = shape
|
||||
elif obj.Base and obj.Tool:
|
||||
@@ -126,21 +123,20 @@ class Wire(DraftObject):
|
||||
obj.Points.pop()
|
||||
if obj.Closed and (len(obj.Points) > 2):
|
||||
pts = obj.Points
|
||||
if hasattr(obj,"Subdivisions"):
|
||||
if obj.Subdivisions > 0:
|
||||
npts = []
|
||||
for i in range(len(pts)):
|
||||
p1 = pts[i]
|
||||
npts.append(pts[i])
|
||||
if i == len(pts)-1:
|
||||
p2 = pts[0]
|
||||
else:
|
||||
p2 = pts[i+1]
|
||||
v = p2.sub(p1)
|
||||
v = DraftVecUtils.scaleTo(v,v.Length/(obj.Subdivisions+1))
|
||||
for j in range(obj.Subdivisions):
|
||||
npts.append(p1.add(App.Vector(v).multiply(j+1)))
|
||||
pts = npts
|
||||
if getattr(obj,"Subdivisions",0) > 0:
|
||||
npts = []
|
||||
for i in range(len(pts)):
|
||||
p1 = pts[i]
|
||||
npts.append(pts[i])
|
||||
if i == len(pts)-1:
|
||||
p2 = pts[0]
|
||||
else:
|
||||
p2 = pts[i+1]
|
||||
v = p2.sub(p1)
|
||||
v = DraftVecUtils.scaleTo(v,v.Length/(obj.Subdivisions+1))
|
||||
for j in range(obj.Subdivisions):
|
||||
npts.append(p1.add(App.Vector(v).multiply(j+1)))
|
||||
pts = npts
|
||||
shape = Part.makePolygon(pts+[pts[0]])
|
||||
if "ChamferSize" in obj.PropertiesList:
|
||||
if obj.ChamferSize.Value != 0:
|
||||
@@ -153,10 +149,7 @@ class Wire(DraftObject):
|
||||
if w:
|
||||
shape = w
|
||||
try:
|
||||
if hasattr(obj,"MakeFace"):
|
||||
if obj.MakeFace:
|
||||
shape = Part.Face(shape)
|
||||
else:
|
||||
if getattr(obj,"MakeFace",True):
|
||||
shape = Part.Face(shape)
|
||||
except Part.OCCError:
|
||||
pass
|
||||
@@ -166,18 +159,15 @@ class Wire(DraftObject):
|
||||
lp = obj.Points[0]
|
||||
for p in pts:
|
||||
if not DraftVecUtils.equals(lp,p):
|
||||
if hasattr(obj,"Subdivisions"):
|
||||
if obj.Subdivisions > 0:
|
||||
npts = []
|
||||
v = p.sub(lp)
|
||||
v = DraftVecUtils.scaleTo(v,v.Length/(obj.Subdivisions+1))
|
||||
edges.append(Part.LineSegment(lp,lp.add(v)).toShape())
|
||||
lv = lp.add(v)
|
||||
for j in range(obj.Subdivisions):
|
||||
edges.append(Part.LineSegment(lv,lv.add(v)).toShape())
|
||||
lv = lv.add(v)
|
||||
else:
|
||||
edges.append(Part.LineSegment(lp,p).toShape())
|
||||
if getattr(obj,"Subdivisions",0) > 0:
|
||||
npts = []
|
||||
v = p.sub(lp)
|
||||
v = DraftVecUtils.scaleTo(v,v.Length/(obj.Subdivisions+1))
|
||||
edges.append(Part.LineSegment(lp,lp.add(v)).toShape())
|
||||
lv = lp.add(v)
|
||||
for j in range(obj.Subdivisions):
|
||||
edges.append(Part.LineSegment(lv,lv.add(v)).toShape())
|
||||
lv = lv.add(v)
|
||||
else:
|
||||
edges.append(Part.LineSegment(lp,p).toShape())
|
||||
lp = p
|
||||
|
||||
@@ -297,7 +297,7 @@ def get_movable_children(objectslist, recursive=True):
|
||||
for obj in objectslist:
|
||||
# Skips some objects that should never move their children
|
||||
if utils.get_type(obj) not in ("Clone", "SectionPlane",
|
||||
"Facebinder", "BuildingPart"):
|
||||
"Facebinder", "BuildingPart", "App::Link"):
|
||||
children = obj.OutList
|
||||
if (hasattr(obj, "Proxy") and obj.Proxy
|
||||
and hasattr(obj.Proxy, "getSiblings")
|
||||
|
||||
@@ -159,6 +159,9 @@ By using ";;" to separate paths, you can add several folders here</string>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Displays help tips in the Start workbench Documents tab</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
||||
@@ -356,7 +356,7 @@ std::string DrawViewSpreadsheet::getSheetImage(void)
|
||||
<< " fill=\"" << fcolor << "\">" << celltext << "</text>" << endl;
|
||||
}
|
||||
}
|
||||
rowoffset = rowoffset + cellheight;
|
||||
rowoffset = rowoffset + sheet->getRowHeight(address.row());
|
||||
}
|
||||
result << " </g>" << endl;
|
||||
rowoffset = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user