[solved] duplicate path and align leaves gap ??

Post questions on how to use or achieve an effect in Inkscape.
abrogaticus
Posts: 6
Joined: Tue Jan 01, 2008 11:05 am

[solved] duplicate path and align leaves gap ??

Postby abrogaticus » Tue Jan 01, 2008 11:50 am

Hi all..

I was trying to create an hourglass icon and decided in order to get it perfectly symmetric I'd just create a quarter section of the hourglass.. duplicate and flip it horizontally.. and then duplicate that and flip it vertically. Unfortunately I ran into a snag...

These were my steps.
1. :tool_ellipse: Create a circle shape holding ctrl to constrain to a perfect circle.
2. :tool_rectangle: Use difference with a rectangle shape to half the circle vertically.
3. :tool_rectangle: Use difference with a rectangle shape to give the half circle a flat bottom.
4. :tool_node: Convert the remaining shape into a path, add some additional nodes on the top, and tweak it to give the top of the circle a neck.
5. :tool_selector: Duplicate the shape flip it horizontally and use the align tool to snap the inside edges together.

After I use the align tool (step 5) to move the paths together, I notice a tiny (1px wide?) gap running vertically down the length of the 2 halves. I also tried specifying the x coords (based on the widths of the paths) to make sure it wasn't an align tool bug and got the gap again. I also exported a .png to make sure it wasn't just an artifact in inkscape's display.

Sure, I guess I can fudge it by just offsetting one of the halves by 1 px. and it'd probably look fine, but that just feels like cheating.

Does anyone know if this is a bug or if I'm doing something wrong (aka a better/easier way to obtain my desired result).

Thanks!! (Sorry for the book)

-Abro

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: duplicate path and align leaves gap ??

Postby prkos » Wed Jan 02, 2008 3:06 am

Are you sure your node sculpting is perfectly symmetrical?

There shouldn't be any gaps when using the align tool. Can you attach the png here, maybe we can see what its about?

btw use grid with the snap on when working on something like this, its gonna make it so much easier ;)
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

abrogaticus
Posts: 6
Joined: Tue Jan 01, 2008 11:05 am

Re: duplicate path and align leaves gap ??

Postby abrogaticus » Wed Jan 02, 2008 2:47 pm

Are you sure your node sculpting is perfectly symmetrical?

Nope, I'm not sure. I'm still pretty noob. The whole point of me creating only 1 quarter of the hourglass was too ensure symmetry. :D
I didn't rotate the rectangles that I differenced the circle with.. so the right and bottom edges should be perfectly vertical and horizontal, right? I did move the upper right corner node but I held [ctrl] to constrain the move to the vertical axis. Based on that.. Ithink things should be lining up correctly (in theory). <shrug>

There shouldn't be any gaps when using the align tool. Can you attach the png here, maybe we can see what its about?

Here's the png. As a reminder, it's the bottom half of a basic hourglass shape. I modeled the left quarter, duplicated it, flipped the duplicate over horizontal and used the align tool. I put the black rect behind just to emphasize the gap. As far as I can tell, the gap is perfectly vertical, no stray nodes. <double shrug>

Image

btw use grid with the snap on when working on something like this, its gonna make it so much easier ;)

I didn't use grid +snap. I didn't think I really needed it, since most node work was just to adjust the upper left curve of the path. I think there were 2 sets of nodes that I wanted to line up just right (in the neck) and I used the align tool's node alignment thingy. Again, I'm a noob so maybe I didn't use that thing right? But again the png looks like there aren't any nodes straying into the gap. <triple shrug>

oh and...
Happy New Year!!!

-Abro

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

Re: duplicate path and align leaves gap ??

Postby brynn » Wed Jan 02, 2008 7:33 pm

Image Hi
I'm fairly new at this myself....or maybe I could be called a perpetual newbie, lol. So I'm probably reaching beyond my understanding, by making this reply. But I thought something like 'what the heck - I might learn something' Image

I've found out that gaps like that can occur where I piece something together with basic shapes, like you've done, and later remove the Stroke. Others can explain it better than me, and maybe you're already aware of it. But a Stroke technically falls half inside the actual edge of a shape, and half outside. So if you put 2 shapes together so that their Strokes touch each other, the actual edges of the shapes don't quite meet. So when you remove the Stroke, you end up with a tiny strip of the background color between them.

I've never used the Align tool though, I must confess, so I don't know exactly how it works. But I do agree with prkos about using the snapping features. They really come in handy when trying to align shapes. You can have the nodes, paths, objects or selection boxes snap to a grid, a guide or each other.
So anyway, for whatever my thoughts are worth Image
I hope you get it figured out :D

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: duplicate path and align leaves gap ??

Postby prkos » Wed Jan 02, 2008 11:01 pm

When you said the gap was 1px I thought there was some kind of an error but from what I see its the antialiasing issue (the gap is much smaller than 1px).

Currently Inkscape uses antialiasing on the object edges, it means that the edges are blurred just a bit to make them look more attractive and natural (when they stand alone). The downside is the example you stumbled upon: when you snap 2 objects together that small blurred edge area can become a problem. It doesn't mean that the objects didn't snap properly, it just in the way Inkscape (for now) handles edges.

Related: http://wiki.inkscape.org/wiki/index.php ... liasing.3F

This issue will be addressed in the future but for now we have to work with what we've got ;)

btw, your hourglass will probably be one object right? Select all 4 quarters and Union them into one path: Path > Union
no more gaps :)

Off topic:
brynn where did you find that smiley in front of your Hi? Its the cutest Ive seen in a while :D
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

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

Re: duplicate path and align leaves gap ??

Postby brynn » Thu Jan 03, 2008 2:02 pm

Prkos, the site I got it from a couple of years ago, Els Smilies Index, is now called Smiley Central, but is no longer Els' or safe to use. I couldn't say how it happened, but apparently now it is a purveyor of malware (some pretty serious stuff, from what I understand). I left out the exact URL because I don't want to feel responsible, should anyone reading this visit the site and get burned.

I'm not only very careful about internet security, I'm very careful about copyrights and licenses. And to my knowledge, the smiley you asked about was made by Els Topsis, who offered it free for personal, non-commercial use. As I said, I don't know how it happened that the site became an IE Restricted Site -- I can only guess that she sold her collection, or maybe got tired of the upkeep and gave it away? I have absolutely not the slightest idea. But since I acquired it "legally", I feel comfortable continuing to use it (along with all the smileys I got from her collection).

Sorry for the long explanation, but I wanted to give you enough to make your own decision about using it (which I assume you would want to do). I hope this info helps. All best :D

abrogaticus
Posts: 6
Joined: Tue Jan 01, 2008 11:05 am

Re: duplicate path and align leaves gap ??

Postby abrogaticus » Sat Jan 05, 2008 9:49 am

prkos wrote:Currently Inkscape uses antialiasing on the object edges, it means that the edges are blurred just a bit to make them look more attractive and natural (when they stand alone). The downside is the example you stumbled upon: when you snap 2 objects together that small blurred edge area can become a problem. It doesn't mean that the objects didn't snap properly, it just in the way Inkscape (for now) handles edges.

Related: http://wiki.inkscape.org/wiki/index.php ... liasing.3F

This issue will be addressed in the future but for now we have to work with what we've got ;)

btw, your hourglass will probably be one object right? Select all 4 quarters and Union them into one path: Path > Union
no more gaps :)

Off topic:
brynn where did you find that smiley in front of your Hi? Its the cutest Ive seen in a while :D


Thanks for the info. I was hoping there was a logical explanation and simple solution. Prkos to the rescue!! I read the bit about the antialiasing and I'm still a tiny bit confused. I thought I tried a simple test of using align on 2 simple rectangles and I didn't see any anti-aliasing blurring in that case. Maybe I was just mistaken. In any case, the union of the objects works perfectly.

Thanks again!

-Abro

Image

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: duplicate path and align leaves gap ??

Postby prkos » Sat Jan 05, 2008 10:01 am

I guess there are certain conditions you need to meet to work around antialiasing (probably whole pixel width, pixel snapping) so those edges don't need to appear every time.

Post the image on the forum when you finish :)
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download


Return to “Help with using Inkscape”