refined the PolygonMesh constructor

This commit is contained in:
Stephen M. McQuay 2012-05-15 17:35:00 -06:00
parent 66a688fa75
commit 14a5128d8d
2 changed files with 5 additions and 4 deletions

View File

@ -133,10 +133,10 @@ class PolygonMesh(object):
edges, and faces) edges, and faces)
''' '''
def __init__(self, *args, **kwargs): def __init__(self, vertices, faces, edges=None, **kwargs):
self.vertices = [Vertex(*v) for v in kwargs['vertices']] self.vertices = [Vertex(*v) for v in vertices]
self.edges = kwargs['edges'] self.faces = faces
self.faces = kwargs['faces'] self.edges = edges
# the strategy for the following members involves lazy-instantiating # the strategy for the following members involves lazy-instantiating
# them if they weren't passing them in: # them if they weren't passing them in:

View File

@ -93,6 +93,7 @@ if __name__ == '__main__':
from surf.subd.cc import refine from surf.subd.cc import refine
input_file_name = sys.argv[1] input_file_name = sys.argv[1]
cube = json.load(open(input_file_name, 'r')) cube = json.load(open(input_file_name, 'r'))
import pdb; pdb.set_trace()
p = PolygonMesh(**cube) p = PolygonMesh(**cube)
q = refine(p) q = refine(p)
print q print q