Let's say your segment is between P1 and P2, and P is your point.
compute
gp_Vec V1(P,P1);
gp_Vec V2(P,P2);
Standard_Boolean PBelongToSeg = V1.IsParallel(V2,Precision::Angular());
HTH
compute the 2 gp_Vec from
Archived discussion
Hello!
Is there a standard way to determine if point belongs to line segment bounded by 2 points?
Currently I project point to segment, calculate distance from initial point to projection point and compare it with Precision::Confusion().
Discussion
Posts are displayed in their archived order.
Let's say your segment is between P1 and P2, and P is your point.
compute
gp_Vec V1(P,P1);
gp_Vec V2(P,P2);
Standard_Boolean PBelongToSeg = V1.IsParallel(V2,Precision::Angular());
HTH
compute the 2 gp_Vec from