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

Problem generating a heart shape #56

Closed
ill opened this issue Jul 14, 2017 · 4 comments
Closed

Problem generating a heart shape #56

ill opened this issue Jul 14, 2017 · 4 comments

Comments

@ill
Copy link

ill commented Jul 14, 2017

This zip file contains an example svg that results in a weird output. The svg is produced by exporting from a photoshop file shape I made.
HealthIcon.zip

First off, the svg can't be parsed without my pull request: #55

Once done, this is how my Unreal Engine material renders it.

weirdrender

This is the output produced by msdfgen when I use the sdf flag. Not what I'd expect.
t_ui_healthicon_msdf

There may be some weirdness in my shape data. I'll look at trying to fix the shape later.

@ill
Copy link
Author

ill commented Jul 14, 2017

I managed to get a better render by redoing my shape a bit
HealthIcon.zip

I get this line down the middle now at some scales.
hardline

It looks better if I generate a regular signed distance field and use my grayscale sdf shader instead of the multichannel one, but when zooming in very far there's that weird artifact that occurs that your algorithm solves. I don't plan on zooming in far so it's OK.

.

@Chlumsky
Copy link
Owner

The first issue was a bug in the SVG parser which I have now fixed.

The second one is a little more complicated than it may seem. This is actually a specific edge case, where at the middle vertex, the inner angle between the two curves is exactly 360 degrees. The simplest solution would be to move the curve control points ever so slightly away from the middle to decrease this angle.

@fire
Copy link

fire commented Oct 10, 2020

I tested the latest and the change on 82364f9 seemed to solve the problem. Will do some more testing.

Repeated.

@Chlumsky
Copy link
Owner

This issue should be resolved by 80039d7, the fix is present in the v1.8 release.

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