Pretty much everything is said in the title, so I'm not going to expand in explanations... I grabbed the snapping tool which has been implemented by our development team to create the measure command (you can find this code under viewer3D.js which is shipped with View & Data API, see Autodesk.Viewing.Extensions.Measure.Snapper) and tweaked it a little adding some custom methods, properties and events in order to turn it into a tool that can be used to snap THREE.js geometry as the user is hovering the mouse over the meshes and fire events.
The extension shows how you can filter weather the snapped geometry is a vertex, and edge or a face and also implement commands that will prompt the user to graphically pick some of that geometry on the model. Quite useful for those who want to leverage View & Data API to implement more complex commands where selection is involved.
Below is the code for the Geometry Selector extension but most of the logic is implemented in the Autodesk.ADN.Viewing.Tool.Snapper.js (attached in the zip):
A live sample can be tested from here.
Autodesk.ADN.Viewing.Extension.GeometrySelector
Comments