I want to snapp points in the model and retrieve their coordinates. I found the below code in Forge blog
this.points = [];
const result = this.snapper.getSnapResult();
const { SnapType } = Autodesk.Viewing.MeasureCommon;
switch (result.geomType) {
case SnapType.SNAP_VERTEX:
case SnapType.SNAP_MIDPOINT:
case SnapType.SNAP_INTERSECTION:
this.points.push(result.getGeometry());
Now Im able to get the coordinates of vertex and midpoints, but I want to actully get the coordinates of any snapped point of a Brep-line for instance. How is this possible ?
You're probably referring to this blog post, right? The
SnapTypeenumeration used in the blog lists all the types of snapping types the tool can detect. Other types you would probably have to detect yourself, for example, by shooting a ray to the scene based on the camera position and mouse cursor position, and finding whatever object of interest are nearby.