Draft Hatch

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Hatch

Post by Roy_043 »

Roy_043 wrote: Fri Sep 24, 2021 6:18 pm seems to fix it.
OK that actually does not do the trick. The matrix is derived from the parent object so it only works for planar Draft objects.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Hatch

Post by Roy_043 »

I think I have found a solution for the relocation bug. In this version of hatch.py the first edge and the normal of the face are used to create a matrix. This offers a level of control over how the shape is translated to the XY plane. The first point of the first edge is put on the origin, the first edge will be aligned with the X-axis.

If you create wires with that in mind you can control how the hatch is aligned with the outline. For wires on the XY plane the Translate property can then be used to switch between relative and absolute patterns.

Also included in the ZIP file are two test files and the PAT file I have used.
Attachments
hatch.zip
(51.63 KiB) Downloaded 78 times
insul-zigzag.png
insul-zigzag.png (11.45 KiB) Viewed 4838 times
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Hatch

Post by Roy_043 »

User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Hatch

Post by Roy_043 »

Merged.
User avatar
ragohix769
Posts: 565
Joined: Sat Jul 18, 2020 7:04 am
Location: Rome - Italy

Re: Draft Hatch

Post by ragohix769 »

Roy_043 wrote: Fri Oct 08, 2021 11:29 pm
Merged.
Now it works!


Thanks Roy!! :D
Attachments
wepz.png
wepz.png (262.64 KiB) Viewed 4440 times
After #ElonMuskBuyTwitter I'm no more on Twitter, that's really enough :-(
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same :-)
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Hatch

Post by Roy_043 »

Roy_043 wrote: Fri Oct 01, 2021 2:44 pm In this version of hatch.py the first edge and the normal of the face are used to create a matrix.
Oops, there is an obvious problem if the first edge is a circle... :oops:
I'll try to fix that.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Hatch

Post by Roy_043 »

User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Hatch

Post by Roy_043 »

Merged.
Post Reply