It is currently Tue Jul 02, 2024 6:14 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 115 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Simple path shapes
PostPosted: Tue Oct 25, 2016 9:47 pm  (#41) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
i don't know how it's added ... i just get selection bounding box values.
and when there's no selection the bounding box should return 0,0 image.width and image.height.
unless there's a selection before calling my code.

_________________
TinT


Top
 Post subject: Re: Simple path shapes
PostPosted: Tue Oct 25, 2016 11:14 pm  (#42) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
trandoductin wrote:
i don't know how it's added ... i just get selection bounding box values.
and when there's no selection the bounding box should return 0,0 image.width and image.height.
unless there's a selection before calling my code.

your code starts by closing any selection "pdb.gimp_selection_none(image)"

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Simple path shapes
PostPosted: Tue Oct 25, 2016 11:24 pm  (#43) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
no because i want to allow user to apply ruler/protractor to
a selection as well.

_________________
TinT


Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 12:09 am  (#44) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
I'm just an old scheme writer but I'm sure something is wrong with maths

protractor from 'Simple path shapes' starts as below
# Draw_Protractor Rel 1 [download: https://gimplearn.net/viewtopic.php?t=3&t=175#p512]
# Created by Tin Tran https://gimplearn.net
# Comments directed to http://gimpchat.com or http://gimpscripts.com

pdb.gimp_selection_none(image)
if sel == False:
x1 = 0
y1 = 0
x2 = W
y2 = H

W = float(abs(x2-x1))
H = float(abs(y2-y1))
radius = min(W,H)/2.0
midx = x1 + (W/2.0)
midy = y1 + (H/2.0)

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 2:38 am  (#45) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
Thanks for test

Rel 0.9:
- Repair of error for "Protractor" and "Ruler" (not centered when no selection).
- Show a selection, after you run the shape, when you select "In Selection" on the menu.
- Shapes "Protractor" rel 3: Draw marks as a single stroke for speed, outside and inside circle
- Add shape: "Wilber"


Attachments:
Wilber shape.png
Wilber shape.png [ 65.19 KiB | Viewed 1602 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 6:48 am  (#46) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
MrQ shapes (Wilber) and Ofnuts slinky. :)

Image

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 10:11 am  (#47) 
Offline
GimpChat Member

Joined: May 12, 2015
Posts: 4694
MareroQ and Rod: Love those renditions of Wilber!! Very Cute.


Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 4:20 pm  (#48) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
which part seems wrong?

_________________
TinT


Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 6:43 pm  (#49) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4752
trandoductin wrote:
which part seems wrong?


Code formatted centered like this will give you an indentation error :)

_________________
Image


Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 6:51 pm  (#50) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Nah Nah Nah (close but no cigar) In protractor you left me with a selection i did not start with, in ruler you also left a selection i did not start with and the horizontal rulers did not cover the entire width of the image :bawl

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 7:11 pm  (#51) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4001
Location: Canada
There's no selection code at all it just draws a path/vector.
And I just tried ruler and it covered the entire width of image.

_________________
TinT


Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 7:38 pm  (#52) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
I'm using 'Simple path shapes centered' Rel 9 on a 600x400 image with no selection in place and the output is below
Image

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 8:04 pm  (#53) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
The preferred output for using 'Simple path shapes centered' Rel 9 on a 600x400 image with no selection in place and the output is as per the 'draw percentage ruler' script below
Image

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Simple path shapes
PostPosted: Wed Oct 26, 2016 11:43 pm  (#54) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
'Simple path shapes' now returns a selection with the path due to this line added at the end↓
Image
An existing selection should be saved to a channel and a marker set to TRUE at the start of the script so it can be returned at the end

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Simple path shapes
PostPosted: Thu Oct 27, 2016 1:22 am  (#55) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
Will it be better?


Attachments:
Options.png
Options.png [ 5.29 KiB | Viewed 1225 times ]

_________________
Image

Slava
Ukraini!


Last edited by MareroQ on Fri Oct 28, 2016 9:28 am, edited 1 time in total.
Top
 Post subject: Re: Simple path shapes
PostPosted: Thu Oct 27, 2016 2:37 am  (#56) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
MareroQ yes that looks perfect but I gather you increased the image size

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Simple path shapes
PostPosted: Thu Oct 27, 2016 6:03 am  (#57) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
'Draw percentage ruler' functions perfectly, if you can get 'Simple path shapes' to work the same for all shape choices that would be great

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Simple path shapes
PostPosted: Thu Oct 27, 2016 10:43 am  (#58) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
MareroQ,

I'm going to have to backtrack on my "just one" request and kindly request another: pie slices. It seems a tutorial in question utilizes the pie slice and I think it would make a very unique and widely used shape. Preferrably 1/8th, 1/4th, and half moon. Of course, this is a request, and is totally up to you for consideration. I do know there is a pie shape, however, it's 3/4 shapes, overlapped. Is it possible to render them in individual slices?

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Simple path shapes
PostPosted: Thu Oct 27, 2016 2:26 pm  (#59) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
I'm not sure that's it...


Attachments:
Pie.png
Pie.png [ 117.04 KiB | Viewed 1179 times ]

_________________
Image

Slava
Ukraini!


Last edited by MareroQ on Fri Oct 28, 2016 9:28 am, edited 1 time in total.
Top
 Post subject: Re: Simple path shapes
PostPosted: Thu Oct 27, 2016 7:51 pm  (#60) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Good morning MareroQ, your ruler still does not produce the desired outcome without a selection in place [such as full image size] should have output as below↓ (done after select-all)
Image
but instead the rulers are incorrect
Image
Also the length of the divisions on the ruler are tied to the stroke width rendering it impracticable to use the stroke feature.
at the start of the script if no selection is found select all and set your [in selection] toggle to yes remembering to set your return selection marker to no and run your script as if a selection was made
perhaps make the length of the divisions in ruler relate to the resize layer lengths

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 115 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Simple Geometric Shapes Art using Neural Network

2

No new posts Attachment(s) i struggle with the option to copy the path - the path where a file i

3

No new posts Is there a 'shapes' tool ?

8

No new posts Attachment(s) Abstract Art by Discovery out of Geometric/Basic Shapes

10

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

0



* Login  



Powered by phpBB3 © phpBB Group