← Back to team overview

yade-dev team mailing list archive

Re: how can i create a sphere ...

 

Hi Christian,

You can find a c++ sphere creation at TriaxialTest.cpp:176

______

createSphere(body,sp.c,sp.r,false,true);
if(biaxial2dTest){ body->state->blockedDOFs=State::DOF_Z; }
scene->bodies->insert(body);
______

With TriaxialTest.cpp:189

void TriaxialTest::createSphere(shared_ptr<Body>& body, Vector3r
position, Real radius, bool big, bool dynamic )

___

I didn't expect this kind of thing to happen outside pre-processors. You
should perhaps consider writing your code in a python function, just
like utils.sphere(). Clumps manipulation does not seem to be critical in
terms of performance.

Bruno


On 18/02/13 10:37, Christian Jakob wrote:
> ... 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
>
> Do I need to embed python in c++ for my purpose? Hope not!
>
>
> Regards,
>
> Christian.
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
>
>
>


-- 
_______________
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
Lab. 3SR
BP 53
38041 Grenoble cedex 9
Tél : +33 4 56 52 86 21
Fax : +33 4 76 82 70 43
________________



References