gotcha

Author Topic: Polygones - no vertices available, no way to modify them  (Read 496 times)

March 09, 2019, 01:02:06 PM
Read 496 times

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
Hello, I noticed that Inkscape is not supporting polygones modyfication on vertices level. I must say that this make some of current project i am working on totally hard to finish.
I am working on simple technical graphics which must be animated by scripts. Coworker is making first version of graphics in Adobe Illustrator and then port them to me as SVG.
For further modification I need to change polygones to paths because polygones are unmodifyable objects (only scaling is accessible) where in AI these objects are freely modifyable on vertices level.
Polygones are as standard objects as paths in SVG specification so I don't quite understand why it works like this.
The main differences are the way they are represented in source code - polygones by simple coordinates Xx:Yy for which I have scripts to animate them, paths by some wierd of notation like M P and other letters with numbers for which I don't have idea how to rewrite scripts for.
Are there any plans to add such feature into Inkscape?
  • 0.92.3
  • Win7x64

March 09, 2019, 02:43:29 PM
Reply #1

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Hi.

Not sure what you are about to draw, what's the task in the project. As a general note, ask by the problem and not by asking directly how to achieve a *very* specific method.

Polygons offer the setting of variance and can be switched to stars, change the number of spikes, change the spoke ratio, roundness etc.
It is a parametric object as per se.

Paths are the basic elements in inkscape. They consists of segments connecting nodes.
The m, p, and the numbers indicate the node's coordinates and also the handles coordinates one after another, in the path's direction. In addition the path can have amongst the style attributes a sequence defining each nodes types -smooth or cusp, like csscccccscsssss etc.

The polygon tool draws a parametric object which needs to be converted to a path so then its nodes can be placed around.
Like, as you wrote, polygons don't have any indication of their "nodes" positions, since they are generated "on the fly".

All in all, illustrator probably describes the node editing relative to the parametric object. Cannot tell since I don't have illustrator, but I have serious doubts if you could simply change the side of the polygon after you modified one of the node's position.



Which, then all comes down you need a solution to your problem. The suggested development part would hardly happen since there is no real description of the desired feature to be implemented. Even if there was, you'd need to add it to the new bug tracker's as a feature request somewhere on github. Then it'd take quite some time even if it got attention to be worked on.


Soo, my guessing is you are trying to draw somekind of gear/cogs?
Probably a pattern along path effect could solve any problems yet, even better there is an extension somewhere to render gears with an evolvent tooth profile based on given parametres.

March 09, 2019, 03:44:51 PM
Reply #2

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
No, these are not cogs/gears. These are 4 sided plates formed under specific angle (well, from viewer perspective) which have to rotate under this angle. Something like sprocket.
I don't know how AI maintance it, but in AI there is vertice mode for such plates, and in the end SVG contains polygon definition, not path.
Scripts are ready waiting only for customization and ... polygones.
I don't quite understand what is hard in modify polygon parameters on fly, but let's say that vertice mode is only reserved for paths. Polygon can't have curves, but there is addon to inkscape which changes curves to straight lines (built in inkscape). So what is the problem to add feature to change such path into polygon definition?
I have found something like this:
https://betravis.github.io/shape-tools/path-to-polygon/

The only problem is - will this page work forever? Will I really need to modify text svg file in some notepad to achieve such thing?
This page literally removes all these prefix letters M L and whatever notification contains.
I have also found some js code for better flattener but it doesn't work, maybe firefox fault, and the code is not prepared to be standalone flattener.

I don't need cog/gear generator nor make polygon stars. I just need to make a corrections into some polygons and send them back as polygons. And Inkscape can't execute such simple task.
  • 0.92.3
  • Win7x64

March 09, 2019, 04:02:40 PM
Reply #3

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
The * offers some options you may try first
polyg.gif
*polyg.gif
(901.99 kB . 600x600)
(viewed 88 times)


Probably I'd still use the pattern along path effect to stretch a tooth profile in a polar array.
If you could share an example we could try replicating the desired result.

March 10, 2019, 05:41:38 AM
Reply #4

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
Really great tool, but not the one i really need. I simply need a tool which make <polygon /> in SVG from <path />. Ignoring any curves, there is addon to replace curves with lines.
I really don't care no vertex on polygon in Inkscape because
1) polygon to path
2) modify path
3) path to polygon
Attribute points=" " differs from attribute d=" ".
I don't see any feature in Inkscape to execute step 3.
Till now i thought that both things are the same so there is no problem polygon or path. But it is opposite.

  • 0.92.3
  • Win7x64

March 10, 2019, 07:31:06 AM
Reply #5

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Inkscape doesn't do that. It uses Bézier curves as much as possible. You could write an extension to convert something to a polygon, though.

March 11, 2019, 09:29:08 AM
Reply #6

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
DIY ... ah, expected such response.
What else can be written here ...
  • 0.92.3
  • Win7x64

March 11, 2019, 01:46:55 PM
Reply #7

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Please try the pattern along path effect. It worths it.

Can repeat a tooth and edit it live.

March 13, 2019, 12:50:58 AM
Reply #8

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
I need polygon in svg definition, Inkscape doesn't offer such thing.
  • 0.92.3
  • Win7x64