Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ofn-hatching
#1
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.
Reply
#2
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   Huh
Reply
#3
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.
Reply
#4
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).
Reply
#5
Always willing to try out Wink

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'
Reply
#6
(09-04-2020, 09:52 AM)rich2005 Wrote: Always willing to try out Wink

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...
Reply
#7
Looks fine to me.

   

Now, that is great for those mechanical types, but what about us poor civil engineers Wink

   
Reply
#8
(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 Wink

Bucket-fill with pattern is your friend Smile
Reply
#9
(09-04-2020, 11:27 AM)Ofnuts Wrote: Bucket-fill with pattern is your friend Smile

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.
Reply
#10
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.
Reply


Forum Jump: