← Back to team overview

yade-users team mailing list archive

Re: [Question #686076]: Problem of Bodies rotation

 

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

Chareyre proposed the following answer:
Hi, I would support 2) for the sake of performance, but there's also
3) fix myRotation() since obviously imposing rigid body motion needs to
impose 'vel' too (spin*pos), not just 'angVel'.
Bruno

Le jeu. 21 nov. 2019 12:58, yang yi <question686076@xxxxxxxxxxxxxxxxxxxxx>
a écrit :

> New question #686076 on Yade:
> https://answers.launchpad.net/yade/+question/686076
>
> I hope to design a plane named IDGround, it can rotate with the given
> velocity, and it can be controlled to start, stop, change the speed and the
> direction in the simulation.
> I used the pack.sweptPolylines2gtsSurface to establish the plane, and used
> the O.bodies[i].state.angVel to set the velocity. It can rotate. But the
> plane is combined by two triangles, so there are two bodies in the plane,
> and each of them rotates around the itself axis.  I hope both of them
> rotating around a given axis. How can I change my code as follows??
> Thank you very much.
>
> Yang Yi
>
> positionGround = [
>                  Vector3(0,0,0),
>                  Vector3(1,0,0),
>                  Vector3(1,1,0),
>                  Vector3(0,1,0)
>                  ]
> Ground = pack.sweptPolylines2gtsSurface([positionGround], capStart=True,
> capEnd=True)
> IDGround = O.bodies.append(pack.gtsSurface2Facets(Ground, color=(1,0,1)))
>
> def myRotation():
>     for i in IDGround:
>         O.bodies[i].state.angVel=(0, 0, 1)
>
> O.engines = [
>     ForceResetter(),
>     InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]),
>     InteractionLoop(
>         # handle sphere+sphere and facet+sphere collisions
>         [Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
>         [Ip2_FrictMat_FrictMat_FrictPhys()],
>         [Law2_ScGeom_FrictPhys_CundallStrack()]),
>     NewtonIntegrator(gravity=(-9.8, 0, 0), damping=0.001, label='down'),
>     PyRunner(command="myRotation()",iterPeriod=400000)
>     # RotationEngine(rotationAxis=(0, 0, 1), angularVelocity=10.0,
> rotateAroundZero=True, zeroPoint=(0, 0, 0))
>     ]
>
>
> --
> You received this question notification because your team yade-users 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 your team yade-users is
an answer contact for Yade.