← Back to team overview

yade-dev team mailing list archive

Re: how can i create a sphere ...

 

Hi Christian,

try something like

shared_ptr<Body> bodyTmp=shared_ptr<Body>(new Body());
bodyTmp->shape = shared_ptr<Sphere>(new Sphere());
bodyTmp->shape->radius = whatever;
bodyTmp->material = shared_ptr<SomeMaterial>(new SomeMaterial());

see source code [1, 2].

cheers
Jan

[1] yade/core/Body.*pp
[2] yade/pkg/common/Sphere.*pp


2013/2/18 Christian Jakob <jakob@xxxxxxxxxxxxxxxxxxx>

> ... in yadeWrapper.cpp?
>
> I can create a new body, give it a position and insert it in bodycontainer:
>
> shared_ptr<Body> bodyTmp=shared_ptr<Body>(new Body());
> bodyTmp->state->pos = myPositionVector;
> proxee->insert(bodyTmp);
>
> How can I tell c++, that this body is sphere with a given radius?
> How can I set the material in c++?
>
> I found this:
>
> http://docs.python.org/2/**extending/embedding.html<http://docs.python.org/2/extending/embedding.html>
>
> Do I need to embed python in c++ for my purpose? Hope not!
>
>
> Regards,
>
> Christian.
>
>
> ______________________________**_________________
> Mailing list: https://launchpad.net/~yade-**dev<https://launchpad.net/~yade-dev>
> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-**dev<https://launchpad.net/~yade-dev>
> More help   : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>

References