From c6c4a0677814044ce0258cfd10d1a5780a47006d Mon Sep 17 00:00:00 2001 From: ageeye <5332429+ageeye@users.noreply.github.com> Date: Sun, 10 Jun 2018 17:03:42 +0200 Subject: [PATCH] Add sew function to the draft facebinder. Besides facebinder and patharray get their own icons in the tree view. --- src/Mod/Draft/Draft.py | 13 +- src/Mod/Draft/Resources/Draft.qrc | 1 + .../icons/Draft_Facebinder_Provider.svg | 580 ++++++++++++++++++ 3 files changed, 593 insertions(+), 1 deletion(-) create mode 100644 src/Mod/Draft/Resources/icons/Draft_Facebinder_Provider.svg diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index e449613c68..ee633cd7af 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -6241,7 +6241,9 @@ class _ViewProviderDraftArray(_ViewProviderDraft): _ViewProviderDraft.__init__(self,vobj) def getIcon(self): - return ":/icons/Draft_Array.svg" + if hasattr(self.vobj.Object,"ArrayType"): + return ":/icons/Draft_Array.svg" + return ":/icons/Draft_PathArray.svg" def resetColors(self, vobj): colors = [] @@ -6419,6 +6421,8 @@ class _Facebinder(_DraftObject): obj.addProperty("App::PropertyLinkSubList","Faces","Draft",QT_TRANSLATE_NOOP("App::Property","Linked faces")) obj.addProperty("App::PropertyBool","RemoveSplitter","Draft",QT_TRANSLATE_NOOP("App::Property","Specifies if splitter lines must be removed")) obj.addProperty("App::PropertyDistance","Extrusion","Draft",QT_TRANSLATE_NOOP("App::Property","An optional extrusion value to be applied to all faces")) + obj.addProperty("App::PropertyBool","Sew","Draft",QT_TRANSLATE_NOOP("App::Property","This specifies if the shapes sew")) + def execute(self,obj): import Part @@ -6451,6 +6455,10 @@ class _Facebinder(_DraftObject): if not sh: sh = faces.pop() sh = sh.multiFuse(faces) + if hasattr(obj,"Sew"): + if obj.Sew: + sh = sh.copy() + sh.sewShape() if hasattr(obj,"RemoveSplitter"): if obj.RemoveSplitter: sh = sh.removeSplitter() @@ -6488,6 +6496,9 @@ class _ViewProviderFacebinder(_ViewProviderDraft): def __init__(self,vobj): _ViewProviderDraft.__init__(self,vobj) + def getIcon(self): + return ":/icons/Draft_Facebinder_Provider.svg" + def setEdit(self,vobj,mode): import DraftGui taskd = DraftGui.FacebinderTaskPanel() diff --git a/src/Mod/Draft/Resources/Draft.qrc b/src/Mod/Draft/Resources/Draft.qrc index bc014572b3..d6135fa1df 100644 --- a/src/Mod/Draft/Resources/Draft.qrc +++ b/src/Mod/Draft/Resources/Draft.qrc @@ -66,6 +66,7 @@ icons/Draft_Ellipse.svg icons/Draft_ShapeString.svg icons/Draft_Facebinder.svg + icons/Draft_Facebinder_Provider.svg icons/Draft_FlipDimension.svg icons/Draft_Mirror.svg icons/Draft_Grid.svg diff --git a/src/Mod/Draft/Resources/icons/Draft_Facebinder_Provider.svg b/src/Mod/Draft/Resources/icons/Draft_Facebinder_Provider.svg new file mode 100644 index 0000000000..b2ad2e7d0c --- /dev/null +++ b/src/Mod/Draft/Resources/icons/Draft_Facebinder_Provider.svg @@ -0,0 +1,580 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Draft_Facebinder + + Thu Oct 10 19:25:33 2013 -0300 + + + [Yorik van Havre] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + FreeCAD/src/Mod/Draft/Resources/icons/Draft_ + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + [agryson] Alexander Gryson + + + + + polygon + + + A large polygon to the left with two smaller adjacent polygons to the right. + + + +