算法找到封闭贝塞尔曲线边框? [英] An algorithm to find bounding box of closed bezier curves?

查看:206
本文介绍了算法找到封闭贝塞尔曲线边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于算法找到封闭贝塞尔曲线边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆