Line |
Gets an index of the first position of the line segment that is closest to the specified position. This value is calculated in GetClosestDistance method.
When CheckBoundingBox is true and when the screenPosition was outside the bounding box, then this value is set to -1.
This value allows getting the actual line segment that is closest to the specified position. In the following example the closes line segment is defined between the firstSegmentPosition and secondSegmentPosition:
var closestPolyLine = (PolyLineVisual3D)closestLineSelector.LineVisual; Point3D firstSegmentPosition = closestPolyLine.Positions[closestLineSelector.LastLinePositionIndex]; Point3D secondSegmentPosition = closestPolyLine.Positions[closestLineSelector.LastLinePositionIndex + 1];