← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3894: Scale mass and inertia in spheresModify.

 

------------------------------------------------------------
revno: 3894
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Fri 2016-06-10 10:23:52 +0200
message:
  Scale mass and inertia in spheresModify.
  
  Thanks to Klichowicz Michael for finding the bug.
modified:
  py/bodiesHandling.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/bodiesHandling.py'
--- py/bodiesHandling.py	2015-04-24 15:54:07 +0000
+++ py/bodiesHandling.py	2016-06-10 08:23:52 +0000
@@ -217,6 +217,8 @@
 		
 		b.state.pos=orientation*(b.state.pos-dims['center'])+dims['center']
 		b.shape.radius*=scale
+		b.state.mass*=pow(scale, 3)
+		b.state.inertia*=pow(scale, 5)
 		b.state.pos=(b.state.pos-dims['center'])*scale + dims['center']
 		
 		b.state.pos+=shift