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

Property HATCH #31

Open
andrelmlins opened this issue Feb 19, 2018 · 6 comments
Open

Property HATCH #31

andrelmlins opened this issue Feb 19, 2018 · 6 comments

Comments

@andrelmlins
Copy link

Would it be possible to read the hatch property within an entity?

@bzuillsmith
Copy link
Member

Do you mean the HATCH entity? It's possible to add them, but will require quite a bit of work. HATCH entities are one of the most complex entities in the DXF spec. I'm open to pull requests for anyone who wants to work on this. Not sure when I will have time to work on this next.

@kpetrow
Copy link
Contributor

kpetrow commented Aug 6, 2021

going to upvote this.

@hschmiedhofer
Copy link

would be great to have this.

@dlabz
Copy link

dlabz commented Mar 9, 2023

Parsing the hatch patterns seems very straight-forward, as they are specified as .pat hatch files, as explained on the https://pattycake.io . All codes are available in the autocad_2012_pdf_dxf-reference_enu.pdf .

Rendering them to svg or canvas is a bit trickier, and I still need to figure out a reasonable approach to do it.

@kpetrow
Copy link
Contributor

kpetrow commented Mar 9, 2023

I ended up writing my own hatch parser, but it crashes browser frequently if trying to use canvas image with bounds inside the polygon. Maybe you could draw lines or something??

@dlabz
Copy link

dlabz commented Mar 9, 2023

Yeah, parsing is straight-forward. There's also this pull request from 2019. covering some of it: #45

There's some compatibility issue between the hatches and the browser. SVG2 planned for <hatch> and <hatchpath> elements, but seems they opted against it. Even Autodesk Forge brute-forces hatches as individual stroke lines.

I'm guessing Houdini aka CSS Painting API Worklets is the most recent initiative to bridge this gap, but support is still spotty.

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

5 participants