From 14a5128d8d9a1ed4c9f71d6271ab59459498a3b2 Mon Sep 17 00:00:00 2001 From: "Stephen M. McQuay" Date: Tue, 15 May 2012 17:35:00 -0600 Subject: [PATCH] refined the PolygonMesh constructor --- surf/geometry.py | 8 ++++---- surf/subd/cc.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/surf/geometry.py b/surf/geometry.py index 5eeb07c..90de39f 100644 --- a/surf/geometry.py +++ b/surf/geometry.py @@ -133,10 +133,10 @@ class PolygonMesh(object): edges, and faces) ''' - def __init__(self, *args, **kwargs): - self.vertices = [Vertex(*v) for v in kwargs['vertices']] - self.edges = kwargs['edges'] - self.faces = kwargs['faces'] + def __init__(self, vertices, faces, edges=None, **kwargs): + self.vertices = [Vertex(*v) for v in vertices] + self.faces = faces + self.edges = edges # the strategy for the following members involves lazy-instantiating # them if they weren't passing them in: diff --git a/surf/subd/cc.py b/surf/subd/cc.py index a3fdaaf..befbe33 100644 --- a/surf/subd/cc.py +++ b/surf/subd/cc.py @@ -93,6 +93,7 @@ if __name__ == '__main__': from surf.subd.cc import refine input_file_name = sys.argv[1] cube = json.load(open(input_file_name, 'r')) + import pdb; pdb.set_trace() p = PolygonMesh(**cube) q = refine(p) print q