網址在這里
Introduction
這個筆記由幾位專業(yè)人士準備特漩,因而感覺非常好讀督笆。主要關于subdivision,從最基礎的數學介紹到應用栽惶,還有一些bonus代碼脓诡。
Advantages:
- arbitrary topology
- scalability
- uniformity of representation
- numerical stability
- code simplicity.
比起樣條(spline)更便利,同時是recursive structure媒役,方便實現和計算祝谚,效率比較高。
Foundations I: Basic Ideas
細分思想
先從插值細分(Interpolating Subdivision)開始講起酣衷。我個人理解是交惯,在一段線段里再插入幾個點,讓線段變成幾條小線段穿仪,從而使折線更平滑席爽。原來的點不變,只是多了插入的點啊片。
Subdivision defines a smooth curve or surface as the limit of a sequence of successive refinements.
也就是說只锻,細分是想用有限的序列不斷地精細化,來表現平滑曲線曲面紫谷。
在插值細分中齐饮,需要確定一個規(guī)則,即如何決定在哪里插入新的點笤昨。不同的規(guī)則自然會導致不同平滑度和不同形狀的曲線曲面祖驱。
規(guī)則需要考慮到的點有以下幾條:
- Efficiency:用少量浮點運算計算新點位置,e.g. 加權平均
- Compact support: 當一個點插入時瞒窒,其影響應當是有限的捺僻,能夠控制住的
- Local definition: 新點的計算規(guī)則不應該基于較遠的點
- Affine invariance: 點集的affine transformation不會影響曲線曲面的形狀,e.g. 加權平均中權重和為1
- Simplicity: 規(guī)則要簡明
- Continuity: 注意產生的曲線曲面的連續(xù)性和可微性
細分與其他方式的對比:
- Efficiency: 細分是比較高效的崇裁。其實有些細分就是spline modeling中knot insertion的推論和歸納匕坯。但是隱式曲面(不是很懂)計算就比較低效了。
An algorithm such as marching cubes is required to generate the polygonal approximation needed for rendering.Variational surfaces can be even worse: a global optimization problem has to be solved each time the surface is changed.
- Arbitrary topology: 細分是在研究者們嘗試解決spline的任意拓撲問題時產生的拔稳。這個也是隱式曲面的特長所在葛峻。(不是很懂)
- Surface features: 即對于形狀大小的控制。variational surfaces很好壳炎,靈活性高泞歉,也能精確創(chuàng)造性狀。隱式曲面則不行匿辩。spline雖然可以腰耙,但是計算上非常低效。細分比spline好铲球。
- Complex geometry: 這個應該是subdivision的專長了挺庞,由于是計算決定精細度,很容易實現level-of-detail rendering稼病。
復習樣條的內容
Splines are piecewise polynomial curves of some chosen degree.
樣條是B-樣條(即basis spline)的線性組合选侨。這些B-樣條是控制點的系數掖鱼。想要連接樣條,連接處的曲線段的各級導數最好是相等的援制,這樣才能維持住spline整體的連續(xù)性戏挡。同時控制點的移動僅會影響一小部分的曲線。這里有一個小動畫晨仑,通過拖動控制點褐墅,可以很清楚地看到其移動帶來的影響是local的。p.s. 加載可能要vpn
下面介紹如何用repeated convolution構建B-splines洪己。
x(t) = ∑x_iB^i_0(t)
_表示下標妥凳,^表示上標。目前沒找到在markdown里加latex的方法……
如果 x(t) 是piecewise constant coordinate functions答捕,那么 B_0(t) 就是一個box function逝钥,在 [0,1) 上為1,其他為0拱镐。然后上標 i 表示translation艘款,即把 B_0(t) 右移 i。
the continuous convolution of two functions f and g: (f ? g)(t) = integrate{ f(s) g(t?s) ds }.
于是B_1(t)= integrate{ B_0(s) B_0(t?s) ds }痢站,是一個linear hat function磷箕。
于是a B-spline of degree p可以歸納為:
B_p(t)= integrate{ B_p?1(s) B_0(t?s) ds }.
其連續(xù)性有以下定理:
Theorem 1 If f(t) is C^k continuous, then (B_0 ? f )(t) is C^k+1 continuous.
即一個n級spline是C^n-1 continuous。
B-樣條的微調能力
B-樣條遵從一個refinement equation阵难。這是一條連接樣條和細分的性質。
In other words, the B-spline of degree l can be written as a linear combination of translated (k) and dilated (2t) copies of itself.