贝塞尔曲线上的等距点
目前,我正在尝试使多个贝塞尔曲线具有等距点。 我目前正在使用三次插值来查找点,但由于贝塞尔曲线的工作方式,某些区域比其他区域更密集,并且由于距离可变而导致纹理映射变得粗糙。 有没有办法通过距离而不是百分比来查找贝塞尔曲线上的点? 此外,是否可以将其扩展到多条连接的曲线?
Currently, I'm attempting to make multiple beziers have equidistant points. I'm currently using cubic interpolation to find the points, but because the way beziers work some areas are more dense than others and proving gross for texture mapping because of the variable distance. Is there a way to find points on a bezier by distance rather than by percentage? Furthermore, is it possible to extend this to multiple connected curves?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我知道这是一个老问题,但我最近遇到了这个问题,并创建了一个
UIBezierPath
扩展来解决给定Y
坐标的X
坐标反之亦然。 写得很快。https://github.com/rkotzy/RKBezierMath
I know this is an old question but I recently ran into this problem and created a
UIBezierPath
extention to solve for anX
coordinate given aY
coordinate and vise versa. Written in swift.https://github.com/rkotzy/RKBezierMath
P_0 和 P_3 之间的距离(立方形式),是的,但我想你知道,这是直接的。
曲线上的距离只是弧长:
图 1 http://www.codecogs.com/eq.latex?%5Cint_%7Bt_0%7D%5E%7Bt_1%7D%20%7B%20|P' (t)|%20dt
其中:
图 2 http://www.codecogs.com/eq.latex?P%27(t)%20=%20[%7Bx%27 ,y%27,z%27%7D]%20=%20[%7B%5Cfrac%7Bdx(t)%7D%7Bdt%7D,%5Cfrac%7Bdy(t)%7D%7Bdt%7D,%5Cfrac% 7Bdz(t)%7D%7Bdt%7D%7D]
(请参阅休息)
也许,你会有 t_0 = 0、t_1 = 1.0 和 dz(t) = 0(2d 平面)。
distance between P_0 and P_3 (in cubic form), yes, but I think you knew that, is straight forward.
Distance on a curve is just arc length:
fig 1 http://www.codecogs.com/eq.latex?%5Cint_%7Bt_0%7D%5E%7Bt_1%7D%20%7B%20|P'(t)|%20dt
where:
fig 2 http://www.codecogs.com/eq.latex?P%27(t)%20=%20[%7Bx%27,y%27,z%27%7D]%20=%20[%7B%5Cfrac%7Bdx(t)%7D%7Bdt%7D,%5Cfrac%7Bdy(t)%7D%7Bdt%7D,%5Cfrac%7Bdz(t)%7D%7Bdt%7D%7D]
(see the rest)
Probably, you'd have t_0 = 0, t_1 = 1.0, and dz(t) = 0 (2d plane).
这称为“弧长”参数化。 几年前我写了一篇关于此的论文:
http://www.saccade.com /writing/graphics/RE-PARAM.PDF
这个想法是预先计算“参数化”曲线,并通过该曲线评估该曲线。
This is called "arc length" parameterization. I wrote a paper about this several years ago:
http://www.saccade.com/writing/graphics/RE-PARAM.PDF
The idea is to pre-compute a "parameterization" curve, and evaluate the curve through that.