Blender Git Commit Log

Git Commits -> Revision 0690895

Revision 0690895 by Germano Cavalcante (master)
July 14, 2016, 03:47 (GMT)
Improves the accuracy of snap to edges

Recently the snap to edges has been changed to work with coordinates 2d. Thus, the lambda of the snap pointon on edge becomes different from the actual lambda in a 3d edge.

The solution to correct the lambda was this:

```
if (is_persp) {
const float fac = depth_a / (depth_a + depth_b);
lambda *= (1.0f + (fac - 0.5f) * (1.0f - lambda));
````

...
But the lambda was still not very accurate.
Now the function uses the `dist_squared_ray_to_seg_v3` to get the coordinate of the snap point on the edge. And then tests that point.

The accuracy returned to normal values.

Commit Details:

Full Hash: 06908955c3fe9948fff8a1cc195ce90b8d284431
Parent Commit: 6771165
Lines Changed: +32, -92

1 Modified Path:

/source/blender/editors/transform/transform_snap_object.c (+32, -92) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021