Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single sliding groove along the entire polygon #266

Open
pavanteja295 opened this issue Dec 31, 2024 · 1 comment
Open

Single sliding groove along the entire polygon #266

pavanteja295 opened this issue Dec 31, 2024 · 1 comment

Comments

@pavanteja295
Copy link

Hey guys!

I am trying to use a GrooveJoint for my use case. My use case is as follows:

I have two bodies - Platform (a polygon or more simply a rectangle) , BoxP . I want to make a groove throughout the polygon surface of Platform and restrict the movement of BoxP due to any forces in the simuation to move only along the groove. Is this possible?

I took a look at GrooveJoint. Unfortunately, pymunk.constraints.GrooveJoint only supports linear slides. Is there a way to achieve this with Pymunk?

@pavanteja295 pavanteja295 changed the title Single sliding grooves along the entire polygon. Single sliding grooves along the entire polygon Dec 31, 2024
@pavanteja295 pavanteja295 changed the title Single sliding grooves along the entire polygon Single sliding groove along the entire polygon Dec 31, 2024
@aatle
Copy link

aatle commented Dec 31, 2024

Perhaps you could try to use a single GrooveJoint, but after every update, you calculate Platform's closest edge to BoxP's anchor and set the joint's groove_a and groove_b to match that edge.
Theoretically, at the corners, BoxP could be pushed in enough for the groove to flip, depending on the direction of the force. You could try adjusting error_bias to tune things further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants