It is currently Thu Apr 25, 2024 9:19 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 63 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: HN: Draw arrow - Arrows, block and flow diagrams and dimensioning
PostPosted: Fri Dec 14, 2018 9:23 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
After having dealt intensively with GIMP and the creation of Python plugins, I present my plugin "HN: Draw arror" / "HN: Pfeil zeichnen" in different language versions.
You can see the appearance of the user interface in the miniature views. Thanks to "ofnuts" for his help.
Attachment:
File comment: Arrow types and their appearance
Arrow types and their appearance_wide.png
Arrow types and their appearance_wide.png [ 995.59 KiB | Viewed 2614 times ]
Attachment:
File comment: Labeling&flex arrow, Block&flow diagram, Technical drawing
Labeling&flex arrow, Block&flow diagram, Technical drawing.png
Labeling&flex arrow, Block&flow diagram, Technical drawing.png [ 129.88 KiB | Viewed 2718 times ]
Version maintenance:
2018-11-22 First version of the plugin, that I have been developing since the end of Oktober 2018.
..
2023-08-27 Improvements/bug fixes:
At arrow type "Dimensioning with auxiliary lines", the "Filling type of arrowhead" setting was only applied to the first arrowhead, but not to the second arrowhead.
Some code fixes for later migration from Python 2 to Python 3.
2023-10-07 Improvements/bug fixes:
Added new arrow style "Coordinate axis (path segment, with markers, triangle head)".
Storage of presets has been completely reworked so that the path can also be stored. Attention: Tool presets created before this version, cannot longer be used!
2023-10-15 Improvements/bug fixes:
When naming the tool presets, all characters ~“#%&*:<>?/\{|}ÄÖÜäöüß are converted to _.
Reworked the "Coordinate Axis" arrow so that axes/markers are meaningful and logical.
Attention: The new library is necessary!

Tested with:
GIMP 2.10.34 (Revision 2) installed on Windows 10, Debian Linux and Manjaro Linux.

Installation description:
Descriptions in English and German for installing the plug-in and the associated library module on Windows 10, Debian Linux and Manjaro Linux.

Download plug-in, library (module), documentation and installation description:
Downloads (DON'T FORGET THE LIBRARY) :coolthup In the base directory you will find an English and German installation description!

Important:
As from version 2020-04-15, the plugin will consist of two parts. The plugin "HN-Pfeil-zeichnen_YYYY-MM-DD.zip" and a library module "HN_Bibliothek_YYYY-MM-DD.zip".
Therefore, please ALWAYS install or update the plug-in and the library module together!

The library module is also used by the other plug-in I created "HN-Draw-shape" for creating paths and drawing shapes.
If you are interested in this plugin too, just have a look at the topic "HN-Draw-shape: Create paths draw shapes simultaneously and easily".

Tips for quick starters:
- Unzip "HN-Pfeil-zeichnen_YYYY-MM-DD.zip" into the private "plug-ins" folder and "HN_Bibliothek_YYYY-MM-DD.zip" in the private "modules" folder.
- Please read the user manual "Plug-in HN-Draw-arrow.pdf" for detailed installation and user instructions!
- For information on contents of the download folder, please read the file "!LiesMich+ReadMe.txt"!

Finally, I would have the following wishes:
1. In computer science, the principle "No program without errors" applies. So if you find a bug in my plug-in, please don't complain, but describe the bug in as much detail as possible and let me know.
2. English is not my native language. If you have any suggestions for improvements to the interface, help, messages, or anything else, please let me know as well.


Attachments:
File comment: UI depending on showHints in Plugin-Start.txt
UI depending on showHints in Plugin-Start.txt.png
UI depending on showHints in Plugin-Start.txt.png [ 140.13 KiB | Viewed 2718 times ]


Last edited by Herbie on Sat Apr 20, 2024 5:40 am, edited 90 times in total.
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: My own "draw arrow" script programmed
PostPosted: Fri Dec 14, 2018 11:10 am  (#2) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
alright another scripter! yeh!

_________________
TinT


Top
 Post subject: Re: My own "draw arrow" script programmed
PostPosted: Fri Dec 14, 2018 12:35 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
You should look into Python dictionaries, your code could be much simpler (long sequences of if/elif).

_________________
Image


Top
 Post subject: Re: My own "draw arrow" script programmed
PostPosted: Sun Dec 16, 2018 9:47 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
Hello Ofnuts, thank you for the very big "help". In my world, real help looks a little different! To give an advice and refer only to a literature is not helpful. Really helpful would be to list a range of code from the script and present a possible solution.


Top
 Post subject: Re: My own "draw arrow" script programmed
PostPosted: Mon Dec 17, 2018 2:43 am  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
For instance:

functions={"Lanzenpfeil":self.zeichneLanzenpfeil,"Hinweispfeil",self.zeichneHinweispfeil} # You can figure out the rest
functions[stilGewaehlt]()


Something similar can be done around line 519, keeping parameters of functions as a dictionary of tuples.


This can also be useful: https://www.gimp-forum.net/Thread-Pytho ... es-by-name

https://www.youtube.com/watch?v=z43bmaMwagI

_________________
Image


Top
 Post subject: Re: My own "draw arrow" script programmed
PostPosted: Thu Dec 20, 2018 11:54 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
Hello Ofnuts, thank you for your help. I could simplify a lot. Can you look at lines 641 through 649? Is it possible to integrate these definitions into the "pfeilDaten" at line 55?


Top
 Post subject: Re: My own "draw arrow" script programmed
PostPosted: Thu Dec 20, 2018 3:33 pm  (#7) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Herbie wrote:
Hello Ofnuts, thank you for your help. I could simplify a lot. Can you look at lines 641 through 649? Is it possible to integrate these definitions into the "pfeilDaten" at line 55?


The code in German makes things complicated for me. Another simplication:

pfeilDaten        = { # "Auswahltext", "Wechsel Pfeilspitz-Position", "Mit Schaftkreis" )
    "Lanzenpfeil"     : ( "Lanzenpfeil (Assegai-Speer aus Afrika)",            True,  False),
    "Hinweispfeil"     : ( "Hinweisspfeil (Rechtwinkliger Schaft, Dreiecksspitze)",      True,  False),
    "Bemassungspfeil"     : ( "Bemassungspfeil (Dreiecksspitzen an beiden Enden)",      False, False),
# [etc..]


And then where you use you "pfeilTypen" you can just use "pfeilDaten.keys()" or even just "pfeilDaten" when you iterate: "for aktStil in pfeilDaten"

_________________
Image


Top
 Post subject: Re: My own "draw arrow" script programmed
PostPosted: Fri Dec 21, 2018 4:56 am  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Herbie wrote:
Hello Ofnuts, thank you for your help. I could simplify a lot. Can you look at lines 641 through 649? Is it possible to integrate these definitions into the "pfeilDaten" at line 55?


Yes, but it is a bit more complicated. Lines 641-649 are in a method scope and use instance methods that are already bound to an instance, and you cannot do that where you define pfeilDaten at global scope. What you can do however is store unbound methods in pfeilDaten: "dialogFenster.zeichne...." and then use pfeilDaten[pfeilGewaehlt][3](self).

Speaking of pfeilDaten, you should look into replacing the plain tuples by named tuples. They work the same way, but in addition to using indices to access items, you can also use names, so instead of "pfeilDaten[pfeilGewaehlt][3](self)" you can use "pfeilDaten[pfeilGewaehlt].funkt(self)".

_________________
Image


Top
 Post subject: Re: My own "draw arrow" script programmed
PostPosted: Fri Dec 21, 2018 12:30 pm  (#9) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Learn something every day. Looking at your code and the configuration of unbound methods I wondered how such dynamically selected method could be used in UI callbacks (that require the method to be bound to some instance, for instance "self.callbackmethod"). It appears that you can do it, see https://stackoverflow.com/questions/101 ... od#1015405

_________________
Image


Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Sat Apr 06, 2019 9:12 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
For more convenience, I've created the ability to create, delete and load tool presets in the plugin.

For Downloads, see the beginning of the topic.


Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Sat Jun 22, 2019 1:37 pm  (#11) 
Offline
GimpChat Member

Joined: Jun 22, 2019
Posts: 5
Hi,

I would like to give your plugin a try; I am hoping that my lack of German won't be a barrier.

How do I install the plugin so that it reads the English language XML file?

My first attempt was to copy the plugin and the folder "locale" into my plug in directory. The plugin shows correctly in the Filters folder, but it is in German. I deleted the German XML file and that did not change anything.

Thanks!


Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Mon Jun 24, 2019 10:48 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
The windows of the plugin were programmed with "GimpUI", so that the surface looks like in GIMP.

Appearance of the surface, download and installation, see the beginning of the topic!


Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Mon Jun 24, 2019 12:21 pm  (#13) 
Offline
GimpChat Member

Joined: Jun 22, 2019
Posts: 5
I didn't see anything in the first post that would render the windows in English rather than in German; there is an announcement of an English-language version but nothing else.

When I installed, it's all in German. The EN XML file is in the folder along with the German XML version.


Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Mon Jun 24, 2019 12:46 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
What Language is selected under "Edit -> Preferences -> Interface"?


Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Tue Jun 25, 2019 3:14 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Hi Herbie.

Your plugin has many advantages (the most important for me is: a large number of possible settings, the ease of adding translations to other languages, saving presets).
However bothers a very large window size - can you add bookmarks? (or version without instructions - because the plugin is intuitive to use - and it is enough to get acquainted once).
Optional: change the default language to English - but a different one according to the user's choice?

ps. No information: if this is a GPL licensed plugin?


Attachments:
Wish for the appearance of the pluginHN ArrowsCreator.png
Wish for the appearance of the pluginHN ArrowsCreator.png [ 103.47 KiB | Viewed 13774 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Thu Jun 27, 2019 4:23 pm  (#16) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
At the suggestion of GimpChat member "MareroQ", I have created a user interface with and without instructions to create an arrow.
Please read my short, unfinished English description!

Standard user interface with instruction at top:
Attachment:
File comment: User interface with instructions.
4.1 Main window of plugin (1).png
4.1 Main window of plugin (1).png [ 47.99 KiB | Viewed 13714 times ]

User interface without instruction at top:
Attachment:
File comment: User interface without instructions.
4.1 Main window of plugin (2).png
4.1 Main window of plugin (2).png [ 21.33 KiB | Viewed 13714 times ]


Appearance of the surface, download and installation, see the beginning of the topic!


Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Fri Jun 28, 2019 5:37 am  (#17) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Thank You for the very quick implementation of my request/suggestion.
Very interesting guide Plugin HN-Draw-arrow.pdf(en) - let me know when it will be finished.

I will give here Your clue how to change the interface's appearance
Interface without instructions:
line 85 mitHilfeImFenster = False replace to mitHilfeImFenster = True.

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Fri Jun 28, 2019 11:54 am  (#18) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
Note, how to change the appearance of the user interface.

Interface without instructions:
line 85 "mitHilfeImFenster = True" replace to "mitHilfeImFenster = False".[/quote]

"mitHilfeImFenster" is equivalent to "withHelpInWindow".


Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Sat Jul 13, 2019 11:13 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
News:
Since 28.06.2019 there is a Polish translation for the user interface. Thanks to Marek (MareroQ).
Since 05.07.2019 errors in the visibility test of the shaft disc are no longer available.
Since 13.07.2019 the curved arrow is calculated with system routines and is thus faster than before.
Since 13.07.2019 a documentation is available in German and also in English. Because my English is not very good, I am very grateful for suggestions!

For all information and downloads, see the beginning of the topic.


Top
 Post subject: Re: Own "draw arrow" (Pfeil zeichnen) plugin programmed
PostPosted: Thu Mar 05, 2020 10:14 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Hi Herbert.

Thanks for the sysematic improvement of the plugin.

I have a problem - your plugin does not work (does not register in the menu) when using Python MSC (e.g. Gimp 2.10.18 Partha which uses Python 2.7.5 MSC v.1500 64 bit).
I use Python 2.7.16 MSC v.1500 64 bit and the same problem.
For versions from gimp.org and Portable Samj which uses Python 2.7.17 GCC 64 bit everything works as expected.
This is surprising to me because Python MSC is much better with extended Gimp plugins than Python GCC.
Any tip on how to solve this problem?


edit: The update from 23-03-2020 solved the problem.
Thank you.

_________________
Image

Slava
Ukraini!


Last edited by MareroQ on Mon Mar 23, 2020 10:56 am, edited 1 time in total.

Top
Post new topic Reply to topic  [ 63 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Draw Arrows/Draw Shapes: Sorry! My download link hadn't worked.

0

No new posts Attachment(s) Draw arrow script recommendations

6

No new posts Attachment(s) HN: Draw shape - Create paths draw shapes simultaneously and easily

31

No new posts I cannot make the draw tool actually draw

3

No new posts Just brainstorm with diagrams and hack it out

5



* Login  



Powered by phpBB3 © phpBB Group