← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 4024: Replace Quaternion.Identity by Quaternion((1, 0, 0), 0)

 

------------------------------------------------------------
revno: 4024
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Thu 2014-06-12 18:54:31 +0200
message:
  Replace Quaternion.Identity by Quaternion((1,0,0),0)
  
  Such constructions in python files are failing when
  vectorization is on. Probably because Identity construction
  does not return real object (?)
modified:
  examples/gts-horse/gts-random-pack-obb.py
  gui/qt4/SerializableEditor.py
  py/bodiesHandling.py
  py/geom.py
  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 'examples/gts-horse/gts-random-pack-obb.py'
--- examples/gts-horse/gts-random-pack-obb.py	2013-08-09 02:27:56 +0000
+++ examples/gts-horse/gts-random-pack-obb.py	2014-06-12 16:54:31 +0000
@@ -13,7 +13,7 @@
 poly=((3+.1,0),(3+0,.1),(3+sq2,.1+sq2),(3+.1+sq2,sq2),(3+.1,0))
 #pylab.plot(*zip(*poly)); pylab.xlim(xmin=0); pylab.grid(); pylab.title('Meridian of the revolution surface\n(close to continue)'); pylab.gca().set_aspect(aspect='equal',adjustable='box'); pylab.show()
 thetas=arange(0,pi/8,pi/24)
-pts=pack.revolutionSurfaceMeridians([poly for theta in thetas],thetas,origin=Vector3(-4,0,-1),orientation=Quaternion.Identity)
+pts=pack.revolutionSurfaceMeridians([poly for theta in thetas],thetas,origin=Vector3(-4,0,-1),orientation=Quaternion((0,1,0),0.0))
 surf=pack.sweptPolylines2gtsSurface(pts,capStart=True,capEnd=True,threshold=1e-4)
 O.bodies.append(pack.gtsSurface2Facets(surf,color=(1,0,1)))
 # fill this solid with triaxial packing; it will compute minimum-volume oriented bounding box

=== modified file 'gui/qt4/SerializableEditor.py'
--- gui/qt4/SerializableEditor.py	2013-03-18 20:03:32 +0000
+++ gui/qt4/SerializableEditor.py	2014-06-12 16:54:31 +0000
@@ -277,7 +277,7 @@
 class Se3FakeType: pass
 
 _fundamentalEditorMap={bool:AttrEditor_Bool,str:AttrEditor_Str,int:AttrEditor_Int,float:AttrEditor_Float,Quaternion:AttrEditor_Quaternion,Vector2:AttrEditor_Vector2,Vector3:AttrEditor_Vector3,Vector6:AttrEditor_Vector6,Matrix3:AttrEditor_Matrix3,Vector6i:AttrEditor_Vector6i,Vector3i:AttrEditor_Vector3i,Vector2i:AttrEditor_Vector2i,Se3FakeType:AttrEditor_Se3}
-_fundamentalInitValues={bool:True,str:'',int:0,float:0.0,Quaternion:Quaternion.Identity,Vector3:Vector3.Zero,Matrix3:Matrix3.Zero,Vector6:Vector6.Zero,Vector6i:Vector6i.Zero,Vector3i:Vector3i.Zero,Vector2i:Vector2i.Zero,Vector2:Vector2.Zero,Se3FakeType:(Vector3.Zero,Quaternion.Identity)}
+_fundamentalInitValues={bool:True,str:'',int:0,float:0.0,Quaternion:Quaternion((0,1,0),0.0),Vector3:Vector3.Zero,Matrix3:Matrix3.Zero,Vector6:Vector6.Zero,Vector6i:Vector6i.Zero,Vector3i:Vector3i.Zero,Vector2i:Vector2i.Zero,Vector2:Vector2.Zero,Se3FakeType:(Vector3.Zero,Quaternion((0,1,0),0.0))}
 
 class SerQLabel(QLabel):
 	def __init__(self,parent,label,tooltip,path):

=== modified file 'py/bodiesHandling.py'
--- py/bodiesHandling.py	2013-03-08 21:26:47 +0000
+++ py/bodiesHandling.py	2014-06-12 16:54:31 +0000
@@ -168,7 +168,7 @@
 	return dimensions
 
 #spheresPackDimensions==================================================
-def spheresModify(idSpheres=[],mask=-1,shift=Vector3.Zero,scale=1.0,orientation=Quaternion.Identity,copy=False):
+def spheresModify(idSpheres=[],mask=-1,shift=Vector3.Zero,scale=1.0,orientation=Quaternion((0,1,0),0.0),copy=False):
 	"""The function accepts the list of spheres id's or list of bodies and modifies them: rotating, scaling, shifting.
 	if copy=True copies bodies and modifies them.
 	Also the mask can be given. If idSpheres not empty, the function affects only bodies, where the mask passes.

=== modified file 'py/geom.py'
--- py/geom.py	2014-01-14 18:37:09 +0000
+++ py/geom.py	2014-06-12 16:54:31 +0000
@@ -12,7 +12,7 @@
 	from miniEigen import *
 
 #facetBox===============================================================
-def facetBox(center,extents,orientation=Quaternion.Identity,wallMask=63,**kw):
+def facetBox(center,extents,orientation=Quaternion((0,1,0),0.0),wallMask=63,**kw):
 	"""
 	Create arbitrarily-aligned box composed of facets, with given center, extents and orientation.
 	If any of the box dimensions is zero, corresponding facets will not be created. The facets are oriented outwards from the box.
@@ -28,7 +28,7 @@
 	return facetParallelepiped(center=center, extents=extents, height=extents[2], orientation=orientation, wallMask=wallMask, **kw)
 
 #facetParallelepiped===============================================================
-def facetParallelepiped(center,extents,height,orientation=Quaternion.Identity,wallMask=63,**kw):
+def facetParallelepiped(center,extents,height,orientation=Quaternion((0,1,0),0.0),wallMask=63,**kw):
 	"""
 	Create arbitrarily-aligned Parallelepiped composed of facets, with given center, extents, height  and orientation.
 	If any of the parallelepiped dimensions is zero, corresponding facets will not be created. The facets are oriented outwards from the parallelepiped.
@@ -90,7 +90,7 @@
 	return ret
 
 #facetCylinder==========================================================
-def facetCylinder(center,radius,height,orientation=Quaternion.Identity,
+def facetCylinder(center,radius,height,orientation=Quaternion((0,1,0),0.0),
 	segmentsNumber=10,wallMask=7,angleRange=None,closeGap=False,
 	radiusTopInner=-1, radiusBottomInner=-1,
 	**kw):
@@ -164,7 +164,7 @@
 
 
 #facetCone==============================================================
-def facetCone(center,radiusTop,radiusBottom,height,orientation=Quaternion.Identity,
+def facetCone(center,radiusTop,radiusBottom,height,orientation=Quaternion((0,1,0),0.0),
 	segmentsNumber=10,wallMask=7,angleRange=None,closeGap=False,
 	radiusTopInner=-1, radiusBottomInner=-1,
 	**kw):
@@ -195,7 +195,7 @@
 		**kw)
 
 #facetPolygon===========================================================
-def facetPolygon(center,radiusOuter,orientation=Quaternion.Identity,segmentsNumber=10,angleRange=None,radiusInner=0,**kw):
+def facetPolygon(center,radiusOuter,orientation=Quaternion((0,1,0),0.0),segmentsNumber=10,angleRange=None,radiusInner=0,**kw):
 	"""
 	Create arbitrarily-aligned polygon composed of facets, with given center, radius (outer and inner) and orientation.
 	Return List of facets forming the polygon;
@@ -214,7 +214,7 @@
 	return facetPolygonHelixGenerator(center=center,radiusOuter=radiusOuter,orientation=orientation,segmentsNumber=segmentsNumber,angleRange=angleRange,radiusInner=radiusInner,**kw)
 
 #facetHelix===========================================================
-def facetHelix(center,radiusOuter,pitch,orientation=Quaternion.Identity,segmentsNumber=10,angleRange=None,radiusInner=0,**kw):
+def facetHelix(center,radiusOuter,pitch,orientation=Quaternion((0,1,0),0.0),segmentsNumber=10,angleRange=None,radiusInner=0,**kw):
 	"""
 	Create arbitrarily-aligned helix composed of facets, with given center, radius (outer and inner), pitch and orientation.
 	Return List of facets forming the helix;
@@ -233,7 +233,7 @@
 	return facetPolygonHelixGenerator(center=center,radiusOuter=radiusOuter,orientation=orientation,segmentsNumber=segmentsNumber,angleRange=angleRange,radiusInner=radiusInner,pitch=pitch,**kw)
 	
 #facetBunker============================================================
-def facetBunker(center,dBunker,dOutput,hBunker,hOutput,hPipe=0.0,orientation=Quaternion.Identity,segmentsNumber=10,wallMask=4,angleRange=None,closeGap=False,**kw):
+def facetBunker(center,dBunker,dOutput,hBunker,hOutput,hPipe=0.0,orientation=Quaternion((0,1,0),0.0),segmentsNumber=10,wallMask=4,angleRange=None,closeGap=False,**kw):
 	"""
 	Create arbitrarily-aligned bunker, composed of facets, with given center, radii, heights and orientation.
 	Return List of facets forming the bunker;
@@ -297,7 +297,7 @@
 	return ret
 
 #facetPolygonHelixGenerator==================================================
-def facetPolygonHelixGenerator(center,radiusOuter,pitch=0,orientation=Quaternion.Identity,segmentsNumber=10,angleRange=None,radiusInner=0,**kw):
+def facetPolygonHelixGenerator(center,radiusOuter,pitch=0,orientation=Quaternion((0,1,0),0.0),segmentsNumber=10,angleRange=None,radiusInner=0,**kw):
 	"""
 	Please, do not use this function directly! Use geom.facetPloygon and geom.facetHelix instead.
 	This is the base function for generating polygons and helixes from facets.
@@ -342,7 +342,7 @@
 
 
 #facetCylinderConeGenerator=============================================
-def facetCylinderConeGenerator(center,radiusTop,height,orientation=Quaternion.Identity,
+def facetCylinderConeGenerator(center,radiusTop,height,orientation=Quaternion((0,1,0),0.0),
 	segmentsNumber=10,wallMask=7,angleRange=None,closeGap=False,
 	radiusBottom=-1,
 	radiusTopInner=-1,

=== modified file 'py/ymport.py'
--- py/ymport.py	2014-05-26 07:53:31 +0000
+++ py/ymport.py	2014-06-12 16:54:31 +0000
@@ -48,7 +48,7 @@
 			raise RuntimeError("Please, specify a correct format output!");
 	return ret
   
-def textClumps(fileName,shift=Vector3.Zero,discretization=0,orientation=Quaternion.Identity,scale=1.0,**kw):
+def textClumps(fileName,shift=Vector3.Zero,discretization=0,orientation=Quaternion((0,1,0),0.0),scale=1.0,**kw):
 	"""Load clumps-members from file, insert them to the simulation.
 	
 	:param str filename: file name
@@ -140,7 +140,7 @@
 	surf.translate(shift) 
 	yade.pack.gtsSurface2Facets(surf,**kw)
 
-def gmsh(meshfile="file.mesh",shift=Vector3.Zero,scale=1.0,orientation=Quaternion.Identity,**kw):
+def gmsh(meshfile="file.mesh",shift=Vector3.Zero,scale=1.0,orientation=Quaternion((0,1,0),0.0),**kw):
 	""" Imports geometry from mesh file and creates facets.
 
 	:Parameters:
@@ -211,7 +211,7 @@
 		ret.append(utils.facet((nodelistVector3[i[1]],nodelistVector3[i[2]],nodelistVector3[i[3]]),**kw))
 	return ret
 
-def gengeoFile(fileName="file.geo",shift=Vector3.Zero,scale=1.0,orientation=Quaternion.Identity,**kw):
+def gengeoFile(fileName="file.geo",shift=Vector3.Zero,scale=1.0,orientation=Quaternion((0,1,0),0.0),**kw):
 	""" Imports geometry from LSMGenGeo .geo file and creates spheres. 
 	Since 2012 the package is available in Debian/Ubuntu and known as python-demgengeo
 	http://packages.qa.debian.org/p/python-demgengeo.html