Point Existence on Edge within Component

I want to test for the existence of a point on an edge within a Component.

My script does the following:

  • Run a RayTest
  • Compares the Raytest entity result with the Component in question

This works except when there is 2 edges at the same location.

Is there another way to get the result I am looking for?

Or should there be a feature request to return all entities at the same location with the raytest?

In the above screenshot the Raytest along the green axis returns the blue Component were I want to check the existence of the Red Component.


try …

point.on_line?(edge.line) && 
( point.distance(edge.start.position) + 
point.distance(edge.end.position) == edge.length )

Well, this is not the question that the topic is labeled with.

If you are trying to “pick” objects then your code should perhaps be using the Sketchup::PickHelper class.