Snap Modes

 Snap mode is indicated by a blue box cursor that snaps to locations allowed by the snap mode.   Snapping jumps the mouse cursor directly to a desired location, like a point or the end of a line, when the mouse cursor moves near that location.  That makes it easy to exactly click a desired location just by moving the mouse cursor approximately nearby.  We can also use snap modes to constrain mouse cursor motion to specified grid locations or to bearings, such as moving in only horizontal or vertical motions.  

 

Snapping works when editing drawings, drawing paths (used in measurements and with editing commands), and also in other settings, such as placing control points for georegistration.   Commands to turn snapping on/off and to set snap modes become available when we mark control points, draw a path, launch an editing tool (like Create Lines), or when we enable an object for editing by Alt-clicking it and then clicking a segment or vertex.

 

Snapping is off when we first launch a new Manifold session, and then stays off or on depending on how we last toggled it in that Manifold session.    Snapping is shared between different contexts where snapping works, so when making measurements or while editing we have last turned snapping off, or we have changed the snapping mode, it will stay off or stay in the new mode until we turn snapping back on or change to a different mode.

 

In any setting where snapping is available, the spacebar is a keyboard shortcut that toggles snapping on and off.   We also can toggle snapping on and off by right-clicking into the drawing and clicking Snap in the context menu.  

 

The right-click context menu also allows us to switch snap modes and to set snap parameters used by those modes.  Keyboard shortcuts allow fast switching between modes while editing:

 

 

Basic snap settings appear in the basic context menu shown above as well as in extended context menus that appear when editing.

 

  Snap

Turn snapping off and on.  Keyboard shortcut:  spacebar    See the discussion in the Snap Modes topic.

Snap to Coordinates

Snap to coordinates (vertices) in objects.  Keyboard shortcut: C key

Snap to Grid

Snap to virtual grid locations specified in the Grid dialog.  Launch the Grid dialog by double clicking the Grid virtual layer in the Layers pane.  Keyboard shortcut: G key

Snap to Bearing

Snap to bearing lines specified in Snap Parameters, orthogonal vertical / horizontal directions by default.  Keyboard shortcut: B key

Snap to Relative Bearing

Like Snap to Bearing, but aligns the pattern of allowed bearings to the bearing of the last entered segment.  If the last segment was a line segment at a 45 degree angle and Snap Parameters are the default 4 bearings, this will constrain cursor motion to lines that are either a continuation of that 45 degree line or at right angles to it.   Keyboard shortcut: R key

Snap to Active Layer Only

Toggle between snapping to objects in the Active layer only, or snapping to objects in all visible layers that have snapping enabled in the Layers pane.  Relevant to Snap to Coordinates mode only, since snapping to grid or to bearings does not depend on the contents of layers.  Keyboard shortcut: A key

Snap Parameters

Launch the Snap Parameters dialog.

 

By default, snapping works only with objects in the active layer.  If we uncheck the Snap to Active Layer Only choice, then snapping will work for all visible layers which have snapping enabled in the Layers pane. By default, all layers in a map will have snapping enabled.   

Snap Parameters

Launch the Snap Parameters dialog from the cursor mode menu, by launching View - Mode - Snap Parameters from the main menu, or by choosing Snap Parameters from context menus used in editing.

 

 

The Snap Parameters dialog sets values used by Snap to Grid and Snap to Bearing modes.

 

 

Bearing divisions

Bearing directions that will constrain mouse cursor motion in Snap to Bearing mode.  The default value of 4 bearing divisions means to constrain mouse motion to four directions: 0, 90, 180, and 270 degrees.  This is classic "ortho" mode in CAD systems, constraining mouse motion to only vertical and horizontal directions.  To constrain to ortho directions and also to 45 degree directions, change the value to 8.   That will constrain motion to eight directions:  0, 45, 90, 135, 180, 225, 270, and 315 degrees.

OK

Apply changes and close the dialog.

Cancel

Discard changes and close the dialog.

 

In current builds, changing snap parameters applies only to the current Manifold session.   Close the project and re-open it again and snap parameters will again be set to default values.  Future builds likely will save snap parameters to component properties, so any parameters changed will apply to the active component and will persist (if the project is saved) into the next Manifold session with that project.

Snapping while Editing

Snapping works while we edit an object.   Keyboard shortcuts for different snap modes, including using the spacebar, work during dragging, so while creating new objects or editing existing objects we can switch between no snapping or snaps to coordinates, bearings, etc., in the middle of editing motions. 

 

When editing an object, snapping to coordinates snaps to the preview of the object as it has been edited so far, and not to the old version.  If we have moved some vertices to new locations, snapping will snap to those new locations.    When editing an object, snapping uses a smaller snap distance, approximately one-third less than the snap distance to unedited objects.  Snapping to edited coordinates is disabled if the object being edited is a point, which helps avoid creating empty segments and walkbacks.

The Layers Pane and Snapping

By default, Snap to Coordinates mode operates using only objects in the active layer,   If we uncheck the Snap to Active Layer Only setting, then when a map window has more than one layer, Snap to Coordinates mode will snap to coordinates in all objects in all visible layers that have been set to allow snapping in the Layers pane.   We can use the Layers pane to specify which layers allow their objects to participate in snapping and which do not.   We also use the Layers pane to configure the Grid that is used in Snap to Grid mode.

 

By default, the Layers pane shows Opacity controls, showing the opacity in %.

 

 

 Press the Filter / Configure button to configure the control column to display Opacity, Pick Mode, Snap Mode, Min / Max Scale, or Render Scale.

 

 

Choosing Show Snap Mode will switch the control column to showing the snap mode status of each layer.  A snap mode of snap means that objects in that layer will participate guiding snapping in Snap to Coordinates mode when we uncheck the Snap to Active Layer Only setting,

 

Double-click a snap mode cell to change snap mode for that layer.

 

 

Choose no snap to change the snap mode of a layer to not allowing objects in that layer to guide snapping in Snap to Coordinates mode. 

 

 

A no snap  mode is indicated with a blank snap mode cell.   In the Layers pane shown above, objects in the buildings, roads, and railways layers will guide snapping in Snap to Coordinates mode when we uncheck the Snap to Active Layer Only setting, but objects in the places layer will not.

 

While editing or in other contexts where snapping applies, a quick way to toggle the Snap to Active Layer Only setting is to press the A key on the keyboard.   If we cannot remember that setting, a quick right-click will pop open the context menu to show us the setting.  A right-click is always safe, in that it will not change anything about our workflow unless we deliberately choose to change a setting in the context menu.

 

Tech tip:  In maps that have many layers, we often would like to quickly turn off snapping for all but a few layers, so only those layers will guide snapping.  As discussed in the Layers pane topic, a quick way of doing that in the Layers pane is to select the layers we want to guide snapping, press Ctrl-I to invert the selection, Double-click into the snap cell of any of the selected layers, change that cell to no snap, and the snap mode cells for all of the other selected layers will also change to no snap.

Snap to Coordinates

In Snap to Coordinates mode, the mouse cursor snaps to coordinates (also known as vertices) that define objects.    Points are defined by one coordinate, so Snap to Coordinates will snap to points.   Lines are defined by the coordinates at the start and end of the line's segments, and areas are defined by the coordinates at the start and end of the segments that make up the area's boundaries.    

 

 

In the illustrations above, we see a point and an area.   Alt-clicking on the area picks it for editing and shows as small blue boxes / edit handles the locations of the coordinates that define the area.  Snap to Coordinates mode will cause the mouse cursor to snap either to the point or to any of the coordinates in the area.

Example: Create an Area

We will draw a new area that is exactly adjacent to the area object.  

 

 To create an area, we choose the Create Area tool, as shown in the Editing Drawings topic.  

 

 

We take a moment to right-click into the drawing, to call up the context menu.  We confirm that Snap is on and that Snap to Coordinates mode applies.  If we want to draw the new area in a new layer but still snap to objects in other layers, we can uncheck the Snap to Active Layer Only setting.

 

 

With snapping on, the mouse cursor immediately snaps to the point when we bring the cursor near to the point.  We click to start the area.

 

 

As we bring the mouse cursor near to any of the coordinates that define the area, the cursor will snap exactly onto the coordinate.

 

 

Note that we can snap to any of the coordinates, even those on the other side of the object.   

 

 

To draw the area we quickly click in turn on the three coordinates of the area object that are on the side of the point.   When done, we right-click and choose Save Changes.

 

 

A new area appears.  We have used a Style Override to color the new area differently.

Snap to Grid

Choosing Snap to Grid mode will snap the cursor to the intersections of the Grid that is specified in the Grid dialog.   We begin by specifying the desired grid.  We will work with map that has two layers, a Walls layer that shows bearing walls, and a Drawing layer in which we will draw the desired area.

 

 

With the focus on the map window, in the Layers pane we turn on the Grid virtual layer, and then we double-click the Grid layer to launch the Grid dialog.

 

 

In the Grid dialog, we choose the point style of showing grid intersections.   We increase the Stroke and Point size parameters slightly.    We choose a foreground color that is a medium gray.

 

For the Unit we choose centimeters, and for the Step we choose 20 for both horizontal and vertical steps.  We uncheck the Increase step on zoom out box, so the grid will not change size when we zoom out or in.

 

Press OK.   The grid will now appear as seen in the illustrations below.

 

 To create an area using snapping to grid locations, we choose the Create Area tool. 

 

 

Next, we  right-click into the drawing, we confirm that Snap is on and we choose Snap to Grid mode.   Snapping will be to the grid intersections using the Step for the size of the grid that we specified in the Grid dialog, that is, every 20 centimeters in horizontal and vertical directions.

 

 

We can see from the point in the Drawing layer and the area in the Walls layer that those objects must have been created using Snap to Grid, since their coordinates are located exactly on grid points.  

 

When we bring the mouse cursor near the point, it snaps directly onto the grid location.  It seems that the cursor snaps to the point, but it is simply snapping to the grid location at which the point happens to be located.  We click to start the area.

 

 

 

As we bring the mouse cursor near to any of the grid locations,  the cursor will snap exactly onto the grid location.    It may seem sometimes that the cursor is snapping to the coordinates of the area, but it is only snapping to grid locations.

 

 

We can see that is the case by snapping to any grid location, whether or not the area has a coordinate at that grid location.

 

 

To draw the area we quickly click in turn on three grid locations.   The first two happen to be on segments of the area object, while the third happens to be at the same location as a vertex of the area object.  When done, we right-click and choose Save Changes.

 

 

 

A new area appears, as seen in the illustration at above, left.   The illustration at above, right shows how we can create a different area by clicking using Snap to Grid.   In the example at right, we have Alt-clicked the new area to pick it for editing, thus showing edit handles at the locations that we clicked to create the new area.    We clicked on two grid locations where there are no objects, and for the other vertices of the new area we clicked on grid locations where there was either the point object or a vertex for the area object.

 

When enabled, Snap to Grid will continue snapping to grid intersections as set up in the Grid dialog whether the grid is turned on or off in the Layers pane.   When first working with Snap to Grid, it may help to turn the grid on in the Layers pane, to make it visually clear where grid intersections are at the current zoom level, and that the cursor is snapping to grid intersections.

Snap to Bearing

Choose Snap to Bearing to constrain snap cursor motion to desired bearing directions, as set in the Bearing divisions parameter in the Snap Parameters dialog.

 

 To create an area using snapping to grid locations, we choose the Create Area tool. 

 

 

We right-click into the drawing, we confirm that Snap is on and we choose Snap to Bearing mode.   We also choose Snap Parameters, and then in the Snap Parameters dialog we confirm the value for Bearing divisions is the default value of 4.  

 

That will result in constraining snap cursor motion to only horizontal or vertical directions from the last-clicked vertex.   We press OK.  

 

 

We click on the point, and then as we move the mouse cursor for the next click to create an area, as long as we are closer to the horizontal level of the point as we move the mouse cursor left and right, the snap cursor stays on the horizontal line.  

 

Keyboard shortcuts:  The description above is shortened.  To click exactly on the point, we first pressed the C key on the keyboard to switch to Snap to Coordinates mode, to enable a snap exactly onto the point.  After we clicked the point we pressed the B key on the keyboard to switch back to Snap to Bearing mode, so the snap cursor moves only in horizontal or vertical displacement from the last-clicked vertex.  Switching between snap modes while editing by using C, G and B keyboard shortcuts, as well as toggling use of all layers with A, or turning snapping off and on with the spacebar, is a key skill we should learn.

 

 

In Snap to Bearing mode, as we move the mouse cursor left and right the line grows in exactly a horizontal direction from the first vertex we clicked.

 

 

If we move the mouse cursor up and down closer to vertical motion than horizontal motion,  the line grows in exactly a vertical direction from the first vertex we clicked.

 

 

To draw the area we move the mouse cursor as far as we would like the area to grow horizontally, and we click.  Next, we move the mouse cursor vertically as far as we would like the area to grow and we click again.  Finally, we move the mouse cursor horizontally until the closing segment of the area seems to be exactly vertical, and we click to mark the last vertex.

 

We right-click and choose Save Changes.

 

 

A new, rectangular area appears.  If we wanted the last segment to be guaranteed to be perfectly vertical, we could adjust the X coordinate of the last vertex clicked to be the same as that of the first vertex (the point).  That is easy to do in the Coordinates tab of the Info pane by simply copying the X coordinate of the first vertex and pasting it into the X coordinate cell of the last vertex clicked.

Snap to Relative Bearing

Like Snap to Bearing, but aligns the pattern of allowed bearings to the bearing of the last entered segment.  If the last segment was a line segment at a 45 degree angle and Snap Parameters are the default 4 bearings, this will constrain cursor motion to lines that are either a continuation of that 45 degree line or at right angles to it.   Keyboard shortcut: R key

 

 We will add a line using the Create Line tool, to show how Snap to Relative Bearing works.

 

 

 

We set Snap to Coordinates mode, so we can click exactly on the point to start the line.   We click again on the corner of the area object.   We then right-click to call up the context menu.  

 

 

We choose Snap to Relative Bearing mode.   Instead of right-clicking to call up the context menu, we could have pressed the keyboard shortcut, R, to switch directly to Snap to Relative Bearing mode.

 

 

Our Snap Parameters still use 4 as the number of Bearing divisions, as in the previous example.  That means that as we move the mouse cursor about, the line that is drawn will be constrained to either the same bearing as the previous segment, as shown in the illustration at left above, or to a right angle to the previous segment, as shown in the illustration at right above.

 

We draw a segment at right angles to the previous segment, and click to mark a vertex.

 

 

Once again, for the next segment the cursor creation motion is constrained to either the same bearing as the previous segment or to a right angle from the previous segment.    We draw another right angle segment and click once more.    We then draw another right angle segment and click one more time.

 

 

We then right-click and choose Save Changes, to create the new line.   We have styled lines in the layer so lines appear with an arrowhead at their end.

45 Degree Snapping

Using four bearing divisions constrains motion to four bearing directions: 0, 90, 180, and 270 degrees.  The result is classic "ortho" mode in CAD editing, where the mouse moves only horizontally or vertically from the last-clicked vertex.    We can increase the number of bearing divisions to add other angular displacements.

 

 

For example, in the Snap Parameters dialog we can specify a value of 8 for the number of Bearing divisions.   That will divide the 360 degree circle of possible motions into eight bearing divisions, adding four directions at 45 degree bearings in between the four directions at 90 degree bearings.

 

 We will now add lines using the Create Line tool, showing how eight bearing divisions work:

 

 

We click on the point to start the line.  As we move the mouse cursor for the next click to create a line, as long as we are closer to the horizontal level of the point than to the vertical or the 45 degree angle bearing,  the snap cursor stays on the horizontal line as we move the mouse cursor left and right.   

 

We click to mark the end of the line.  We right-click and choose Save Changes, and a line is created.   We have styled lines in the layer so lines appear with an arrowhead at their end.

 

Keyboard shortcuts:  As before, the description above is shortened.  To click exactly on the point, we first pressed the C key on the keyboard to switch to Snap to Coordinates mode, to enable a snap exactly onto the point.  After we clicked the point we pressed the B key on the keyboard to switch back to Snap to Bearing mode, so the snap cursor moves only in horizontal or vertical displacement from the last-clicked vertex.  

 

 

We click on the point again to start another line, and then in Snap to Bearing mode we move the mouse cursor close to the 45 degree bearing line from the point.   The snap cursor moves exactly on the 45 degree bearing line.   We click where we would like the line to end.   We right-click and choose Save Changes, and a second line is created, at a 45 degree bearing angle from the point.

 

 

Once more, we click on the point again to start another line, and then in Snap to Bearing mode we move the mouse cursor close to the vertical bearing line from the point.   The snap cursor moves exactly vertically up and down above the point.   We click where we would like the line to end.  We right-click and choose Save Changes, and a third line is created, in an exactly vertical bearing from the point.

 

 

We can create lines in all the bearing directions to show the effect of choosing a value of 4 or 8 for Bearing divisions in the Snap Parameters dialog.  Four bearing divisions, as seen at left above, constrain snap cursor motion to only horizontal or vertical directions.  Eight bearing divisions constrain snap cursor motion to horizontal, vertical, and forty five degree bearing directions.

Example:  Move an Entire Object using Snap

Snap modes apply in all editing moves.   For example, we can use snapping to quickly move an entire object into alignment with another object, even another object in a different layer.  In this example we move an object in an upper layer, snapping during the move to align the object to a different object in a lower layer.   

 

The example shows Manifold used in a CAD application, to draw floor plans of a building.  Our example map shows the outlines of masonry walls on the first floor and the second floor of a building, using area objects for the walls.  We would like the walls on the second floor of the building to align with walls on the first floor of the building, so the weight of the walls above is supported by walls below.

 

 

The illustration at left above shows a map with two layers, zoomed into a detailed view of a small part of the map.  The two layers show the positions of walls in the first floor and the second floor of a building.  The lower layer shows the outline of a wall in a darker hatch pattern.  The upper layer shows the outline of a wall in lighter hatch pattern.  For clarity, the illustration at right shows the lower wall, with the upper layer turned off.   The upper wall is slightly offset from the lower wall.

 

 

 

We would like to move the entire wall object in the upper layer down so that it exactly aligns to the wall object in the layer below.  We will use snapping while moving the upper layer's object, to align it exactly to the lower wall in the layer below.

 

 

Begin by Shift-Alt-clicking the lighter object.  That picks it for editing regardless of which layer it is in, and it makes the object's layer the active layer.

 

Next, click on the vertex we will use to align the two objects.

 

 

 

That enlarges the vertex into a large edit handle and switches editing into Move Coordinates mode.   We right-click into the drawing to call up the context menu, to check settings.   We make sure Snap is on.  We set snap mode is Snap to Coordinates, and we set Snap to Active Layer Only off.    We could do all that with keyboard shortcuts instead of repeatedly right-clicking and choosing items in the context menu.

 

To close the context menu, press the Esc key or simply click again on the bigger edit handle.

 

 

Shift-drag the large edit handle to move the edit handle and all the rest of the object as well.   We Shift-drag the large edit handle downwards, and as the mouse cursor approaches the coordinate at the corner of the lower wall, the large edit handle will snap to that coordinate, along with the entire rest of the object.

 

Commit the edit by right-clicking and choosing Save Changes in the context menu, or by pressing the Update Record button in the Info pane (which pops open whenever we edit an object), or by pressing Ctrl-Enter if we prefer keyboard shortcuts.    

 

 

The change takes effect and the object moves.   To unpick it from editing mode, Alt-click anywhere outside the object.

 

Notes

The Layers pane rules - If we use the Layers pane to turn off snapping for a layer, snapping will not operate in that layer even if we make it the active layer.

 

Videos

Editing Drawings - Create Areas - How to create areas (polygons) in a drawing.  We digitize a lake by tracing over a background satellite image layer from a web server.  This quick video shows how editing tools in Manifold make it easy to digitize objects very quickly, correcting any errors with no stress or fear of getting it wrong.  Includes a quick demo of snapping.

 

Editing Drawings - Create Lines with Curves - A very short video showing how to create lines in drawings using straight segments and also circular arcs.  We create a line in a map of Paris showing our walk around circular ponds. Manifold can create polylines using straight line segments for classic polylines, or using curved segments that are circular arcs, ellipses, or splines for very smooth curves, a much faster and easier technique than clicking many points.  Super!

See Also

Drawings

 

Editing Drawings

 

Clip

 

Erase

 

Merge

 

Split

 

Measurements

 

Copy and Paste between Drawings or Tables

 

Layers Pane

 

Grids

 

Info Pane

 

Example: Draw Lines, Areas and Points - Simple example of using basic mouse moves to add points, lines and areas to a drawing.

 

Example: Change the Shape of Areas - Step-by-step editing of an existing area in a drawing: changing the shape by moving a vertex, by moving several vertices together, by moving the entire object, by deleting a vertex and by adding a vertex.

 

Example: Edit Areas in a Layer to Align with Another Layer - Editing areas in one layer so their boundaries align, either all or in part, with boundaries of areas in a different layer is a common task in GIS and CAD. For example, we might want area boundaries in a layer with different zoning areas for tax or regulatory purposes to be guided by the boundaries of administrative jurisdictions, such as the boundaries of cities, in a different layer.  This example shows how, using fast and simple techniques.