From d10ca34bf9ce7b56144f41cb65d42d3afd8b0751 Mon Sep 17 00:00:00 2001 From: luz paz Date: Mon, 13 Sep 2021 08:26:13 -0400 Subject: [PATCH] Mesh: remove superfluous whitespace + Improve readability of code --- src/Mod/MeshPart/Gui/MeshFlatteningCommand.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Mod/MeshPart/Gui/MeshFlatteningCommand.py b/src/Mod/MeshPart/Gui/MeshFlatteningCommand.py index ed0d1aec6e..404278f1ad 100644 --- a/src/Mod/MeshPart/Gui/MeshFlatteningCommand.py +++ b/src/Mod/MeshPart/Gui/MeshFlatteningCommand.py @@ -19,7 +19,9 @@ class CreateFlatMesh(BaseCommand): """create flat wires from a meshed face""" def GetResources(self): - return {'Pixmap': 'MeshPart_CreateFlatMesh.svg', 'MenuText': 'Unwrap Mesh', 'ToolTip': 'find a flat representation of a mesh'} + return {'Pixmap': 'MeshPart_CreateFlatMesh.svg', + 'MenuText': 'Unwrap Mesh', + 'ToolTip': 'find a flat representation of a mesh'} def Activated(self): import numpy as np @@ -47,10 +49,12 @@ class CreateFlatMesh(BaseCommand): class CreateFlatFace(BaseCommand): """create a flat face from a single face only full faces are supported right now""" - + def GetResources(self): - return {'Pixmap': 'MeshPart_CreateFlatFace.svg', 'MenuText': 'Unwrap Face', 'ToolTip': 'find a flat representation of a mesh'} - + return {'Pixmap': 'MeshPart_CreateFlatFace.svg', + 'MenuText': 'Unwrap Face', + 'ToolTip': 'find a flat representation of a mesh'} + def Activated(self): import numpy as np import flatmesh @@ -74,12 +78,14 @@ class CreateFlatFace(BaseCommand): bs.setPole(u + 1, v + 1, App.Vector(poles[i])) i += 1 Part.show(bs.toShape()) - + def IsActive(self): assert(super(CreateFlatFace, self).IsActive()) assert(isinstance(Gui.Selection.getSelectionEx()[0].SubObjects[0], Part.Face)) return True + +# Test if pybind11 dependency is available try: import flatmesh Gui.addCommand('MeshPart_CreateFlatMesh', CreateFlatMesh())