Given a 3D line in CGAL, how do I compute a point on that line that is some known distance from an endpoint?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you have two points P0 and P1, you can make a vector V = P1 – P0.
Given distance D from P0, you can get the resulting point R = P0 + (D ÷ ||V||) ⋅ V.
(Linearly interpolate between the lines, changing D into a percentage by dividing by the full length of the line.)
I don’t know CGAL (and the documentation kind of sucks), but I assume it’d be something like this:
Note I can’t even find a way to get the starting point of a line, so that one is up to you. (The
l.ppart is made up.)