← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2099: small modify of STLImporterTest.py

 

------------------------------------------------------------
revno: 2099
committer: Sergei D. <sega@think>
branch nick: trunk
timestamp: Tue 2010-03-23 21:06:16 +0300
message:
  small modify of STLImporterTest.py
modified:
  examples/STLImporterTest.py


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

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'examples/STLImporterTest.py'
--- examples/STLImporterTest.py	2009-12-25 14:46:48 +0000
+++ examples/STLImporterTest.py	2010-03-23 18:06:16 +0000
@@ -1,5 +1,6 @@
 #!/usr/local/bin/yade-trunk -x
 # -*- encoding=utf-8 -*-
+import time
 
 ## PhysicalParameters 
 Density=2400
@@ -15,14 +16,14 @@
 from yade import ymport
 fctIds=O.bodies.append(ymport.stl('baraban.stl',color=(1,0,0),material=facetMat))
 ## Spheres
-sphereRadius = 0.2
+sphereRadius = 0.05
 nbSpheres = (10,10,10)
-#nbSpheres = (5,5,5)
+#nbSpheres = (50,50,50)
 for i in xrange(nbSpheres[0]):
     for j in xrange(nbSpheres[1]):
         for k in xrange(nbSpheres[2]):
             x = (i*2 - nbSpheres[0])*sphereRadius*1.1
-            y = j*sphereRadius*2.2
+            y = (j*2 - nbSpheres[1])*sphereRadius*1.1
             z = (k*2 - nbSpheres[2])*sphereRadius*1.1
             s=utils.sphere([x,y,z],sphereRadius,material=sphereMat)
             p=utils.getViscoelasticFromSpheresInteraction(s.state['mass'],tc,en,es)
@@ -53,11 +54,14 @@
 	GravityEngine(gravity=[0,-9.81,0]),
 	## Cundall damping must been disabled!
 	NewtonIntegrator(damping=0),
+## Saving results
+	#VTKRecorder(virtPeriod=0.04,fileName='/tmp/stlimp-',recorders=['spheres','facets']),
 	## Apply kinematics to walls
 	RotationEngine(subscribedBodies=fctIds,rotationAxis=[0,0,1],rotateAroundZero=True,angularVelocity=0.5)
 ]
 
 from yade import qt
 qt.View()
-O.run()
+#O.saveTmp()
+#O.run()