Gimptalk - Premier Gimp Community: Is there a polygon tool in gimp? - Gimptalk - Premier Gimp Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Is there a polygon tool in gimp?

#1 User is offline   stanmarsh 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 17-November 09

Posted 24 November 2009 - 05:57 AM

Hello,

is there a polygon tool in gimp similar to photoshop to create different shapes quickly? i need to create a triangle with a 60 degree angle.

cheers
0

#2 User is offline   ccbarr 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 1,705
  • Joined: 23-February 06

Posted 24 November 2009 - 06:50 AM

stanmarsh,

First you can try Gfig:

Filters | Render | Gfig

There are various options to choose from, but one of them is polygon. Also, there are options to show a grid to snap to when making your polygon, whether to fill your polygon with a color, brush used to make the outline of your polygon, etc. That can work pretty well, but will take some getting used to.

The other approach that I can think of is a more complex approach, but has it's advantages too.

You can install the following script:

http://registry.gimp...e-path-0.91.scm

Just right-click on the above link and from the menu that opens select Save Link As or Save As, whatever your browser options provide for saving a link. Naturally, save it as it is named "shape-path-0.91.scm" in your Gimp scripts folder.

If you do not know where to find your Gimp scripts folder, simply select:

Edit | Preferences from a Gimp image window

This opens the Preferences Dialog window. Inside this window, on the left side you will see a column list with various headings. Towards the bottom of that list you will see a heading titled: Folders

Just to the left of Folders is a little triangle. Click on it to expand the Folders section. You will then see a heading named Scripts. Click on it and the look on the right hand side of the Preferences window. You will see a box showing you the path to the location of your scripts folder.

After placing the script in your Gimp scripts folder, you can either restart Gimp, or just select:

Filters | Script-Fu | Refresh Scripts

Give Gimp a bit to refresh the scripts. You should now have a new Script-Fu heading at the top of your Gimp image windows. After either opening an image to work on, or opening a New image window, you can select:

Script-Fu | Shapes

You will then see a menu of various shapes that you can select from. The script makes polygon paths. By default, it places the center of the polygonal paths at the upper left corner of your image window (X=0, Y=0). So make sure that you adjust your object center to somewhere more towards the center of your image (for instance, for a 400x400px image, place the center at X=200, Y=200). Then you need to tell it what the radius of your polygon will be. A radius of 100 might be a good start.

Once it makes the polygon, you will then have to look in your Paths dialog window. To find the Paths dialog window, just select from any Gimp image window:

Windows | Dockable Dialogs | Paths

You will see the desired shape as a thumbnail image in the Paths window. Click on the shape path name to activate it, then right-click on the path and select:

Path To Selection

(or instead of right-clicking on the shape path, after selecting it, there are little buttons at the bottom of the Path window, and if you hover your mouse over them, one of them will again show Path to Selection

You can then either fill in the selection with whatever color you prefer, or you can stroke the selection by selecting:

Edit | Stroke Selection

Hope some of this can help you.

:)
0

#3 User is offline   saulgoode 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 5,324
  • Joined: 22-August 05

Posted 24 November 2009 - 07:09 AM

You could also use the Free Select tool to outline polygonal shapes, then use the Stroke Selection command.
Everybody makes their own fun. If you don't make it yourself it's not fun, it's entertainment.
0

#4 User is offline   Oregonian 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,360
  • Joined: 13-November 07

Posted 24 November 2009 - 10:37 PM

Since all the sides in 60° triangle are equal, doing it with paths is fairly easy. Decide what size you want the sides. This one has 360px sides. I started with a 400x400px image. Fill the background layer with white.

Make a new transparent layer and name it triangle.

    [*:1o771u0w] Image > Grid. I made the grid size 20x20. I made my gridlines solid and made the foreground color neon green.
    [*:1o771u0w] View > Snap to Grid
    [*:1o771u0w] View> Show Grid
    [*:1o771u0w] Image > Guide > New Guide. I made vertical guides at 20, at 200, and at 380, and a horizontal guide at 380.
    [*:1o771u0w] Click the Paths tool. Click the corner of the left guideline and the right guideline where they meet the bottom guideline. See the image below.
    [*:1o771u0w] Click the Paths tab in the Layers window. Rename the path side#1, and duplicate it twice to have 3 paths. Turn the eye on by each path. The paths will be visible in your image window for now.

Posted Image
    [*:1o771u0w] Select path#2 in the Paths window. Click the rotate tool and in the dialog click the path icon (see inset in the image below). Click the image window and in the rotate dialog make the rotation 60 degrees.
    [*:1o771u0w] Select the Move tool. Click the path icon in the dialog (see inset in image). Move the path to snap to the center and right bottom guidelines.
    [*:1o771u0w] Select path#3 and click the rotate tool. Rotate it -60 degrees. Move it as you did the other one to the left and center guidelines.
    [*:1o771u0w] Make sure all of the eyes are on in the Paths tab.
    [*:1o771u0w] Right-click a path and merge visible paths. You should have one path preview that is a triangle.
    [*:1o771u0w] Turn the eye off next to it

Posted Image
    [*:1o771u0w] Choose the Paintbrush and make the size Circle (03).
    [*:1o771u0w] Make the Foreground color the color you want your triangle.
    [*:1o771u0w] Click the Stroke path button at the bottom of the Paths window.
    [*:1o771u0w] Choose Stroke with a paint tool. Stroke with the Paintbrush. If the stroke won't stroke the triangle. Make a new transparent layer. Sometimes it gets cranky.

Posted Image
Posted Image
Posted Image
0

#5 User is offline   stanmarsh 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 17-November 09

Posted 25 November 2009 - 03:51 AM

Thank you ccbarr, saulgoode, Oregonian! :D
0

#6 User is offline   Odedge 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 26-November 09

Posted 26 November 2009 - 07:46 AM

ccbarr said:

stanmarsh,

First you can try Gfig:

Filters | Render | Gfig

There are various options to choose from, but one of them is polygon. Also, there are options to show a grid to snap to when making your polygon, whether to fill your polygon with a color, brush used to make the outline of your polygon, etc. That can work pretty well, but will take some getting used to.


I just played around with this Filter and besides the limitation of a 400 pixel working area (that's converted to your image size), it's a great tool for what I want to make with GIMP.

Thanks for the info. :wink:
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic