This commit is contained in:
Stephen M. McQuay 2012-03-19 10:45:13 -06:00
commit 6a69a99706

View File

@ -301,25 +301,38 @@ class Polygon(object):
for vertex in edge.vertices:
vertices.append(vertex)
newVertices = []
for vertex in self.vertices:
faceVertices = []
edgeMidPoints = []
for edge in vertex.edges:
print edge.midPoint
edgeMidPoints.append(edge.midPoint)
for face in edge.faces:
print face.centroid
faceVertices.append(face.centroid)
print edgeMidPoints
print vertex
print faceVertices
f = sum(list(set(faceVertices)), Vertex())/len(list(set(faceVertices)))
# print f
r = sum(list(set(edgeMidPoints)), Vertex())/len(list(set(edgeMidPoints)))
# print r
p = vertex
# print p
n = len(vertex.edges)
v = (f + (2.0 * r) + (n - 3.0) * p) / n
# print n
v = (f + 2.0 * r + (n - 3.0) * p) / n
# print v
vertex.x = v.x
vertex.y = v.y
vertex.z = v.z
# print v
newVertices.append(v)
for vertex, newVertex in zip(self.vertices, newVertices):
vertex.x = newVertex.x
vertex.y = newVertex.y
vertex.z = newVertex.z
# so now what.........
# (F + 2R + (n-3) P) / n
#