cleaned up some pep8/pyflakes violations
This commit is contained in:
parent
303dd9e8d0
commit
62efeb12b3
@ -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):
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from surf.geometry import *
|
from surf.geometry import Vertex, Polygon
|
||||||
|
|
||||||
def refine(poly):
|
def refine(poly):
|
||||||
'''
|
'''
|
||||||
|
@ -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))
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user