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 or using the tracker tool.  Commands to turn snapping on/off and to set snap modes become available when we launch the tracker tool, when we 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 the tracker tool and editing commands, so if in the tracker tool 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.

 

When editing or using the tracker, 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 Snap Parameters, 10 units of measure by default.  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.

 

 

  Grid step

The size of the horizontal and vertical steps in the virtual grid used for snapping in Snap to Grid mode.  The units box allows choosing either the native units used by the drawing or choosing some other unit of measure.  The default values of 10 result in a virtual grid every ten meters in meter-based coordinate systems.   To specify a virtual grid with snapping to every ten centimeters, specify values of .10 and .10, that is, one-tenth of a meter in each direction.

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.

 

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, or Snap Mode.

 

 

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.

 

When inserting or editing or using the tracker tool, a quick way to toggle the Snap to Active Layer Only setting is to press the A key on the keyboard.   At any time when editing a drawing or using the tracker tool, 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 imaginary grid locations spaced by the given distances in horizontal and vertical dimensions.     

 

 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.    We also choose Snap Parameters, and then in the Snap Parameters dialog we set a grid step of 0.2 for both horizontal and vertical grid steps.   This creates an imaginary grid spaced every 20 centimeters in our drawing, which uses meters as a native unit of measure.   We press OK to apply those parameters and to exit the dialog.

 

 

When using Snap to Grid mode, the system does not paint a virtual layer of grid points.   To show the locations of grid points, in the illustration above we have added a layer that positions points, shown as small + cross symbols, every 20 centimeters.   We can see from the location of the point and the area 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.

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 or tracker 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

Getting Started

 

User Interface Basics

 

Drawings

 

Editing Drawings

 

Tracker: Measurements

 

Copy and Paste between Drawings or Tables

 

Layers Pane

 

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: Drawings use Geom Fields in Tables  - An essential discussion on how drawings are created from geom fields in tables, including how the drawing knows which coordinate system to use.

 

Example: Repair a Wrong Edit using a Backup - How to quickly make a backup table and to then copy and paste geometry from that table to repair errors made when editing objects.  This technique is a life-saver when edits go astray.

 

Example: Trace an Area in a Map over an Image Background - In a map with a drawing layer above an image layer, create an area object in the drawing by tracing over the outlines of something seen in the image layer below.

 

Example: Edit Coordinates While Creating an Object - When creating an object in a map using a tool such as Create Area, right in the middle of the process we can edit coordinates in the Info pane Coordinates tab.   This example shows the step by step process.

 

Example: Edit Attributes and Move a Point - We look at the attributes for a point in a drawing layer and edit one of the attributes using a more expanded Edit dialog.  We then move the point to a new location. Easy!

 

Example: Edit Attributes, Larger Text, IME for Asian Languages - A tour showing how to edit attributes in a drawing using the Info pane Values tab and the expanded Edit dialog, including advanced Unicode facilities and use of the built in Input Method Editor (IME) to input text in Japanese language.

 

Example: Create a Multipoint - This topic provides two examples:  First we create a multipoint and then next we create a multipoint having two branches.  The purpose of this topic is to help teach the implementation of geometry in Manifold and other spatial packages using an unusual and rarely met object type, the multipoint, which combines what appear to be many separate points into a single multipoint object.

 

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.  

 

Example: Edit Covered Objects - Working with drawings where some areas completely cover smaller areas is a bad idea, but sometimes we have to work with data in that form whether we like it or not.   This topic shows techniques that can help us select and edit objects that are completely hidden by higher objects.