Gimp-Forum.net
ofn-hatching - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: ofn-hatching (/Thread-ofn-hatching)

Pages: 1 2


ofn-hatching - Ofnuts - 09-03-2020

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.


RE: ofn-hatching - Krikor - 09-03-2020

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


RE: ofn-hatching - Ofnuts - 09-04-2020

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.


RE: ofn-hatching - denzjos - 09-04-2020

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).


RE: ofn-hatching - rich2005 - 09-04-2020

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'



RE: ofn-hatching - Ofnuts - 09-04-2020

(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...


RE: ofn-hatching - rich2005 - 09-04-2020

Looks fine to me.

[attachment=4852]

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

[attachment=4853]


RE: ofn-hatching - Ofnuts - 09-04-2020

(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


RE: ofn-hatching - rich2005 - 09-04-2020

(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.


RE: ofn-hatching - denzjos - 09-04-2020

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.