[Bf-extensions-cvs] [b8d9119] master: approach pep8 compliance
zeffii
noreply at git.blender.org
Fri Jul 29 13:39:41 CEST 2016
Commit: b8d91195704bd4d1d430007a47db25a034b1645c
Author: zeffii
Date: Fri Jul 29 13:39:39 2016 +0200
Branches: master
https://developer.blender.org/rBACb8d91195704bd4d1d430007a47db25a034b1645c
approach pep8 compliance
===================================================================
M mesh_tiny_cad/VTX.py
M mesh_tiny_cad/XALL.py
M mesh_tiny_cad/__init__.py
M mesh_tiny_cad/cad_module.py
===================================================================
diff --git a/mesh_tiny_cad/VTX.py b/mesh_tiny_cad/VTX.py
index 69a00cf..1418459 100644
--- a/mesh_tiny_cad/VTX.py
+++ b/mesh_tiny_cad/VTX.py
@@ -76,7 +76,7 @@ def perform_vtx(bm, pt, edges, pts, vertex_indices):
idx1, idx2 = edges[0].index, edges[1].index
fdp = pt, edges, pts, vertex_indices
- # this list will hold those edges that pt lies on,
+ # this list will hold those edges that pt lies on
edges_indices = cm.find_intersecting_edges(bm, pt, idx1, idx2)
mode = 'VTX'[len(edges_indices)]
@@ -106,12 +106,12 @@ def perform_vtx(bm, pt, edges, pts, vertex_indices):
def do_vtx_if_appropriate(bm, edges):
vertex_indices = cm.get_vert_indices_from_bmedges(edges)
-
- # test 1 , are there shared vers? if so return non-viable
+
+ # test 1, are there shared vers? if so return non-viable
if not len(set(vertex_indices)) == 4:
return {'SHARED_VERTEX'}
- # test 2 , is parallel?
+ # test 2, is parallel?
p1, p2, p3, p4 = [bm.verts[i].co for i in vertex_indices]
point = cm.get_intersection([p1, p2], [p3, p4])
if not point:
diff --git a/mesh_tiny_cad/XALL.py b/mesh_tiny_cad/XALL.py
index 4a2e19e..c160539 100644
--- a/mesh_tiny_cad/XALL.py
+++ b/mesh_tiny_cad/XALL.py
@@ -21,7 +21,6 @@
import bpy
import bmesh
-from mathutils import Vector
from mathutils.geometry import intersect_line_line as LineIntersect
import itertools
@@ -33,7 +32,8 @@ def order_points(edge, point_list):
''' order these edges from distance to v1, then
sandwich the sorted list with v1, v2 '''
v1, v2 = edge
- dist = lambda co: (v1 - co).length
+ def dist(co):
+ return (v1 - co).length
point_list = sorted(point_list, key=dist)
return [v1] + point_list + [v2]
diff --git a/mesh_tiny_cad/__init__.py b/mesh_tiny_cad/__init__.py
index 78171fa..4c8e710 100644
--- a/mesh_tiny_cad/__init__.py
+++ b/mesh_tiny_cad/__init__.py
@@ -48,11 +48,9 @@ if "bpy" in locals():
print(E)
-import os
import bpy
from .CFG import TinyCADProperties
-from .CFG import VIEW3D_MT_edit_mesh_tinycad
from .CFG import register_icons, unregister_icons
from . import VTX, V2X, XALL, BIX, CCEN, E2F
diff --git a/mesh_tiny_cad/cad_module.py b/mesh_tiny_cad/cad_module.py
index c84ec58..575a689 100644
--- a/mesh_tiny_cad/cad_module.py
+++ b/mesh_tiny_cad/cad_module.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
-import bpy
import bmesh
from mathutils import Vector, geometry
@@ -126,7 +125,9 @@ def vertex_indices_from_edges_tuple(bm, edge_tuple):
> edge_tuple: contains two edge indices.
< returns the vertex indices of edge_tuple
'''
- k = lambda v, w: bm.edges[edge_tuple[v]].verts[w].index
+ def k(v, w):
+ return bm.edges[edge_tuple[v]].verts[w].index
+
return [k(i >> 1, i % 2) for i in range(4)]
More information about the Bf-extensions-cvs
mailing list