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

Problems with for ANSI31/SOLID pattern hatches #88

Open
tth05 opened this issue Nov 27, 2023 · 7 comments
Open

Problems with for ANSI31/SOLID pattern hatches #88

tth05 opened this issue Nov 27, 2023 · 7 comments

Comments

@tth05
Copy link

tth05 commented Nov 27, 2023

Hello,

thanks for making this library, it works really well. I'm just having two small issues, which you can see below (Note that I renamed the files, otherwise github won't let me upload them...):

The triangle is not rendered in your viewer
image
solid-hatch.dxf.txt

The 45° lines are not rendered in your viewer
image
ansi31-pattern.dxf.txt

I recognize that you're busy right now, so I'd be happy about any help on how to fix these two issues. I'm willing to invest time and make a PR if you could give me some advice. I already saw your comment about solid hatches, not sure yet why the other one doesn't work.
Is there any way to know how things in a dxf file should be rendered properly? I can't find any information about it.
Also, I have access to AutoCAD, although I have no idea how to use it, so I can probably give you more information or create samples.

@tth05
Copy link
Author

tth05 commented Nov 27, 2023

I noticed that second one doesn't render because the hatchStyle is 1 (outermost area only). I changed it to 2 while debugging which interestingly makes it renders exactly like in AutoCAD. Sadly, this doesn't work when the lines are vertical

image
vertical-lines.dxf.txt

@vagran
Copy link
Owner

vagran commented Dec 1, 2023

Hello,
I will definitely take a look at all your samples once I have some free time (perhaps in a few days). Maybe it is time to implement solid hatching as well. Thanks for the samples!

@tth05
Copy link
Author

tth05 commented Dec 1, 2023

Thanks a lot for the response. Let me know if you want to fix/implement anything, then I won't bother trying. I'm currently working on MText frames which are completely undocumented and the size of the background box makes no sense...

Also, I can create infinitely more samples if you need any. Just ask.

@vagran
Copy link
Owner

vagran commented Dec 2, 2023

Seems the problem with non-solid hatching caused by my complete misunderstanding of hatching styles due to a lack of documentation. I was under impression that outermost style means hatching between the hatch path and some outer entities (which is difficult to implement), however seems it is always defined inside hatch paths, according to this description which I missed somehow. This definitely should be fixed, I will try to do this. This depends on test samples, which should have several nested hatch islands (with and without intersections), with different hatch styles, some variants of marking paths with external and outermost flags mentioned in the description, and their "ground truth" rendering example. Any assistance with creating such test samples is very welcome.

@tth05
Copy link
Author

tth05 commented Dec 2, 2023

I put some random stuff together, let me know if you need more.
image
random-hatches.dxf.txt

On a side note: I found this project https://github.com/mattdesl/three-line-2d. Could possibly be used as an easy way to get variable line width

@tth05
Copy link
Author

tth05 commented Jan 15, 2024

@vagran I implemented quite a few MText related things as well as outer hatch style in my fork. https://github.com/tth05/dxf-viewer
Would you up to review it if I make a PR? I wouldn't want it to sit around and become stale

@vagran
Copy link
Owner

vagran commented Jan 15, 2024

I took a quick look at your fork, it seems to be very valuable work. Yes, make PR for sure. Feel free to add yourself to the CONTRIBUTORS file. Thanks!

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