AnsweredAssumed Answered

Solidworks Calculates Zero Distance Between Point and Edge

Question asked by Elisha Stevenson on Jan 7, 2016
Latest reply on Jan 8, 2016 by Elisha Stevenson

I'm noticing some strange behavior when working with corners of certain geometries. In the above image, the highlighted point and highlighted edge are considered coincident by SolidWorks. If the edge was extended, this would be true, but in this instance the to entities are only collinear and do not actually coincide.

I didn't realize this was happening until I got some unexpected results from the below code.


                        closestPointOnEdge = (double[])((Edge)edgeEntity).GetClosestPointOn(pointPosition.X, pointPosition.Y, pointPosition.Z);


                        currentDistanceFromEdge = Distance(closestPointOnEdge, pointPosition)


The currentDistanceFromEdge is calculated as zero. Graphically, it isn't on the line. If I add another relation to make the edge endpoint and the point coincident, then the point moves in position, so I'm pretty certain rendering isn't the problem. When I add a smart dimension to the endpoint and the point i get a distance of "0.00000508m." I've worked around corners in larger geometries, so I'm fairly certain the small resolution of the example isn't the problem.