Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Some unexpected behavior drawing ofPath

$
0
0

@Gallo wrote:

Hello,

I am facing some weird problem drawing ofPath from SVG file or maybe it is normal or i am doing something wrong...

I am loading an SVG file and get shapes from it as ofPath.
The goal is to be able to grab control points with the mouse in order to modify the shapes.

For now, i just can get the shapes and draw their control points. Also i am able to grab the control points and move them using the mouse. (i don't update the shapes accordingly for now)

My problems are i have 2 more control points than i expected.

1) One is the same as the first control point. I think it is the way ofPath closes the shape ? but can i get rid of this control point and merge the first and the last point ? eg. for a square i have 5 control points but i would like to have only 4

2) I have another control point that ends each shape which is located at position (0, 0) ? where does it come from ? is it normal ?

In fact for a square for example, i end up with 6 control points : one for each right angle, one more at the same position as the first and a last one in position (0, 0)

the code is available here : https://github.com/martialgallorini/Playground/tree/master/testSVGPolyline

Note : I let the binary (for OSX) in /bin directory for you to test it. Press TAB to show control points

Thanks a lot

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929