Drawing path

Post questions on how to use or achieve an effect in Inkscape.
katun89
Posts: 12
Joined: Sat Jan 08, 2011 12:57 pm

Drawing path

Postby katun89 » Sun Jan 09, 2011 12:54 pm

Hi guys,
I got a simple doubt.

When I draw a closed path (suppose something like a square) and then I draw another path which start from a point on the first path border and ends on a point on the first path border too, is the code generated anyhow like this?

<path id="first" d="1, 2, 3, 4">
<path id="second" d="5, 6, 2, 3">

Or does Inkscape create some kind of transformation?
Because I can't manipulate the fill attribute as I wish on these kind of paths :(

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Drawing path

Postby ~suv » Sun Jan 09, 2011 1:51 pm

katun89 wrote:Or does Inkscape create some kind of transformation?
Because I can't manipulate the fill attribute as I wish on these kind of paths

Could you provide a concrete example? Like
  1. how you create the objects (using the rectangle tool, or the pen (bézier) tool?)
  2. which fill properties - and how - you are trying to manipulate (using the GUI, or per JavaScript?)
Attaching a sample SVG file always helps ;)

katun89
Posts: 12
Joined: Sat Jan 08, 2011 12:57 pm

Re: Drawing path

Postby katun89 » Mon Jan 10, 2011 1:33 am

ok XD
I create objects using the pen (free drawing).
In this example I got 2 simple draws: if I try to fill the second path with black (simply changing "none" to "black" with a text editor, without javascript) I get a wrong filling, if you try on your own self you'll get what I mean.
What's am I doing wrong?
What do I need to do in orderd to get several contiguous paths which I can fill as I wish without disorders?

Thanks anyway! :)
Attachments
test.svg
here is the example of 2 contiguous paths
(13.24 KiB) Downloaded 214 times

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Drawing path

Postby ~suv » Mon Jan 10, 2011 2:02 am

katun89 wrote:if I try to fill the second path with black (simply changing "none" to "black" with a text editor, without javascript) I get a wrong filling
The second path in your drawing isn't closed, therefore if you make it filled, the unclosed egde is rendered as straight line (same effect you'd get if you would close the path using 'z' in the path data).

If you want the second path to have a common border with the first one, you have to use path operations (for example: draw the second one big enough overlapping the first one, then use a copy of the first one and subtract that copy from the second path (using menu 'Path > Difference')).

katun89
Posts: 12
Joined: Sat Jan 08, 2011 12:57 pm

Re: Drawing path

Postby katun89 » Mon Jan 10, 2011 2:49 am

thanks! I think I got it! :)
Hope u will help me once again in my next thread :)


Return to “Help with using Inkscape”