Posts: 6,514
Threads: 284
Joined: Oct 2016
Reputation:
572
Gimp version:
Operating system(s): Linux
A first shot at the script discussed here, to render all kinds of hatchings.
Code is still wet, expect bugs, misfeatures, etc... but read the doc before asking questions.
This is a first shot, more features could come later, dash ends, colors, more complex dash patterns.
The script is here.
Enjoy. And read the doc.
Posts: 1,058
Threads: 87
Joined: Aug 2018
Reputation:
83
Gimp version:
Operating system(s): Windows Vista or 7, 8, 10 (64-bit)
09-03-2020, 11:36 PM
(This post was last modified: 09-04-2020, 12:16 AM by Krikor.)
hummm...
The menu entry for the script is
Filters>Render>Patterns>Hatching
Code:
menu='<Image>/Test' if 'OFN_DEBUG' in os.environ else '<Image>/Filters/Render/Pattern/'
desc='Hatching'
I must be tired today ... I don't see 'Hatching' in the Filters-Render-Patterns menu
Posts: 6,514
Threads: 284
Joined: Oct 2016
Reputation:
572
Gimp version:
Operating system(s): Linux
If you don't see ofn-hatching in the menus,it is probably because there was an error when the plugin tried to read the configuration file. On Windows, use gimp-console to see the startup messages.
Posts: 1,217
Threads: 182
Joined: Sep 2018
Reputation:
121
Gimp version:
Operating system(s): Windows (Vista and later)
While starting gimp the hatch plugin (text) appear on the screen, but I can not find it in the menu (Filters>Render>Pattern>Hatching). I can't also find no error concerning the hatch plugin with the gimp console. (windows 10 / gimp 20.10.20).
Posts: 7,277
Threads: 156
Joined: Oct 2016
Reputation:
1,014
Gimp version:
Operating system(s): Linux
Always willing to try out
How about including a ofn-hatching.json in the zip with the plugin and docs (I did skim through them but that is all)
Using that ealier post for a .json file I get this and letting Gimp rebuild the pluginrc file.
Code:
Querying plug-in: '/home/rich/.config/GIMP/2.10/plug-ins/ofn-hatching.py'
Traceback (most recent call last):
File "/home/rich/.config/GIMP/2.10/plug-ins/ofn-hatching.py", line 227, in <module>
config.loadConfiguration()
File "/home/rich/.config/GIMP/2.10/plug-ins/ofn-hatching.py", line 167, in loadConfiguration
self.hatchingStyleNames=sorted([s for s in self.jsConfig.keys() if s!='_'],key=lambda n:(self.jsConfig[n].get('order',99),n))
File "/home/rich/.config/GIMP/2.10/plug-ins/ofn-hatching.py", line 167, in <lambda>
self.hatchingStyleNames=sorted([s for s in self.jsConfig.keys() if s!='_'],key=lambda n:(self.jsConfig[n].get('order',99),n))
AttributeError: 'int' object has no attribute 'get'
gimp: LibGimpBase-WARNING: gimp: gimp_wire_read(): error
Terminating plug-in: '/home/rich/.config/GIMP/2.10/plug-ins/ofn-hatching.py'
Posts: 6,514
Threads: 284
Joined: Oct 2016
Reputation:
572
Gimp version:
Operating system(s): Linux
(09-04-2020, 09:52 AM)rich2005 Wrote: Always willing to try out 
How about including a ofn-hatching.json in the zip with the plugin and docs (I did skim through them but that is all)
Gaaah... I knew I was forgetting something. Fixed, just redownload the ZIP...
Posts: 7,277
Threads: 156
Joined: Oct 2016
Reputation:
1,014
Gimp version:
Operating system(s): Linux
Looks fine to me.
Now, that is great for those mechanical types, but what about us poor civil engineers
Posts: 6,514
Threads: 284
Joined: Oct 2016
Reputation:
572
Gimp version:
Operating system(s): Linux
(09-04-2020, 10:49 AM)rich2005 Wrote: Looks fine to me.
Now, that is great for those mechanical types, but what about us poor civil engineers 
Bucket-fill with pattern is your friend
Posts: 7,277
Threads: 156
Joined: Oct 2016
Reputation:
1,014
Gimp version:
Operating system(s): Linux
(09-04-2020, 11:27 AM)Ofnuts Wrote: Bucket-fill with pattern is your friend 
Yes, that was a couple of minutes to make a 'tilable' clipboard pattern(s).
Would it be possible to take a small svg path and tile it into a selection ? For bitmaps there is the old RobA scale pattern script-fu but that can leave the pattern fuzzy. Thinking of a scalable path-based plugin. On the other hand, there is always LibreCAD.
Posts: 1,217
Threads: 182
Joined: Sep 2018
Reputation:
121
Gimp version:
Operating system(s): Windows (Vista and later)
Ofnuts, the plugin is working fine on my PC. Just trying out different settings. As rich mentioned, on a existing CAD drawing it is easy to hatch it. On a jpg or png file, it is sometimes the only option to correct the hatching on some cross-sections. The ofnuts hatch plugin is a handy tool for this. Thanks.
|