I try to get and snap the model point in the viewer that like the function of the measure distance tool of the viewer tool bar.
I have got the point by mouseclick event . Is there any way to have the snap function in the viewer?
let pt = viewer.impl.hitTest(
event.clientX,
event.clientY,
true,
null,
[mModel.getModelId()]
);
The measure extension use another extension called Autodesk.Snapping
. You can use this extension to snap vertices, edges or faces.
Here's another question with a short example on how to use the forge viewer snapper.
And you can read this great article about the snapping extension : Snappy viewer tools