← Back to team overview

yade-users team mailing list archive

Re: [Question #235405]: body shift

 

Question #235405 on Yade changed:
https://answers.launchpad.net/yade/+question/235405

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Christian,

not sure if it works (can't test it just now), but try

def readjustBoxes():
  for ii in id_boxes:
    oldPos = O.bodies[ii].state.pos
    O.bodies[ii].state.pos = Vector3(oldPos[0],oldPos[1],newpositionZ) #
i.e. setting pos a a whole Vector3 instance

cheers
Jan


2013/9/9 Christian Jakob <question235405@xxxxxxxxxxxxxxxxxxxxx>

> New question #235405 on Yade:
> https://answers.launchpad.net/yade/+question/235405
>
> Hi,
>
> I want to shift a moving body (a box) and adapt its position relative to
> another body (clump). I tried this:
>
> def readjustBoxes():
>   for ii in id_boxes:
>     O.bodies[ii].state.pos[2] = newposition
>
> O.engines=O.engines+[PyRunner(iterPeriod=1000,command='readjustBoxes()')]
>
> Unfortunately this does not work. Note, that i do want to shift the body
> with a given velocity, it should just appear with another position (without
> a erase-recreate procedure).
>
> Is it possible somehow?
>
> christian
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.