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

Deformed and failing SVG #27

Closed
jellevr opened this issue Jul 12, 2018 · 18 comments
Closed

Deformed and failing SVG #27

jellevr opened this issue Jul 12, 2018 · 18 comments

Comments

@jellevr
Copy link

jellevr commented Jul 12, 2018

Hello,

I'm using your library for which I want to thank you first, it has been a huge help. Most of the DXF work like a charm but some are deformed and some even fail so I figured I'll let you know, maybe you are unaware.

These are the DXF files that are deformed (downloadable through the link):

http://www.dewesp.com/v6/DXF/cardboard-cupcake-stand-easy-diy-craft-idea.dxf
http://www.dewesp.com/v6/DXF/laser-cut-ornaments-christmas-wood-tree-idea.dxf
http://www.dewesp.com/v6/DXF/plywood-candle-holder-laser-cutter-idea.dxf
http://www.dewesp.com/v6/DXF/rocking-elephant-cnc-router-plans-wood-rocking-horse-idea.dxf

Further I have some that completely fail:

http://www.dewesp.com/v6/DXF/chair.dxf
http://www.dewesp.com/v6/DXF/FV4EBZBGDVZF630.dxf
http://www.dewesp.com/v6/DXF/StaticBoot3-R14.dxf
http://www.dewesp.com/v6/DXF/Velociraptor.dxf

If I can be of any assistance, please let me know 👍

Kind regards and again, big thank you for the library!

Jelle

@bjnortier
Copy link
Collaborator

Hi, thanks, I'll have a look. I always appreciate getting broken examples as the spec is quite complex so it's hard to anticipate all use cases.

@bjnortier
Copy link
Collaborator

Do you have images of what you expect the deformed one to look like?

@jellevr
Copy link
Author

jellevr commented Jul 12, 2018

I made a small picture report, maybe it explains better:

https://docs.google.com/document/d/1P3u5N2G2JzbthwQ4UgaI7ovQknBmtDkNkOMfo1rI3Cw/edit?usp=sharing

I did do my tests 10 days ago, I see you rolled out a new version 2 days ago so maybe these are already fixed...

@bjnortier
Copy link
Collaborator

Thanks. Unfortunately that update was to ignore polygon meshes, so wouldn't have fixed these. I'm looking at this now

@bjnortier
Copy link
Collaborator

Ok the first one was easier than I expected - these DXFs are splines with LOTS of control points, and previously the number of interpolated points was a constant. Now it is proportional to the number of control points:

screen shot 2018-07-12 at 09 42 38

I'll look at the ones that completely fail now...

@jellevr
Copy link
Author

jellevr commented Jul 12, 2018

You are a saint! If I can buy you a coffee somehow, I'd be more than happy too. Thanks for the quick help!

@bjnortier
Copy link
Collaborator

The ones below are working now (there's a floating point issue in the b-spline lib, #28), which has to be addressed. I'll make a release now with these fixes - more work is needed for FV4EBZBGDVZF630.dxf and StaticBoot3-R14.dxf but at least you can get on with it.

screen shot 2018-07-12 at 10 38 09
screen shot 2018-07-12 at 10 39 07

bjnortier added a commit that referenced this issue Jul 12, 2018
…ol points - improves SVG fidelity for large splines
@jellevr
Copy link
Author

jellevr commented Jul 12, 2018

Perfect, I really appreciate this!

I forgot one more that fails because it's on a different server:

https://discuss-assets.s3.amazonaws.com/original/3X/f/7/f754fb4dfe8ea2be046c2a23cf8f3e7ed8f5e8c9.dxf

Cheers,

Jelle

@bjnortier
Copy link
Collaborator

Published @3.2.1

@bjnortier
Copy link
Collaborator

Can I add these files to the test examples in the repo? Or are they copyrighted?

@jellevr
Copy link
Author

jellevr commented Jul 12, 2018

you can, besides chair.dxf because I'm not sure about that one, all the others I got from a forum for testing myself :)

@bjnortier
Copy link
Collaborator

👍

Chair is a bit bit anyways - I'll just extract the one curve that generates the error

@jellevr
Copy link
Author

jellevr commented Jul 12, 2018

Hi Ben,

I adjusted my own code and retested everything. A huge improvement!

I am however still having problems with these:

http://www.dewesp.com/v6/DXF/plywood-candle-holder-laser-cutter-idea.dxf

image

The right top figure isn't correct, all the others are.

http://www.dewesp.com/v6/DXF/Velociraptor.dxf

It works if I open it from "\dxf\examples\dxf.html" in a browser and show the svg. But it doesn't when I call it from my app. Maybe it's my side but I don't think so as I'm calling the routine as I do with every DXF.

Again thank you, it's already a huge improvement.

@bjnortier
Copy link
Collaborator

Not sure why the top right one is problematic - it has a similar number of knots & control points to the others. I will have a look in the next couple of days.

@bjnortier
Copy link
Collaborator

Ok the spline interpolation is much smarter now, so the candle holder is fixed:

screen shot 2018-07-13 at 16 55 31

You'll also see that the dxf.html example web page will render the SVG so it's easier to test any DXF

@jellevr
Copy link
Author

jellevr commented Jul 13, 2018

I already implemtent that feature myself but it beats having to copy it every time :) thanks again Ben!

@bjnortier
Copy link
Collaborator

Do you want to close the issue?

@jellevr
Copy link
Author

jellevr commented Jul 16, 2018

Yes, I think everything is addressed at this point :) thanks again!!!

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

2 participants