Arch: minor cosmetic changes in Draft & Arch preferences pages

This commit is contained in:
Yorik van Havre
2016-12-03 12:50:18 -02:00
parent 400bd11715
commit 8fc41bd9dd
5 changed files with 406 additions and 13 deletions

View File

@@ -278,9 +278,12 @@ class _Panel(ArchComponent.Component):
obj.addProperty("App::PropertyAngle","WaveDirection","Arch", QT_TRANSLATE_NOOP("App::Property","The direction of waves for corrugated elements"))
obj.addProperty("App::PropertyEnumeration","WaveType","Arch", QT_TRANSLATE_NOOP("App::Property","The type of waves for corrugated elements"))
obj.addProperty("App::PropertyArea","Area","Arch", QT_TRANSLATE_NOOP("App::Property","The area of this panel"))
obj.addProperty("App::PropertyEnumeration","FaceMaker","Arch",QT_TRANSLATE_NOOP("App::Property","The facemaker type to use to build the profile of this object"))
obj.addProperty("App::PropertyVector","Normal","Arch",QT_TRANSLATE_NOOP("App::Property","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)"))
obj.Sheets = 1
self.Type = "Panel"
obj.WaveType = ["Curved","Trapezoidal"]
obj.FaceMaker = ["None","Simple","Cheese","Bullseye"]
obj.setEditorMode("VerticalArea",2)
obj.setEditorMode("HorizontalArea",2)
@@ -322,6 +325,11 @@ class _Panel(ArchComponent.Component):
pl = obj.Placement
base = None
normal = None
if hasattr(obj,"Normal"):
if obj.Normal.Length > 0:
normal = Vector(obj.Normal)
normal.normalize()
normal.multiply(thickness)
baseprofile = None
if obj.Base:
base = obj.Base.Shape.copy()
@@ -329,17 +337,29 @@ class _Panel(ArchComponent.Component):
p = FreeCAD.Placement(obj.Base.Placement)
if base.Faces:
baseprofile = base
normal = baseprofile.Faces[0].normalAt(0,0).multiply(thickness)
if not normal:
normal = baseprofile.Faces[0].normalAt(0,0).multiply(thickness)
base = base.extrude(normal)
elif base.Wires:
closed = True
for w in base.Wires:
if not w.isClosed():
closed = False
if closed:
baseprofile = ArchCommands.makeFace(base.Wires)
normal = baseprofile.normalAt(0,0).multiply(thickness)
base = baseprofile.extrude(normal)
fm = False
if hasattr(obj,"FaceMaker"):
if obj.FaceMaker != "None":
try:
base = Part.makeFace(base.Wires,"Part::FaceMaker"+str(obj.FaceMaker))
fm = True
except:
FreeCAD.Console.PrintError(translate("Arch","Facemaker returned an error")+"\n")
return
if not fm:
closed = True
for w in base.Wires:
if not w.isClosed():
closed = False
if closed:
baseprofile = ArchCommands.makeFace(base.Wires)
if not normal:
normal = baseprofile.normalAt(0,0).multiply(thickness)
base = baseprofile.extrude(normal)
elif obj.Base.isDerivedFrom("Mesh::Feature"):
if obj.Base.Mesh.isSolid():
if obj.Base.Mesh.countComponents() == 1:
@@ -347,7 +367,8 @@ class _Panel(ArchComponent.Component):
if sh.isClosed() and sh.isValid() and sh.Solids:
base = sh
else:
normal = Vector(0,0,1).multiply(thickness)
if not normal:
normal = Vector(0,0,1).multiply(thickness)
l2 = length/2 or 0.5
w2 = width/2 or 0.5
v1 = Vector(-l2,-w2,0)
@@ -457,6 +478,10 @@ class _ViewProviderPanel(ArchComponent.ViewProviderComponent):
def getIcon(self):
import Arch_rc
if hasattr(self,"Object"):
if hasattr(self.Object,"CloneOf"):
if self.Object.CloneOf:
return ":/icons/Arch_Panel_Clone.svg"
return ":/icons/Arch_Panel_Tree.svg"

View File

@@ -44,6 +44,7 @@
<file>icons/Arch_Frame_Tree.svg</file>
<file>icons/Arch_Panel.svg</file>
<file>icons/Arch_Panel_Tree.svg</file>
<file>icons/Arch_Panel_Clone.svg</file>
<file>icons/Arch_Equipment.svg</file>
<file>icons/Arch_Equipment_Tree.svg</file>
<file>icons/Arch_Equipment_Clone.svg</file>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -2690,7 +2690,7 @@ def clone(obj,delta=None):
linked copy of the given object. If the original object changes, the final object
changes too. Optionally, you can give a delta Vector to move the clone from the
original position.'''
prefix = getParam("ClonePrefix","Clone of")
prefix = getParam("ClonePrefix","")
if prefix:
prefix = prefix.strip()+" "
if not isinstance(obj,list):

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>487</width>
<height>474</height>
<height>489</height>
</rect>
</property>
<property name="windowTitle">
@@ -370,7 +370,7 @@ Values with differences below this value will be treated as same.</string>
<item>
<widget class="Gui::PrefLineEdit" name="lineEdit">
<property name="text">
<string>Clone of</string>
<string/>
</property>
<property name="prefEntry" stdset="0">
<cstring>ClonePrefix</cstring>