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

Signed distance functions #22

Closed
kai-qu opened this issue Nov 4, 2017 · 1 comment
Closed

Signed distance functions #22

kai-qu opened this issue Nov 4, 2017 · 1 comment

Comments

@kai-qu
Copy link
Contributor

kai-qu commented Nov 4, 2017

Style writers and implementers need abstractions for optimizing the relationships between any pair of objects, rather then having to write special-purpose graphics code for every new objective/constraint function and every n-ary combination of graphical primitives.

Therefore, to improve the generality of our optimizer and the user experience for Style implementers, do the following:

For any object and any point in the plane, add the ability to compute a signed distance function from that point to the object (positive if outside, negative if inside). Additionally, compute level sets of distances for use in margins.

Test how well your implementation works with the existing optimizer and how well it works with the existing Styles. Specifically, test the following two important applications of signed distance:

  • Improve our label layout (and any objective functions that act on text), now that you can calculate the signed distance to the outline of the text, rather than just a bounding box.
  • Optimize objects composed of Bezier curves by writing new objective functions that use the signed distance to Bezier curves.

This issue depends on issue #75.

@wodeni
Copy link
Member

wodeni commented Nov 9, 2017

I had some early attempts on this and I do plan to take this on as a part of my goals this semester(at least have a framework that works on simple primitives). Some related materials here:

http://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/#signed-distance-functions
http://iquilezles.org/www/articles/distfunctions/distfunctions.htm

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

No branches or pull requests

3 participants