简体   繁体   中英

In C++ how can I calculate all possible Bezier handle points in order to make the curve to a given length?

In C++, Given two anchor points and a handle point of a Quad Bezier curve, how can I calculate the other handle point in order to make the curve length to a fixed value?

What kind of orbit will it be?

I am doing a CAD software. I need to make the cursor "snap to" the possible point when moving nearby it. So I need to calculate the orbit rather than simply check what the length would be.

Length of a quadratic Bezier curve P1P2P3 is bounded by length of polyline P1P2P3, ie,

||P3 - P2|| + ||P2 - P1|| = const

as P1 and P3 are fixed, thus, P2 lies on an ellipse with P1 and P3 being its focal points .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM