贝塞尔曲线与曲线内的控制点 [英] Bezier curve with control points within the curve

查看:167
本文介绍了贝塞尔曲线与曲线内的控制点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参见下图. 该路径对象是在每侧使用4 Bezier曲线创建的. 当前,当我尝试获取使用三次火盆曲线创建的此路径对象的边界时,我遇到了一个问题.如您所见,顶部和底部具有远离曲线的控制点,这使边界完全不准确.

Please see the image below. This path object is created using 4 Bezier curve on each side. Currently I am facing a problem when I try to get bounds of this path object created using cubic brazier curves. As you can see top and bottom sides have control point away from the curve which makes bounds totally inaccurate.

所以我的问题是,是否有可能像图像中那样将曲线上或曲线上的所有控制点都制作成拼图玩具. (即在曲线的边界内创建所有曲线并使其完美镜像)

So my question is is it possible to create a jigsaw puzzle piece like in the image having all control points on or at the level of the curve. ( That is creating a curve and perfect mirror of it, all points within the bounds of the curve)

推荐答案

请不要使用控制点来计算边界.至少如果您需要紧密的边界并且不希望快速检查给定裁剪矩形中的潜在可见性. 很棒的网站可以为常见的贝塞尔曲线计算提供很多帮助,包括

Don't calculate the bounds by using the control points, then. At least if you need tight bounds and don't want a quick check for potential visibility in a given clipping rectangle. This awesome site can help a lot with common Bézier curve calculations, including bounding box.

或者,切换到样条曲线上控制点位于曲线上的位置,但是最终可能会得到相反的效果,即曲线超出了其控制点所施加的边界.

Alternatively, switch to splines where the control points are on the curve, but then you could end up with the opposite effect where the curve extends beyond the bounds imposed by its control points.

这篇关于贝塞尔曲线与曲线内的控制点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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