View Issue Details

IDProjectCategoryView StatusLast Update
0000847SketcherFeaturepublic2021-02-06 06:48
Reporterpperisin Assigned To 
Status acknowledgedResolutionopen 
Product Version0.12 
Target Version0.20 
Summary0000847: [Sketcher] Dragging + snap to grid

Snap to grid works nicely in Sketcher, but there is problem when dragging a line. IN this case snap to grid only works if a mouse location is next to grid. It would be nice if line "Snaps" if one of it's endpoints is also near grid.

Tags#lowhangingfruit, #post-to-forum, snap
FreeCAD Information


related to 0003085 closed FreeCAD The snaps-to-line-ends is so hard to make happen 



2014-02-08 00:23

developer   ~0004162

The algorithm is pretty simple and you're right just uses the mouse cursor in relation to the grid. This is similar problem to dragging nodes to other edges and automatically adding constrains. This probably would need discussing with logari

A lot of improvements are needed to the grid in general such as being full screen.


2017-05-02 21:49

administrator   ~0008865



2017-06-15 12:14

administrator   ~0009380

@abdullah is this not implemented in sketcher 0.17 ?


2017-06-15 12:41

manager   ~0009385


I have to check, as I never use this function...

No, it is not. I just checked. Works nicely on creation, but on dragging it only enforces the grid if you are very close to one point. Just as the reporter describes. You may "low hanging fruit" this.


2018-11-01 18:40

manager   ~0012126


2018-11-05 18:40

manager   ~0012138

wwmayer commented 7 hours ago

I don't think it's a matter of preference, it's a matter of usability.

Setting such a huge tolerance doesn't make any sense because effectively it's not easily possible any more to move a point somewhere inside a grid cell. If you want to achieve it you must always go back to the task dialog and tmp. disable the option.

And if you start to draw a new line you click somewhere but don't get any feedback that the first point is already accepted and when pressing twice an error is raised that adding the line failed because both points are equal. In order to see the preview line you must move at least half a size of the grid cell along X or Y axis.

I think this odd behaviour will be confusing to many users.

wwmayer commented 7 hours ago

Btw, I looked at the feature request 847 and changing the snapping tolerance doesn't do what the OP wanted. If you have a line where none of its endpoint is snapped it still won't snap when starting to drag it.


Ok, it is a misunderstanding of what gridsnap should do. As I understood it, one point of having the gridsnap on may be precisely not to be able to move points inside the grid. Under such assumption, using 0.5 precisely prevents points outside the grid. When creating a new line, with an appropriate grid size, as soon as the line passes 50% of the grid size, you get a line segment of exactly one grid size measure. Of course using inappropriate values of the grid size leads to unusable behaviour. Because endpoints of lines cannot be outside the grid, when dragging points snap to the grid. Of course, if one creates a line without snap on, outside the grid, then sets snap on and drags, it won't align.

Of course, if weak snap, as currently implemented in FC is how it should work, this PR makes no sense.

Regarding the ticket:
Dragging an endpoint of the line works perfectly with weak snap.

I am not sure I will implement dragging the edge and trying to snap the endpoints.


2022-03-03 13:55

administrator   ~0016392

This ticket has been migrated to GitHub as issue 5557.

Issue History

Date Modified Username Field Change
2012-09-27 06:13 pperisin New Issue
2014-02-04 15:39 yorik Project FreeCAD => Sketcher
2014-02-08 00:23 mrlukeparry Note Added: 0004162
2014-02-08 00:23 mrlukeparry Assigned To => mrlukeparry
2014-02-08 00:23 mrlukeparry Status new => acknowledged
2017-05-02 21:49 Kunda1 Assigned To mrlukeparry =>
2017-05-02 21:49 Kunda1 Note Added: 0008865
2017-05-06 11:23 Kunda1 Tag Attached: snap
2017-06-02 00:02 Kunda1 Tag Attached: #post-to-forum
2017-06-15 12:14 Kunda1 Note Added: 0009380
2017-06-15 12:41 abdullah Note Added: 0009385
2017-06-15 16:24 Kunda1 Tag Attached: #lowhangingfruit
2017-10-10 18:55 Kunda1 Relationship added related to 0003085
2018-01-02 12:59 Kunda1 Target Version => 0.18
2018-11-01 18:40 abdullah Note Added: 0012126
2018-11-05 18:40 abdullah Note Added: 0012138
2018-11-05 18:45 abdullah Target Version 0.18 => 0.19
2020-11-09 18:09 abdullah Target Version 0.19 => 0.20
2021-02-06 06:48 abdullah Target Version => 0.20