← Back to team overview

yade-users team mailing list archive

Re: [Question #254443]: Tracking position of imported geometry .stl

 

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

    Status: Open => Answered

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

O.bodies.append returns list of ids of appended bodies. So 'rod' in your
example has no state (as it is list as the error message says). You can try
e.g.

O.bodies[rod[0]].state.pos[2]

cheers
Jan
Dne 13.9.2014 17:51 "Luis Barbosa" <question254443@xxxxxxxxxxxxxxxxxxxxx>
napsal(a):

> New question #254443 on Yade:
> https://answers.launchpad.net/yade/+question/254443
>
> Hi,
>
> I'm using an imported geometry .stl. How can I define this kind of body to
> plot its position with interactions?
> What I'm trying is:
>
> ## Import geometry
> rod = O.bodies.append(ymport.stl('rod-'+mesh+'.stl',wire=True))
>
> def Data():
>         plot.addData(z1=rod.state.pos[2],i=O.iter)
> plot.plots={
>         'i':('z1')
>
> But the error is; 'list' object has no attribute 'state'.
> Must I find the # of the body and use O.bodies[#] instead of rod?
>
> Thanks!
>
> --
> 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.