-
Notifications
You must be signed in to change notification settings - Fork 109
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
Reproducing snake diffraction results from your Nat Comm Paper #295
Comments
If I could find out how the ground element is created/referenced I would be able to partition into patches of higher friction based on the coordinates, but I can't find anything in your API which directly lets me extract coordinates of objects. |
Hello Akash, I can help with this. Yes, your understanding is correct - the "AnisotropicFrictionalPlane" doesn't have a boundary, so by adding many of them together will just duplicate friction force.
|
Hi thanks for your reply @xzhan139 . I had a follow up question, when I try to create the customfrictional plane I would still need a way to bound the dimensions of the plane, where are the commands to set the boundaries inside the customfrictional plane? |
Hi, let me explain this in another way. Your customfricitonal plane should start looking like a normal plane - no boundary and uniform friction everywhere. Then you just need to create a few high frictional spots on that plane. To do this, just scale the friction whenever snake elements are inside the region. So in the end, you just need one plane - your custom friction plane, which is an infinite plane, no bounds. Does this make sense? |
I get the idea, I haven't gotten the code to work yet. import numpy as np def is_point_inside_patch(point, patch_vertices):
Test casesif name == "main":
import numpy as np def is_point_inside_patch(point, patch_vertices):
from snake_diffraction_postprocessing import ( class SnakeDiffractionSimulator( def run_snake(
if name == "main":
And here's the error... Traceback (most recent call last): I haven't had time to debug this...you can choose to keep this thread open or close it, and I will post with the status once I am able to resolve the issue. Thanks. |
Seems like this issue has been resolved, I am closing it. |
Hello again, I am trying to develop a simulation of a worm passing through a pegged lattice, and started off with trying to replicate the results of snake diffraction and reflection and refraction reported in Fig 4 of your Nature communications paper.
I followed the instructions listed in the SI of your paper, and as a first pass tried to simulate a snake passing through 3 pegs located at (x=0, z = 0.75); (x=-0.23, z = 0.75) and (x=0.23, z = 0.75) where +z is the direction of snake travel.
The way I implemented this, is by modifying your continuumsnake.py example, and adding frictional forces corresponding to the patches, as shown in the following code snippet from the modified example.
Add friction forces
I left the rest of the code unchanged, however while implementing this I had a question on defining the dimensions of the frictional patch which is supposed to represent a peg. The origin_plane which determines where the origin of the frictional substrate is going to be located only at that coordinate which we specify, however there is no way of specifying it's bounding dimensions such that when the snake is on any other part of the ground it should experience the standard frictional force, and only when it is in contact with the patch should it experience an increased friction.
Clearly the simulation doesn't work as intended and you can see it in the gif I am attaching. What should I do to implement the frictional patches correctly. Thanks.
The text was updated successfully, but these errors were encountered: