Fixed bug in CC corner updates.

This commit is contained in:
willblatt 2012-03-19 09:44:01 -07:00
parent 805edfe12f
commit cabb79b269
1 changed files with 18 additions and 5 deletions

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)
f = sum(list(set(faceVertices)), Vertex())/len(list(set(faceVertices)))
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
#