Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Java 中有一个 CubicCurve,它由 4 个控制点定义。我可以绘制生成的形状,但是如何在给定分辨率的该形状中接收有效的每个点?顺便说一下 PathIterator “只”返回控制点,而不是曲线本身的点。
二维参数三次曲线只是两个多项式
x(t)=ax0+ax1*t+ax2*t*t+ax3*t*t*t y(t)=ay0+ay1*t+ay2*t*t+ay3*t*t*t
因此,t=<0.0,1.0>您从控制点计算a?0...a?3系数,然后t以尽可能小的步长循环,以获得所需的所有点,例如点数dt=1.0/(n-1)在哪里n。
t=<0.0,1.0>
a?0...a?3
t
dt=1.0/(n-1)
n
系数取决于用于BEZIER/SPLINE 或插值的曲线,请参见: