← Back to team overview

yade-users team mailing list archive

[Question #671373]: rotate a GTS surface

 

New question #671373 on Yade:
https://answers.launchpad.net/yade/+question/671373

hi, i import a gts surface. I'm able to translate it but i'm not able to rotate. i would like to rotate this surface about 90 degrees around x axes, and then about 180 degrees around y axis. I tryied with this code only for the first rotation (x axes), but it doesn't work. I used rotation engine but i have the following error:

Traceback (most recent call last):
  File "/usr/bin/yade", line 182, in runScript
    execfile(script,globals())
  File "creazione.py", line 31, in <module>
    zeroPoint=[0,0,0]),
TypeError: No registered converter was able to produce a C++ rvalue of type std::vector<int, std::allocator<int> > from this Python object of type gts.Surface

this is the code: is really simply till now and i used the trunk example:

###################################################
###################################################

from yade import pack,qt
import gts, locale

locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')  



s1=gts.read(open('aereo.gts'))
s2=gts.Surface(); s2.translate(0,0,100)
O.bodies.append(pack.gtsSurface2Facets(s1,color=(0,1,0))+pack.gtsSurface2Facets(s2,color=(1,0,0)))

O.bodies.append(pack.gtsSurface2Facets(s2,color=(0,0,1)))

rotvel=100
O.engines=[
 
RotationEngine(
ids=s2,
angularVelocity=rotvel,
rotationAxis=[1,0,0],
rotateAroundZero=True,
label='srotation',
zeroPoint=(0,0,0)),
]

i know that using this way i'll not be able to stop it when the surface rotated exacly of 90 degree, but i want to go by step. Before, i want to be able to start this rotation, then i'll see how can i stop it. I saw some questions on Lounchpad that could help me. If you think exist an easier way, please tell me.

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.