← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3967: UnstructuredGrid: fiexd little bug in manual setting of facet position from vertices

 

------------------------------------------------------------
revno: 3967
committer: Jan Stránský <jan.stransky@xxxxxxxxxxx>
timestamp: Wed 2016-11-09 11:52:00 +0100
message:
  UnstructuredGrid: fiexd little bug in manual setting of facet position from vertices
modified:
  py/utils.py


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'py/utils.py'
--- py/utils.py	2016-09-01 23:20:15 +0000
+++ py/utils.py	2016-11-09 10:52:00 +0000
@@ -1008,7 +1008,7 @@
 			if isinstance(e.shape,Facet):
 				#e.shape.vertices = [self.vertices[j] for j in c]
 				vs = [Vector3(self.vertices[j]) for j in c]
-				cc = sum(vs,Vector3.Zero)/3.
+				cc = inscribedCircleCenter(*vs)
 				for v in vs: v -= cc
 				e.state.pos = cc
 				e.shape.setVertices(vs)