cleaned up some pep8/pyflakes violations

This commit is contained in:
Stephen M. McQuay 2012-03-19 22:18:02 -06:00
parent 303dd9e8d0
commit 62efeb12b3
6 changed files with 18 additions and 12 deletions

View File

@ -1,7 +1,7 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
setup( setup(
name= 'smbsurf', name='smbsurf',
description='', description='',
version='0.0', version='0.0',
packages=find_packages(), packages=find_packages(),

View File

@ -1,6 +1,4 @@
from __future__ import division
import pprint import pprint
import json
''' '''
http://en.wikipedia.org/wiki/Polygon_mesh http://en.wikipedia.org/wiki/Polygon_mesh
@ -96,8 +94,15 @@ class Vertex(object):
self.z = z self.z = z
self.edges = [] self.edges = []
def __eq__(self, other):
if(self.x == other.x and self.y == other.y and self.z == other.z):
return True
else:
return False
def __repr__(self): def __repr__(self):
return "<%.2f, %.2f, %.2f>" % (self.x, self.y, self.z) return "[%.2f, %.2f, %.2f]" % (self.x, self.y, self.z)
def __add__(self, other): def __add__(self, other):
# for now just assume type(other) = Vertex... bad, I know # for now just assume type(other) = Vertex... bad, I know
@ -115,6 +120,7 @@ class Vertex(object):
def __div__(self, other): def __div__(self, other):
# same assumption as __mult__ # same assumption as __mult__
other = float(other)
return Vertex(self.x / other, self.y / other, self.z / other) return Vertex(self.x / other, self.y / other, self.z / other)
class Edge(object): class Edge(object):

View File

@ -1,4 +1,4 @@
from surf.geometry import * from surf.geometry import Vertex, Polygon
def refine(poly): def refine(poly):
''' '''

View File

@ -1,5 +1,6 @@
from surf.geometry import Vertex, Edge, Face, Polygon from surf.geometry import Vertex, Edge, Face, Polygon
def cube(): def cube():
v = [] v = []
v.append(Vertex(0.0, 1.0, 0.0)) v.append(Vertex(0.0, 1.0, 0.0))

View File

@ -1,7 +1,6 @@
from __future__ import division
from surf.geometry import Vertex from surf.geometry import Vertex
v1 = Vertex(0.5, 0.25, 1/3.0) v1 = Vertex(0.5, 0.25, 1 / 3.0)
v2 = Vertex(1, 1, 1) v2 = Vertex(1, 1, 1)
print v1, v2, (v1 + v2) / 2 print v1, v2, (v1 + v2) / 2