2017年3月8日 星期三

Shape Theory | Shape Grammar and Shape Recognization


Shape Grammar and Shape Recognization |

As a shape grammar researcher, there is always a question for you: What is shape grammar for? In fact, for me, shape grammar is similar to number theory in math. In number theory, for instance, there is a famous research field about partitioning. Number "5" can be presented as 2+3, 1+1+1+2, 4+1, etc.There are multiple ways to partition a number 5 with integers. If the number is larger, then the partition ways will be dramatically increasing. However, the focus of this article is not on numbers, it's on shapes. In those current architectural CAD tools such as AutoCAD, Rhinoceros, SketchUp, Revit or other tools, the geometry description method is very efficient but poor. For example, when we draw two squares such as the figure shown below:

常有人問我一個問題,形狀文法到底是幹嘛的? 其實形狀文法對我來說就像數論一樣,比方說數論中Partition的問題,5可以被拆解成1+4或是2+2+1或是2+3等等,這些比5還小的數字隱藏在5當中,透過組合可以產生5這個數值,5的拆解方法很多,隨著數字越來越大,拆解方法會急速增加。但這篇文章的重點不在於數論,而是形狀。在目前主流的設計軟體中,比方說AutoCAD,Rhinoceros,Revit,SketchUp或是其它軟體,幾何的描述方式是頗有效率的,但不可否認的是當前描述形狀的方式卻也是相當貧乏的。舉個例子來說,當我們在Rhino中畫兩個正方形如下圖:


In computer system, this shape will be documented as two objects (big square and small square). To a computer, it can't see other things except these two squares, it can't see "emergence shapes". In this shape, there are many emergence shapes, like 4 triangles, 12 pentagons, 2 hexagons, etc. These emergence shapes are not drawn by us, they "pop-up" after we draw two squares. In other words, a shape actually can be documented (described) in more ways. However, the current CAD tools can't recognize the emergence shapes, thereby limiting the abilities of designers' eyes and brains. For example, the current CAD tools can only partition 5 into 2+3 or 3+2, they can't decompose a shape into different shapes. This is the nature of current CAD tools, but the engineers didn't notice this point when they were developing these CAD tools. Geometries are represented (or described, documented) in "valid and economical" ways only. Thus, this geometry description system sets up a huge limitation on creativity.

在系統裡面,這個形狀會被記錄為兩個物件(一大一小的正方形),對於電腦來說,除了這兩個正方形之外,它看不到其它任何東西,或是我們所謂的"衍生出來的形狀 (Emergence Shape)",在這個形狀裡頭,衍生形狀非常多,比方說有四個三角形,十二個五邊形,兩個六角形等等。這些衍生形狀並非我們特意去畫出來的,而是在我們畫完兩個正方形之後自己產生出來的。反過來說,這個形狀其實可以用更多方式被描述,但目前的軟體並無法做到這一點,簡單來說,使用這類軟體的時候事實上是大大限制了我們的眼睛與大腦。當前的軟體扼殺了許多可能性,只因為它"看不見"這些衍生出來的形狀,或是,它無法用其它方式來拆解這個形狀。打個比方,對於軟體來說。5只能被拆解成3+2,並沒有辦法被拆解成其它的組合,這是幾何描述系統的根本,但當初我們在設計軟體的時候只求"有效並經濟"地重現(或記錄,或描述)幾何,於是這些繪圖軟體便成了創造力的限制。


In fact, this concept is the core of shape grammar. Lionel March, George Stiny and William Mitchell have proposed this idea 50 years ago. However, CAD tools were still rudimentary, computer technologies were still naive, so we keep ignoring this concept while we making CAD tools. Therefore, ARGO is the project which is aimed to define a more general geometry description system, thereby opening more possibilities for designers. For now, ARGO can recognize all 6-line shapes, these shapes can be not only one single closed shape but also a collection of multiple shapes such as a triangle with a floating line, the test result is shown in the table below.

事實上,這個概念是形狀文法的核心,Lionel March,Bill Mitchell跟George Stiny在五十多年前就提出這個概念,但當初電腦輔助軟體尚未成熟,科技面也無力去探討這個問題,我們不斷地忽略這個限制。因此我們正在開發的ARGO幾何編譯引擎的目標就是能夠讓目前的CAD軟體能夠有更通用(Generalized)的幾何描述方式,藉此打開長久以來CAD的限制。目前ARGO能夠找出所有6條線之內的圖形,並不受限於封閉形狀或是單一形 (可以是一個三角形加上一個L形),基本上目前的測試範圍是所有六條線之內的任意形。


If CAD tools can recognize more sub-shapes just as our eyes and brains (even better than that), shape computations can be more flexible, free and ample. For instance, the two-square shape can be decomposed into more combinations:

假如軟體能夠辯識出更多的子形 (如我們的眼睛大腦一般,或是更好),那麼形狀的運算就可以更豐富。比方說上述兩個正方形的形狀就可以被拆解成許多可能的組合:

Shape = Square + Square
Shape = Triangle + Triangle + Triangle + Triangle
Shape = K-shape + K-shape + Line + Line

形狀 = 正方形 + 正方形
形狀 = 三角形 + 三角形 + 三角形 + 三角形
形狀 = K形 + K形 + 直線 + 直線
.
.
.

Such decomposing methods can be infinite if we don't limit the elements as "boundary line" (the line with clear boundary, the boundary of lines are vertexes) such as 5 can be decomposed into 2.5+1+1.5. Hence, the two-square shape can also be decomposed as the combination of 4 K-shapes with 4 L-shapes shown as below.

諸如此類的拆解法,可以是無窮多種的,如果我們不侷限於邊界線段(Boundary line)的話,就如同5也可以拆解為2.5+1+1.5,如果不限於整數的話,5的拆解法也是無窮多的。比方說上述的形狀也可以被拆解成四個K形加上四個L形,如下圖


Nevertheless, ARGO cannot achieve this type of decomposition, it can only do the decomposition with boundary lines. Even though ARGO can't achieve infinite decomposition, ARGO still can help us improve current CAD tools.

目前ARGO尚無法做到此類的拆解,只能做到邊界線段的拆解。但邊界線段拆解有個好處就是邊界線段可以被視為形狀的基本元素 (Primitive),尚不討論曲線的話,所有的形狀都可以被邊界線段組合出來,也是George Stiny在Shape一書當中的清楚定義。即便ARGO還無法做到非邊界線段拆解,但對於當前的CAD軟體也是有相當大的幫助。