算法找到封闭贝塞尔曲线边框?边框、算法、塞尔、曲线

2023-09-10 23:56:44 作者:最新五个字的昵称大全

我在寻找一种算法来寻找边界直角轴封闭的二次贝塞尔曲线框(最大/最小分):

I'm looking for an algorithm to find bounding box (max/min points) of a closed quadratic bezier curve in Cartesian axis:

input: C (a closed bezier curve)
output: A B C D points

注意:上图显示的平滑曲线。它可能是不顺利。 (有角)

Note: above image shows a smooth curve. it could be not smooth. (have corners)

推荐答案

嗯,我会说,你加入的所有端点的边界框开始。然后,你经历所有的贝塞尔元素。我认为在公式中的问题是这个:

Well, I would say you start by adding all endpoints to your bounding box. Then, you go through all the bezier elements. I assume the formula in question is this one:

从该提取物分别两个公式为X,和Y。通过采取衍生物(过零点)测试既为极值。那么相应的点添加到您的边框为好。

From this extract two formulas for X, and Y respectively. Test both for extrema by taking the derivative (zero crossings). Then add the corresponding points to your bounding box as well.