Draft Hatch
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Draft Hatch
- You select an existing object containing faces, click the tool, and the faces get filled with a hatch pattern. If the base object changes, so does the hatching.
- It produces a standard Part shape, so it works everywhere (TechDraw, DXF export,booleans,...)
- It uses the TechDraw patterns code. By default it uses the included PAT file of TD, but I would recommend googling for an acad.pat out there and use that instead Changing the default PAT file in TD preferences will affect both TD and this tool.
- The PAT file used by this tool is recorded in the object, so you can have several objects using different PAT files. Opening that file on a computer without the appropriate PAT files will open fine, but the hatch objects won't be modifiable. The PAT file itself is not included in the saved file.
- The TD system doesn't handle well dashed patterns yet. So for now stick with patterns that have continuous lines (anyone up to trying to solve this? I guess in https://github.com/FreeCAD/FreeCAD/blob ... chLine.cpp )
- The TD algo only works in the XY plane. So the Draft Hatch code translates all faces to the XY plane, calculates the hatch, and moves the hatch back to the face location. This is still buggy sometimes, so there is a Translate property that can be turned off, so it doesn't perform this relocation. If your base faces are in the XY plane, that option can be safely turned off. Here too, if someone wants to help me to look into the relocatin bug... https://github.com/FreeCAD/FreeCAD/blob ... ch.py#L103
Tell me what you think!
Re: Draft Hatch
Looks great for another new feature
Compile or wait for coming weekly-build right?
Compile or wait for coming weekly-build right?
- HenriqueReis
- Posts: 35
- Joined: Tue Mar 23, 2021 4:57 pm
- Location: São Paulo - SP
- Contact:
Re: Draft Hatch
In my view it is a great resource, I believe a lot in the potential of the tool and the workbench, mainly. I would like to understand better is that this tool is already available for testing or it will come in a future update... another point is how with the symbology libraries.
Re: Draft Hatch
running:
I get the following error when running the command:
I Guess it's because of windoz..
Also the icon is not displayed.
Hope it helps
Code: Select all
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.25678 (Git)
Build type: Release
Branch: master
Hash: 48c1738a533ac63527cf46018c773f0ebb03adfd
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Italian/Italy (it_IT)
Code: Select all
20:05:29 Running the Python command 'Draft_Hatch' failed:
Traceback (most recent call last):
File "C:\Users\carlo\Documents\FreeCAD-Source\FreeCAD_compiled\Mod\Draft\draftguitools\gui_hatch.py", line 46, in Activated
FreeCADGui.Control.showDialog(Draft_Hatch_TaskPanel(FreeCADGui.Selection.getSelection()[0]))
File "C:\Users\carlo\Documents\FreeCAD-Source\FreeCAD_compiled\Mod\Draft\draftguitools\gui_hatch.py", line 61, in __init__
self.form = FreeCADGui.PySideUic.loadUi(":/ui/dialogHatch.ui")
File "<string>", line 4, in <module>
Cannot open file
Also the icon is not displayed.
Hope it helps
follow my experiments on BIM modelling for architecture design
Re: Draft Hatch
hmm the qt resources are not updated (the icon and the dialog are missing). you recompiled freecad yourself, right? probably you need to touch Draft/Resources/Draft.qrc to trigger recompiling it. But i don't think win has a "touch" command, not sure how that is done
- ragohix769
- Posts: 568
- Joined: Sat Jul 18, 2020 7:04 am
- Location: Rome - Italy
Re: Draft Hatch
Hello Yorik,
I tried Hatch tool for Draft, and it's AMAZING!!!
Really helpful, and sometimes it avoid hatching in TD that for now it's not very handy.
Some bugs problem found in this teaser (in order of importance):
1) if you use the angle rotation, the hatch it's coming out of the face (see my attachement image here)
2) sometime if you import the object in TD the hatch it's not visible (it's all black)
3) changing scale or value in angle for the hatch, it's *really* slow in calculation, especially for some type of hatching (diamond, IE), and it's not usable (i tried to on a 6 core 12 thread Ryzen system with 32 GB of ram, so it's not an HW problem)
Rather then that, it's an incredible idea to create an hatching tool in draft, so we can draw directly in draft/arch and then export it in TD, that for now, as said, sadly it's not very handy for some workflow (even with the new beautiful and increbile TD tools script).
[Especially section plane cut imported in TD cannot make any dimensioning measure in TD, it's dramatic problem limitation of TD, IMHO]
It's very interesting too (in the future) to imagene the creation of a tool to manage and control the *.pat library and/or to create new patterns easily via an SVG file (like in Inkscape). IE for Arch should be inserted some basic roof patterns, with angle/direction.
Thanks again Yorik!!
I tried Hatch tool for Draft, and it's AMAZING!!!
Really helpful, and sometimes it avoid hatching in TD that for now it's not very handy.
Some bugs problem found in this teaser (in order of importance):
1) if you use the angle rotation, the hatch it's coming out of the face (see my attachement image here)
2) sometime if you import the object in TD the hatch it's not visible (it's all black)
3) changing scale or value in angle for the hatch, it's *really* slow in calculation, especially for some type of hatching (diamond, IE), and it's not usable (i tried to on a 6 core 12 thread Ryzen system with 32 GB of ram, so it's not an HW problem)
Rather then that, it's an incredible idea to create an hatching tool in draft, so we can draw directly in draft/arch and then export it in TD, that for now, as said, sadly it's not very handy for some workflow (even with the new beautiful and increbile TD tools script).
[Especially section plane cut imported in TD cannot make any dimensioning measure in TD, it's dramatic problem limitation of TD, IMHO]
It's very interesting too (in the future) to imagene the creation of a tool to manage and control the *.pat library and/or to create new patterns easily via an SVG file (like in Inkscape). IE for Arch should be inserted some basic roof patterns, with angle/direction.
Thanks again Yorik!!
- Attachments
-
- weps.png (364.89 KiB) Viewed 8653 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
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same
Re: Draft Hatch
It was Draft.qrc indeed! Really nice tool... bravo!
I can confirm the problem with the angle reported by ragohix769
I can confirm the problem with the angle reported by ragohix769
follow my experiments on BIM modelling for architecture design
Re: Draft Hatch
Maybe a minor detail, but the function in make_hatch.py should be called make_hatch. The name makeHatch should not be used at all as it follows the old, now obsolete, naming scheme. Or is the new scheme being abandoned?
The name of the class: Draft_Hatch_Object also seems strange to me when compared to other class names. If you follow the pattern of other classes you would expect just Hatch.
The name of the class: Draft_Hatch_Object also seems strange to me when compared to other class names. If you follow the pattern of other classes you would expect just Hatch.
Re: Draft Hatch
There are indeed issues with the positioning. Not only the rotation, but also if you apply a hatch on non-XY faces. But I couldn't yet figure out if it comes from my code or the TD algorithm.
About function/class names, indeed I might not have cared too scrupulously about python good practices, sorry... Will have a look next time I touch that code (feel free to PR too )
About function/class names, indeed I might not have cared too scrupulously about python good practices, sorry... Will have a look next time I touch that code (feel free to PR too )
Re: Draft Hatch
Changing:
Code: Select all
fpla = FreeCAD.Placement(bpoint,FreeCAD.Rotation(FreeCAD.Vector(0,0,1),norm))
Code: Select all
fpla = FreeCAD.Placement(face.Matrix)