Started adding connectivity generation
- also added a test file in the blender folder
This commit is contained in:
parent
15ffd82cad
commit
a45c84c183
1
blender/samples/cube-gimp.json
Normal file
1
blender/samples/cube-gimp.json
Normal file
@ -0,0 +1 @@
|
||||
{"edges": [[4, 5], [5, 1], [1, 0], [0, 4], [5, 6], [6, 2], [2, 1], [6, 7], [7, 3], [3, 2], [7, 4], [0, 3]], "vertices": [[-1.0, -1.0, -1.0], [-1.0, 1.0, -1.0], [1.0, 1.0, -1.0], [1.0, -1.0, -1.0], [-1.0, -1.0, 1.0], [-1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, -1.0, 1.0]], "faces": [[4, 5, 1, 0], [5, 6, 2, 1], [6, 7, 3, 2], [7, 4, 0, 3], [0, 1, 2, 3], [7, 6, 5, 4]]}
|
@ -175,25 +175,30 @@ class PolygonMesh(object):
|
||||
@property
|
||||
def edges_for_face(self):
|
||||
"""returns a list of edge indices for a given face index."""
|
||||
# XXX
|
||||
if self._edges_for_face is None:
|
||||
# TODO: eventually support generating this ourselves ...
|
||||
raise NotImplementedError
|
||||
self._edges_for_face = [[] for i in range(len(self.faces))]
|
||||
|
||||
return self._edges_for_face
|
||||
|
||||
@property
|
||||
def edges_for_vert(self):
|
||||
"""returns a list of edge indices for a given vertex index."""
|
||||
if self._edges_for_vert is None:
|
||||
# TODO: eventually support generating this ourselves ...
|
||||
raise NotImplementedError
|
||||
self._edges_for_vert = [[] for i in range(len(self.vertices))]
|
||||
for i, edge in enumerate(self.edges):
|
||||
for vid in edge:
|
||||
self._edges_for_vert[vid].append(i)
|
||||
return self._edges_for_vert
|
||||
|
||||
@property
|
||||
def faces_for_vert(self):
|
||||
"""returns a list of face indices for a given vert index."""
|
||||
if self._faces_for_vert is None:
|
||||
# TODO: eventually support generating this ourselves ...
|
||||
raise NotImplementedError
|
||||
self._faces_for_vert = [[] for i in range(len(self.vertices))]
|
||||
for i, face in enumerate(self.faces):
|
||||
for vid in face:
|
||||
self._faces_for_vert[vid].append(i)
|
||||
return self._faces_for_vert
|
||||
|
||||
def __unicode__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user