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

Question about usage #55

Closed
tdunning opened this issue May 12, 2023 · 6 comments
Closed

Question about usage #55

tdunning opened this issue May 12, 2023 · 6 comments

Comments

@tdunning
Copy link

I understand pretty much how to define a body using just the distance function. Makes a lot of sense. I have two major questions, however.

First, what is the impact of small errors in this function as long as the distance at the surface of the body is zero and the errors are relatively small? For instance, if I have an elliptical body and calculate distance to the surface using the distance to a surface point on a line between the point in question and the center of the ellipse, I will give a distance that is a bit longer than the actual shortest distance. What would be the effect of that? The same thing happens in the simulation of the swimming fish. If I define the fish body as the distance to the nearest point on the spine less the orthogonal thickness at that point, I will give a slightly higher distance than is geometrically correct.

Second, can I use the map function in a body to project a circle to a wing section and then just compute the distance in the projected space?

@tdunning
Copy link
Author

I would be happy to produce new examples showing whatever hints you can give here, particularly for the second part of this question.

@weymouth
Copy link
Collaborator

I discussed this on open feature issue #53. Inigo Quillez's youtube is a master class in all the ways you can use SDFs and mapping.

@tdunning
Copy link
Author

Should I look for a place to add a reference to this video into the documentation under a separate issue?

@tdunning
Copy link
Author

I don't think that Inigo's video (which was on how to paint photorealistic images using simple pseudo random numbers) really applies to my question about how approximate values of distance to the surface will affect the accuracy of the simulation.

Here is an example of what I am talking about. The red line is my surface. It is defined as a vertical offset from the heavy black line. It is very convenient to approximate the distance from a point p using the vertical distance to the spine minus the height of the surface above that line. But the result is longer than the actual shortest distance which runs at an angle from the vertical.

How much error does this convenience cause in the simulation?

image

@weymouth
Copy link
Collaborator

weymouth commented May 13, 2023 via email

@b-fg
Copy link
Member

b-fg commented May 13, 2023

You can try to plot the resulting distance function and see if there are unphysical effects (0 thickness, for example). Depending on the refinement of your mesh, this might be an issue or not. But surely the geometry you would be simulating will be different from the target one, and the effects will be related to the mesh refinement.

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

3 participants