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

Consistent Path Interpolation #69

Open
Monkeymerlot opened this issue Feb 24, 2021 · 4 comments
Open

Consistent Path Interpolation #69

Monkeymerlot opened this issue Feb 24, 2021 · 4 comments
Assignees
Labels
Status: Available No one has claimed responsibility for resolving this issue. Topic: Interpolation Topic: Tooling Type: Enhancement New feature or request

Comments

@Monkeymerlot
Copy link
Contributor

So recently I had moved the interpolation to each individual path instead of a global setting. And in my investigations of the tooling (which I am currently in the process of turning into an SMO) I realized that for cubic beziers (which are almost certainly in the path data if your path is curved at all) there is a number of points -- not distance like overall interpolation for the path-- for the curves.
image

While this might not seem problematic at first, consider the fact that a path can have hugely varying curve sizes. So say there is a huge curve and a tiny curve (like photo two), under the current system, both will have the same number of points.
image

And even though everything will have the same interpolation applied to it later, when defining the shape of the curve, it is better to have as many points as possible. However, it does not need to be greater than the overall path interpolation distance (so say your curve is 15 um long and you have an interpolation of 0.1 um, any value greater than 150 is not going to make a difference on that curve besides messing up how long it is going to take to write it. And in that same vein, the current system can actually allow users to mess up the values.

So here is my proposal: We calculate the length of the bezier curve and find the number of points needed by dividing the total length by the interpolation length. If you look up how to calculate the length of a bezier curve you quickly find out that it does not have a closed form solution. This isn't actually a problem though, as we can choose a large number of points (say 10000) and use that to fairly accurately and quickly find the length of the curve. From the length we can determine the new number of points using the interpolation distance as well.

I have made a quick demonstration of what I am talking about and added it to this post.
Path Interpolation.zip

@Monkeymerlot Monkeymerlot added Type: Enhancement New feature or request Status: Available No one has claimed responsibility for resolving this issue. Topic: Interpolation labels Feb 24, 2021
@Monkeymerlot Monkeymerlot self-assigned this Feb 24, 2021
@Monkeymerlot
Copy link
Contributor Author

@ciozi137 @aditi-nethwewala @Yh-lab Let me know what you guys think of this idea.

@ciozi137
Copy link
Member

@Monkeymerlot and others, is the AFM only capable of drawing straight lines between vertices? And how do we determine what is an acceptable number of points or spacing between points?

@Monkeymerlot
Copy link
Contributor Author

Monkeymerlot commented Feb 25, 2021

So I can answer the first part, but someone else will have to chime in for the second. The asylum microscopes do have a cubic spline interpolation option, however, the driver is *not written to use this type of interpolation, and I think that adding it would be a lot of work for possibly very little if any difference, as I wouldn't know how to make it general between any other type of microscope.

@Monkeymerlot
Copy link
Contributor Author

@Sayanwita @ciozi137 This may need to be fixed/implemented before #100 (path deviation) can be correctly implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available No one has claimed responsibility for resolving this issue. Topic: Interpolation Topic: Tooling Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants