Draft_Hatch vs. TechDraw_GeometricHatch: different results?

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Draft_Hatch vs. TechDraw_GeometricHatch: different results?

Post by Roy_043 »

I was looking at hatch patterns in FreeCAD yesterday and I noticed that the Draft_Hatch and TechDraw_GeometricHatch commands produce different results for the same pattern (with the same settings). The Draft_Hatch is at the top of the image. It ignores the gaps in the pattern, but seems to handle hatch scales other than 1 better than the TechDraw hatch. Since Draft_Hatch uses TechDraw code I am surprised by this. Are there two hatch algorithms in the TechDraw code?
Attachments
HatchTest.zip
(23.4 KiB) Downloaded 23 times
draft-hatch-vs-techdraw-hatch.png
draft-hatch-vs-techdraw-hatch.png (20.51 KiB) Viewed 1710 times
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft_Hatch vs. TechDraw_GeometricHatch: different results?

Post by yorik »

I actually was never able to achieve the TechDraw result in Draft yet... The code used by Draft is https://github.com/FreeCAD/FreeCAD/blob ... y.cpp#L889 which calls this one, where - I thought - all the magic is done: https://github.com/FreeCAD/FreeCAD/blob ... h.cpp#L272

But apparently it's still missing something...
Post Reply