GIMP Chat
http://gimpchat.com/

Simple path shapes
http://gimpchat.com/viewtopic.php?f=9&t=14742
Page 3 of 6

Author:  trandoductin [ Tue Oct 25, 2016 9:47 pm ]
Post subject:  Re: Simple path shapes

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.

Author:  Graechan [ Tue Oct 25, 2016 11:14 pm ]
Post subject:  Re: Simple path shapes

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

Author:  trandoductin [ Tue Oct 25, 2016 11:24 pm ]
Post subject:  Re: Simple path shapes

no because i want to allow user to apply ruler/protractor to
a selection as well.

Author:  Graechan [ Wed Oct 26, 2016 12:09 am ]
Post subject:  Re: Simple path shapes

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)

Author:  MareroQ [ Wed Oct 26, 2016 2:38 am ]
Post subject:  Re: Simple path shapes

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 1611 times ]

Author:  Rod [ Wed Oct 26, 2016 6:48 am ]
Post subject:  Re: Simple path shapes

MrQ shapes (Wilber) and Ofnuts slinky. :)

Image

Author:  Pat625 [ Wed Oct 26, 2016 10:11 am ]
Post subject:  Re: Simple path shapes

MareroQ and Rod: Love those renditions of Wilber!! Very Cute.

Author:  trandoductin [ Wed Oct 26, 2016 4:20 pm ]
Post subject:  Re: Simple path shapes

which part seems wrong?

Author:  ofnuts [ Wed Oct 26, 2016 6:43 pm ]
Post subject:  Re: Simple path shapes

trandoductin wrote:
which part seems wrong?


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

Author:  Graechan [ Wed Oct 26, 2016 6:51 pm ]
Post subject:  Re: Simple path shapes

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

Author:  trandoductin [ Wed Oct 26, 2016 7:11 pm ]
Post subject:  Re: Simple path shapes

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.

Author:  Graechan [ Wed Oct 26, 2016 7:38 pm ]
Post subject:  Re: Simple path shapes

I'm using 'Simple path shapes centered' Rel 9 on a 600x400 image with no selection in place and the output is below
Image

Author:  Graechan [ Wed Oct 26, 2016 8:04 pm ]
Post subject:  Re: Simple path shapes

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

Author:  Graechan [ Wed Oct 26, 2016 11:43 pm ]
Post subject:  Re: Simple path shapes

'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

Author:  MareroQ [ Thu Oct 27, 2016 1:22 am ]
Post subject:  Re: Simple path shapes

Will it be better?

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

Author:  Graechan [ Thu Oct 27, 2016 2:37 am ]
Post subject:  Re: Simple path shapes

MareroQ yes that looks perfect but I gather you increased the image size

Author:  Graechan [ Thu Oct 27, 2016 6:03 am ]
Post subject:  Re: Simple path shapes

'Draw percentage ruler' functions perfectly, if you can get 'Simple path shapes' to work the same for all shape choices that would be great

Author:  mahvin [ Thu Oct 27, 2016 10:43 am ]
Post subject:  Re: Simple path shapes

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?

Author:  MareroQ [ Thu Oct 27, 2016 2:26 pm ]
Post subject:  Re: Simple path shapes

I'm not sure that's it...

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

Author:  Graechan [ Thu Oct 27, 2016 7:51 pm ]
Post subject:  Re: Simple path shapes

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

Page 3 of 6 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/