← Back to team overview

yade-users team mailing list archive

Re: [Question #682649]: Sphere losing interaction with PFacet after moving it to other scene

 

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

    Status: Open => Solved

Léo Sénique confirmed that the question is solved:
Hello again,
I think I have found the problem. It seems the way I tried to copy the sphere, erase it and add the same instance of that sphere to the simulation was screwing things up. Creating a new sphere with the same state and shape values fixes the problem:

def moveSphereToScene(): #delete the sphere from scene 1 and copy it to scene 0
    global s1
    if O.iter >1000 and O.thisScene==1:
        state=O.bodies[s1].state
        shape=O.bodies[s1].shape
        O.bodies.erase(s1)
        O.switchToScene(0)
        s1=O.bodies.append(sphere(center=state.pos,radius=shape.radius,material='Frict',color=color))
        O.bodies[s1].state=state
        O.bodies[s1].shape=shape
        moveSphere.dead=True

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.