Author Topic: Why aren't the objects snapping to the line?  (Read 915 times)

June 23, 2019, 05:47:55 PM
Read 915 times

Bad Hair Day

  • Jr. Member

  • Offline
  • ***

  • 38
  • Gender
    Male

    Male

12121212.png
*12121212.png
(234.45 kB . 1366x768)
(viewed 278 times)


In the two pictures attached, there is one that is faraway showing the grid of hexes that I made.  I got to the point where I would Clone the "snowflake" looking bunch of hexes that is above the Page, and then paste it right up against the same snowflake pattern (I made sure they interlock without overlap).  I did this a few times.  But when I zoom in, you can see in the other picture that the hexes are not exactly lined up on the blue grid lines.  And in a couple places, there is a 1mm or 2mm gap where the whole object I was dropping there didn't snap to the gridlines. 

You can see in the screenshots I have "snap to grid" selected (correctly, I think). 

Is there a way to select everything on the canvas and then tell all the hexes to Snap To The Grid on their own? 

Thanks,

BHD
  • 1.0 Alpha
  • Win10

June 23, 2019, 07:36:56 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
a way to select everything on the canvas and then tell all the hexes to Snap To The Grid on their own?

Oh my gosh, wouldn't that be an awesome feature?!!  I might  have to make an official request for that.  But it doesn't exist now.

Since you're using hexagons, I would just snap one hexagon to the grid.  Then hide the grid, and from there on, snap to the existing hexagon.  And snap the next to those.  If you keep the grid always visible, you'll need to be zoomed in enough to make sure that it snaps properly.  Or else pay attention to the notification, that it always says "node to grid intersection".

Also, I don't know if this has been fixed.  But there's always a rectangular grid in a file.  And in Document Properties > Grids, if you only hide the grid, things will still be trying to snap to it.  So you have to completely disable the rectangular grid, to prevent things from trying to snap to it.  I know, it seems crazy to me that anyone would want to snap to something they can't see, but Inkscape at least used to work like that, and it might still.  So be sure that the rectangular grid is disabled completely.

Inkscape also will try to snap to things in a hidden layer, so sometimes the only way to control snapping is to be zoomed in and watch the notification, to make sure it happens like you want.

I see that you're using a smaller computer screen.  There are some more snap settings that you can't see.  At the bottom of your snap control bar (far right edge of the window) see the tiny triangle?  Click on that, and it shows all the rest of the buttons, except they are in a menu format.  Click and click again to toggle, and you can see the checkmark indicating that each option is enabled or not.

For this project, I would set the snap control bar like this attached (where you can see the rest of the buttons, that aren't showing on your screen).

snap-basic.png
*snap-basic.png
(5.32 kB . 30x583)
(viewed 254 times)


And for Document Properties, I would switch Snap to Guides and for Snap to Objects, to Closer than 20 or 30 px.  That means that you need to drag a new hexagon closer than 20 or 30 px, before it tries to snap.  For Always Snap, Inkscape will try to snap it from anywhere.  So if everything is set for always snap, it's a little like chaos, trying to control it.

There's another little trick that I use to help control snapping.  Inkscape Preferences > Behavior > Snapping > Only snap the node closest to the pointer.  And put the slider around 0.8.

With that, you always grab the object near to the node that you want to snap.  That helps to prevent everything trying to snap to everything.

Keep on practicing - you'll get there!
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 23, 2019, 10:44:03 PM
Reply #2

Bad Hair Day

  • Jr. Member

  • Offline
  • ***

  • 38
  • Gender
    Male

    Male
Oh, wow.  So it won't snap to the grid!?!  So there is no point in me using the grid.  And I did see some weird behaviors, but I think you've given me enough to figure it out so I can just have no underlying grid and have one bunch of hexes snap to another bunch.  And if things are still weird, then I will (try to) remove the invisible underlying rectangular grid. 

I will do that until I reach an obstacle, success or bedtime. 

I also need to spend some time to figure out how to put color inside of a hex without using the paintbucket.  The main reason I used that (other than that's how I do it in MS Word and other mapmaking programs) is I can set it up and then drop the paint in the hex with just one click.  I am going to be spending a LOT of time putting color into hexes here, there and all over the map (the colors represent the details I am trying to keep track of.).  Someday, I will figure out how to do different "Layers" so that the same map can have different sets of colors...   

I might also go do another tutorial if one addresses the specifics of what I'm trying to do right here and right now. 

Thanks Brynn, and to any/all who read it.

BHD
  • 1.0 Alpha
  • Win10

June 24, 2019, 12:55:06 AM
Reply #3

Bad Hair Day

  • Jr. Member

  • Offline
  • ***

  • 38
  • Gender
    Male

    Male
"Edit" "Preferences" "Behavior" leads me to a window where it just says "Simplification Threshold" and it's set at 0.0020 and I can change it by .0001 with  +/- buttons.    I understand "only snap closest to pointer" but I don't see that option.  I'll look around.  I'm using Version 1.0 Alpha now.  Although the main reason I switched to that was so I could rotate the canvas and get the hex grid to have hexes with a flat bottom.  Since I can't get my drawn hexes to snap to that grid, I don't see a reason to stay with 1.0 Alpha. 

Is it generally easier for people to give me tips using the latest release 0.93? 
  • 1.0 Alpha
  • Win10

June 24, 2019, 01:03:11 AM
Reply #4

Bad Hair Day

  • Jr. Member

  • Offline
  • ***

  • 38
  • Gender
    Male

    Male
Idiot that I am, I didn't look to the left and see that a whole nother menu dropped down under "Behaviors."  I'm on it...

Sheepishly,

BHD
  • 1.0 Alpha
  • Win10

June 24, 2019, 01:32:36 AM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Oh, wow.  So it won't snap to the grid!?!

Mmm, no I didn't mean to say that.  Yes, you can definitely snap to the grid.  I'm just suggesting that if you have the grid turned on, Inkscape will try to snap to it, as well as to any other targets.  So if you reduce the number of snapping targets available, you reduce the chance for snapping to the wrong thing.

So snap the first hexagon to the grid.  Then hide the grid while you work further.  After than, just snap to the existing hexagons.  At some point, you could turn it back on, if you need it, or you want to double-check.

Or, here's another option.  Maybe you would like this better?  Disable snapping of nodes, and only have grid snapping enabled, with no other snapping.  Then it will only snap to the grid.

Here's another screenshot, although I've made my theme color darker, and it might be hard to see the buttons.  But this is how to set up the snap control bar, so that you snap only to the grid.  You can see that only the Snap to Grid option is enabled.

[Edit - wrong screenshot, see my next message for the correct one]

snap-grid.png
*snap-grid.png
(5.29 kB . 34x590)
(viewed 251 times)


You can fill the hexagons with one click, using the traditional fill color.  It's better than using the Paint Bucket tool.  You'll see!
« Last Edit: June 25, 2019, 03:35:53 PM by brynn »
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 24, 2019, 02:48:03 PM
Reply #6

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
I personally hate snapping.  So my approach would be to strategically group the hexes together then use the alignment tool (which takes a little bit of getting used to). You could use in addition to snapping.  Then again, I always seem to approach things from a different perspective than everyone else around here, lol.

June 24, 2019, 03:33:47 PM
Reply #7

Bad Hair Day

  • Jr. Member

  • Offline
  • ***

  • 38
  • Gender
    Male

    Male
I took a screen shot.  I think I have things set up the way Brynn told me to three posts above this one.  I want the hexes to snap to the grid and only to the grid.  I seem to have that selected, but as you can see, I move the hex on the left and it doesn't snap to the grid.  All six of its points are distinctly OFF the grid.  And when  created the hex on the right, I had to create it aligned to the grid.  I don't think it snapped to it when  created it, either. 

  • 1.0 Alpha
  • Win10

June 24, 2019, 05:10:52 PM
Reply #8

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Is it possible for you to give us an svg (you can duplicate your file and remove everything except for the grid and 2 hexes...)?  I think it'd help those trying to figure out the issue.

June 24, 2019, 05:48:54 PM
Reply #9

Bad Hair Day

  • Jr. Member

  • Offline
  • ***

  • 38
  • Gender
    Male

    Male
remove everything except for the grid and 2 hexes...)? 

Ok, so instead of posting a picture you want me to post the actual file I am working in. I get that.  I don't understand what you mean when you say "remove everything"...  So you want to see the grid and 2 hexes, right, I get that.  What is "everything" you want me to remove? 

I'm very happy to make it easier for those who want to give me help.  I just want to do it the right way...

Sorry for being such a newb.  I'm a high school teacher and I promise I am "paying it forward":  the kindnesses you extend to me I give forward into my classrooms / students. 

BHD
  • 1.0 Alpha
  • Win10

June 25, 2019, 02:05:57 PM
Reply #10

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Oh, I was just saying to remove all but what needs to be looked at because not sure what else you might have on that file; makes it easier to focus, as well as prevents something you've spent a lot of time on from being taken by someone else... (ie you're posting public so anyone who wants a copy can get it, I have no idea what you might have on other layers or outside what we're seeing).
When we get your file, we can better see why snapping isn't working.
We're all here to help.  I'm not nearly as advanced as the others here, and I'm still learning a lot myself - and I'm so grateful, so that's why I at least try to help if able, or ask for what's needed so others can 'really' help them, lol.  and don't worry about newbie questions, you won't believe some of the stuff I ask - still!   :lol:
Kudos on being a teacher - so now I understand your user name, ha ha! 

June 25, 2019, 03:27:25 PM
Reply #11

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Oh, I apologize.  I totally attached the wrong screenshot!  I am so sorry!

Here's the right one:

snap-grid.png
*snap-grid.png
(5.62 kB . 34x587)
(viewed 230 times)


Note that nodes or corners will still snap together, so you need to watch the notification, to make sure it says something like "node or handle (or might say "corner") to grid".  Although if you set up the grid to be the same size as your hexagons, it shouldn't matter.

(Personally, I don't think I need to see the SVG file, for this problem.)

Edit
However, I notice you had attached the file in a different topic.  In that file, the Snap to Grid option is not enabled.  As I tried to explain somewhere else, it looks like you're using inkscape on a smaller screen.  So all the buttons don't show up. 

Instead, you have to click the tiny triangle ("arrow" I guess) at the bottom of the control bar, and that opens a menu with all the other buttons.  Make sure you see a checkmark beside "Snap to Grid" in that grid.  If it doesn't have a checkmark, just click on it, and you'll see the checkmark.

I think I'll make a quick video to show correct snapping, so you know what to expect.  Maybe I'll even make my Inkscape window small, so I can show you the menu....  Hold on a few minutes, and I'll post it.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 25, 2019, 04:41:48 PM
Reply #12

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Ok, a few things.  I notice your hexagons aren't 1 cm.  They are 0.997 cm.  I showed that in the video, so you can see how I found that.  Even that tiny discrepancy can have an effect.

You know, that puts me in mind of another little option which will probably help you.  Go to Inkscape Preferences > Tools, and click Geometric Bounding Box.  This will make sure that Inkscape ignores the stroke width.  The bounding box will not include the stroke width and is enclosing what I think of as the raw object.   Also Inkscape will give the dimensions of the raw object, without counting any stroke width in the measurement.

To quickly draw one the right size, you can use snapping set up just like the correct screenshot above.  Then using the Pen tool, you can click near a grid line intersection, and Inkscape will start the path precisely there.  Then click once at each corner as you go around.  When you come back to the beginning, be sure to click inside that tiny box.  It will turn red when your mouse is in the right place.  Then just click once.  And that should be the right size of hexagon.  (Rats, I didn't think of it before I finished the video, or I would show it.  I still could make another though, if you like.)

Your file didn't have any grid in it, so I showed how to set it up, just in case you might find it helpful.

In the video I made my window smaller, so that the snap control bar looks just like yours.  When I first opened your file, the Snap to Grid option was not enabled (no checkmark), so I showed how to use that little menu, and how you can toggle the option off and on.

Note that when I click the mouse, the video flashes a tiny blue circle around the mouse. 

Ok, here's the video

  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 25, 2019, 05:10:02 PM
Reply #13

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
I just posted in the other thread.  The size thing makes a big difference.