← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3968: Add orientation parameter to ymport.textClumps

 

------------------------------------------------------------
revno: 3968
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Tue 2014-05-20 08:35:16 +0200
message:
  Add orientation parameter to ymport.textClumps
modified:
  py/ymport.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/ymport.py'
--- py/ymport.py	2014-05-16 16:33:34 +0000
+++ py/ymport.py	2014-05-20 06:35:16 +0000
@@ -48,7 +48,7 @@
 			raise RuntimeError("Please, specify a correct format output!");
 	return ret
   
-def textClumps(fileName,shift=Vector3.Zero,discretization=0,scale=1.0,**kw):
+def textClumps(fileName,shift=Vector3.Zero,discretization=0,orientation=Quaternion.Identity,scale=1.0,**kw):
 	"""Load clumps-members from file, insert them to the simulation.
 	
 	:param str filename: file name
@@ -71,7 +71,7 @@
 	for line in lines:
 		data = line.split()
 		if (data[0][0] == "#"): continue
-		pos = Vector3(float(data[0]),float(data[1]),float(data[2]))
+		pos = orientation*Vector3(float(data[0]),float(data[1]),float(data[2]))
 	
 		if (newClumpId<0 or newClumpId==int(data[4])):
 			idD = curClump.append(utils.sphere(shift+scale*pos,scale*float(data[3]),**kw))