[SOLVED] Polygon and diagonal

Post questions on how to use or achieve an effect in Inkscape.
User avatar
d4rkheart
Posts: 32
Joined: Fri May 27, 2011 9:34 am

[SOLVED] Polygon and diagonal

Postby d4rkheart » Fri May 27, 2011 9:46 am

Hi, i'm a new user. Exist an extension for inkscape that automatically can creates polygons of N sides and its opposite angles united by diagonal? Compatible for windows and linux if is possible. I have created manually an example with a polygon of 10 sides, but when the polygon has 20 sides is an impossible work. Who can help me? Thanks to everyone.
Image

http://imageshack.us/photo/my-images/35/g4726copia.png/
Last edited by d4rkheart on Sun May 29, 2011 2:49 am, edited 2 times in total.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Polygon and diagonal

Postby brynn » Fri May 27, 2011 2:49 pm

Hi d4rkheart,
Image
Welcome to InkscapeForum!

I don't know of such an extension, but there are extensions scattered about, on the internet. So I would suggest an internet search. Also have a look through the Inkscape Resources forum here. Sometimes people share extensions they've written there. And don't forget to look in Inkscape too -- especially Extensions menu > Render has some very interesting possibilities. I haven't tried them all, so there might already be something there.

As for drawing this type of thing, by this description
...polygons of N sides and its opposite angles united by diagonal

I think you might be able to do it with a radially tiled clone (Edit menu > Clone > Create tiled clones). Instructions can be found in Help menu > Tutorials > Tips and Tricks.

But looking again at your image, it's not just opposite angles that are connected by a line. Every angle is connected by a line to all the angles. I'm not sure if a radially tiled clone could do that. But it would be an interesting exercise to try, lol. I'm tempted.....I'll let you know if I can find some time.

Of course the tiled clone solution is not as "automatic" as an extension would be. :D

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Polygon and diagonal

Postby Xav » Fri May 27, 2011 9:45 pm

Based on the description - connecting each corner to the opposite corner - I would do this:

1) Create your polygon
2) Convert to path
3) Split the path at two opposite nodes, resulting in two paths, one for each half of the polygon
4) Use the Extrude extension to connect the two paths, which will result in all the opposite nodes being connected

However based on the image you included, that's not actually what you want - you want every node connected to every other node. In that case I don't know of an automated way to do it, but this manual approach isn't too bad:

[list=]
[*] Create your polygon
[*] Convert to path
[*] Switch to the :tool_pen: tool
[*] Set the snapping to "Snap to Nodes" and "Snap to cusp nodes"
[*] Pick a starting node, which we'll call 1. There's already a line to node 2, so the next one to connect to is node 3.
[*] Click on node 1 then double click on node 3.
[*] Click on node 1 then double click on node 4
[*] ... repeat until node 1 is connected to all the other nodes
[*] Group the whole lot
[*] Edit=>Clone=>Create Tiled Clones
[*] Hit the reset button then enter the number of nodes in your polygon (N) for "Rows" and 1 for "Columns"
[*] Set "Shift Y" in the "Per Row" column to -100% in order to make all the clones appear on top of each other
[*] Set the "Per Row" rotation to 360/N
[*] Hit the Create button
[/list]

So for a 20 sided polygon you have to draw an extra 17 lines, then create 20 clones with a rotation of 18 degrees (360/20). My attempt here took about 3 minutes - far less time than writing a description:

SVG Image

Be careful of bug #168651 though - you may be best doing this in a fresh document then copy/pasting it to the final destination.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

User avatar
d4rkheart
Posts: 32
Joined: Fri May 27, 2011 9:34 am

Re: Polygon and diagonal

Postby d4rkheart » Fri May 27, 2011 10:29 pm

thanks @Brinn for your welcome, I have searched in vain on internet this extension but nothing, maybe I did not look good :(
thanks Xav, I'll try to follow your instructions.
I'm sorry for my english, i'm italian.

User avatar
d4rkheart
Posts: 32
Joined: Fri May 27, 2011 9:34 am

Re: Polygon and diagonal

Postby d4rkheart » Sat May 28, 2011 12:17 am

Xav , you're awesome!!! Thanks...i have solved, i love inkscape :)

llogg
Posts: 443
Joined: Tue Mar 11, 2008 7:30 am

Re: Polygon and diagonal

Postby llogg » Sat May 28, 2011 9:15 am

d4rkheart wrote:Hi, i'm a new user. Exist an extension for inkscape that automatically can creates polygons of N sides and its opposite angles united by diagonal? Compatible for windows and linux if is possible. I have created manually an example with a polygon of 10 sides, but when the polygon has 20 sides is an impossible work. Who can help me? Thanks to everyone.
Image

http://imageshack.us/photo/my-images/35/g4726copia.png/
Here you go. Does exactly what you want.

User avatar
d4rkheart
Posts: 32
Joined: Fri May 27, 2011 9:34 am

Re: Polygon and diagonal

Postby d4rkheart » Sat May 28, 2011 10:18 am

@llogg, yes...it's exactly what i want....but is complicate on this tutorial, i don't know how to apply this effect ;(
Can you help me? Thanks.

llogg
Posts: 443
Joined: Tue Mar 11, 2008 7:30 am

Re: Polygon and diagonal

Postby llogg » Sat May 28, 2011 10:56 am

1. Draw 20 sided polygon with :tool_star: .
2. Convert to path.
3. :tool_node: to select all nodes and break path at selected nodes (fourth button from the left).
4. Path>Path effects editor. Select "stitch subpaths" from the drop down menu. Set the number of paths to 2.

There may be a bug with how inkscape displays the result but if you use :tool_zoom: and do "zoom to fit selection in window" it will correct itself.

User avatar
d4rkheart
Posts: 32
Joined: Fri May 27, 2011 9:34 am

Re: Polygon and diagonal

Postby d4rkheart » Sat May 28, 2011 11:53 pm

Thanks llog, is possible set the number of path in advance? When i work with polygon of 30 nodes crash inkscape because initially the number of paths is 5.

llogg
Posts: 443
Joined: Tue Mar 11, 2008 7:30 am

Re: Polygon and diagonal

Postby llogg » Sun May 29, 2011 12:23 am

Yeah, 30 just about killed my system too. I don't know of a way to change the default setting of the effect, but I do have a work-around. Draw your polygon and convert to path. Select just one node and break path at node. Apply the stitch subpath effect. Now your CPU is not taxed and you can change the number of paths to 2. Then select the remaining nodes and break path and watch for smoke coming out of your computer case. As warned in Tavmjong's manual, Inkscape has a problem rendering this effect at high numbers of nodes, and it looks like 30 is across that boundary (at least on my system). I did get it to render correctly after zooming in on a small portion and then zooming back out. Your mileage may vary.

User avatar
d4rkheart
Posts: 32
Joined: Fri May 27, 2011 9:34 am

Re: Polygon and diagonal

Postby d4rkheart » Sun May 29, 2011 2:45 am

@llog, i'm sorry for your system, my system too was crashed ;(
thanks for your instructions and your work-around, thanks thanks and thanks!!!!
Thanks to Brynn and Xav too!!!


Return to “Help with using Inkscape”