Closed danzeeeman closed 4 years ago
Thanks @danzeeeman , I didn't know you were in here! I think the image conversion is still in a rough state (Lingdong told me to use inverted images, for example). @LingDong- , could you kindly comment on Dan's PR?
@golanlevin Yes I think @danzeeeman is right. I wrote image()
way before developing all the raster techniques, so that function is still using old vector hatching and doesn't respond to hatchMode().
The reason the holes are gone in the first image is that hatchParallel() does not deal with holes, another vector algo called hatchParallelComplex() does (which is still written way after image()). But to use that we need to expose the API to identify holes in the findContours() algorithm. So I think switching to raster backend is the best move (all the other operations now defaults to raster)
@danzeeeman glad you figured out my code! If I were to update it I would have done the same way :)
Let's merge it!
P.S. @golanlevin, the inverted images and the rough state are more related to HatchSpine. I think image() was working pretty ok for images without holes, and now with Dan's PR it should be even more robust
@danzeeeman I'll probably add another if statement to have it respond to FORCE_VECTOR and FORCE_RASTER
EDIT: Sorry just saw your newer commit and saw you switched to my hatchRaster()
which handles all that. Great
cool I'll merge it
I was playing around with the library and saw an issue with Image Conversion.
File
Output
I made some to make the internal of image use _stroke and hatchRaster rather than hard-coded to hatchParallel. Now the image conversion takes into account hatch modes and correctly hatches the images.
output after the corrections