Creating particles

Asked by Gayanindika

I have a problem in creating particles in bouncing spheres example. The following error appears while making the particles.

Yade [1]: O.bodies.append([
     ...: utils.sphere((0,0,2),.5)
     ...: utils.sphere(center=(0,0,0),radius=.5,dynamic=False)
------------------------------------------------------------
   File "<ipython console>", line 3
     utils.sphere(center=(0,0,0),radius=.5,dynamic=False)
         ^
SyntaxError: invalid syntax

I tried several ways but every time when type the commands for the second one, it does not work. Any alternative please?
(I am using Yade 0.60 in Ubuntu).

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Best Jan Stránský (honzik) said :
#1

Hi

> O.bodies.append([
> ...: utils.sphere((0,0,2),.5)
> ...: utils.sphere(center=(0,0,0),radius=.5,dynamic=False)

is this oyur complete command? then usage of braces are wrong and missing comma is also wrong in python syntax, the right syntax should be something like this:

O.bodies.append([
    utils.sphere((0,0,2),.5) ,
    utils.sphere(center=(0,0,0),radius=.5,dynamic=False)
])

regards,
Jan

Revision history for this message
Gayanindika (wanasinghegi) said :
#2

OMG, What a mistake! Thank you Honzik for your early responce.

Revision history for this message
Jan Stránský (honzik) said :
#3

:-)

Jan

______________________________________________________________
> Od: "Gayanindika" <email address hidden>
> Komu: <email address hidden>
> Datum: 11.07.2011 10:06
> Předmět: Re: [Yade-users] [Question #164389]: Creating particles
>
>Question #164389 on Yade changed:
>https://answers.launchpad.net/yade/+question/164389
>
> Status: Answered => Solved
>
>Gayanindika confirmed that the question is solved:
>OMG, What a mistake! Thank you Honzik for your early responce.
>
>--
>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 : <email address hidden>
>Unsubscribe : https://launchpad.net/~yade-users
>More help : https://help.launchpad.net/ListHelp
>