2009年2月27日 星期五

sliding house



這是jimmy特別推薦的可移動房子。
詳細的內容可以到jimmy的部落格(幸福研究院),他有更詳盡的介紹。

2009年2月25日 星期三

Rhino Script Excise09



aim: add one new vertex in the middle position of every two continuous existing vertices of a polyline.


Option Explicit
'Script written by Jeong-der ho, based on Robert McNeel & Associates Rhino script tutorial
'Script copylefted by de place
'Script version 2009年2月18日 上午 11:25:38

Call DividePolyline()
Sub DividePolyline()
Dim strOriPolyline
strOriPolyline = Rhino.GetObject("Select a Polyline sample", 4, True, True)
If IsNull(strOriPolyline) Then Exit Sub

Dim arrPolyVertices
arrPolyVertices = Rhino.PolylineVertices(strOriPolyline)

Dim arrNewVertices
arrNewVertices = SubDividePolyline(arrPolyVertices)

Dim strNewPolyline
Dim arrStart : arrStart = Array(0,0,0)
Dim arrEnd : arrEnd = Array(10,0,0)

strNewPolyline = Rhino.AddPolyline (arrNewVertices)
Call Rhino.MoveObject(strNewPolyline, arrStart, arrEnd)
End Sub

Function SubDividePolyline(ByRef arrV)
Dim arrSubD() : ReDim arrSubD(2 * UBound(arrV))
Dim i

For i = 0 To UBound(arrV)-1
'copy the original vertex location
arrSubD(i * 2) = arrV(i)
'compute the average of the current vertex and the next one
arrSubD(i * 2 + 1) = Array( (arrV(i)(0) + arrV(i+1)(0)) / 2.0, _
(arrV(i)(1) + arrV(i+1)(1)) / 2.0, _
(arrV(i)(2) + arrV(i+1)(2)) / 2.0)
Next

'copy the last vertex (this is skipped by the loop)
arrSubD(UBound(arrSubD)) = arrV(UBound(arrV))
SubDividePolyline = arrSubD
End Function

2009年2月23日 星期一

Darwin 200 (2, 3)



今年是達爾文200週年冥誕,國家地理頻道每週日晚上九點會播紀念「達爾文200週年紀念特輯」。
第一週02/08 達爾文的演化遠征(如之前文章提及)

第二週02/15 演化足跡:路上行鯨
主要是由鯨魚的演化歷程,讓觀者熟悉演化的實例發展。因為鯨魚體型夠大,易於觀察。又因為鯨魚的演化是反其道的,因為陸上生物是由海洋演化而來,而鯨魚又再度演化回歸海洋,是有趣的例子,成為許多生物演化專家喜歡舉例的對象。鯨魚在若干年前,是在陸地上類似狼的生物,礙於環境變化,食物缺乏,逐步慢慢演化成在淺水灘游水的兩棲動物,又逐步變成完全生活在水中的哺乳動物。很多細節節目中會詳盡說明。

第三週02/22 演化足跡:迅猛火雞
透過一連串化石推論與拼湊,論證火雞是遠古時期恐龍的親戚。恐龍其一支脈如何演變成始祖鳥,鳥類的祖先,為何長羽毛,棲息在何處,為何嘗試飛行等等有趣的問題,一一描述理論的輪廓。

2009年2月18日 星期三

Rhino Script Excise08




Option Explicit
'Script written by
'Script copyrighted by
'Script version 2009年2月18日 上午 11:14:27
'Script function 選取隨意繪製的polyline,電腦回饋長度。'

Call CalPolylineLength
Sub CalPolylineLength
Dim strPolyline
strPolyline = Rhino.GetObject("select a polyline sample", 4, True, True)

Dim arrPolyVertices
arrPolyVertices = Rhino.PolylineVertices(strPolyline)

Dim dblPolylineLength
dblPolylineLength = PolylineLength(arrPolyVertices)
Call Rhino.print("PolylineLength = " & dblPolylineLength)
End Sub

Function PolylineLength(ByRef arrVertices)
PolylineLength = 0.0
Dim i
For i = 0 To UBound(arrVertices) - 1
PolylineLength = PolylineLength + Rhino.Distance(arrVertices(i), arrVertices(i+1))
Next
End Function

2009年2月14日 星期六

Rhino Script Excise07



Call Main()
Sub Main()
Dim strSurfaceID
strSurfaceID = Rhino.GetObject("Select a surface to sample", 8, True)
If IsNull(strSurfaceID) Then Exit Sub

Dim strCurveID
strCurveID = Rhino.GetObject("Select a curve to measure", 4, True, True)
If IsNull(strCurveID) Then Exit Sub

Dim arrPts : arrPts = Rhino.DivideCurve(strCurveID, 500)
Dim i

Call Rhino.EnableRedraw(False)
For i = 0 To UBound(arrPts)
Call EvaluateDeviation(strSurfaceID, 5.0, arrPts(i))
Next
Call Rhino.EnableRedraw(True)
End Sub

Function EvaluateDeviation(strSurfaceID, dblThreshold, arrSample)
EvaluateDeviation = Null

Dim arrR2Point
arrR2Point = Rhino.SurfaceClosestPoint(strSurfaceID, arrSample)
If IsNull(arrR2Point) Then Exit Function

Dim arrR3Point : arrR3Point =Rhino.EvaluateSurface(strSurfaceID, arrR2Point)
If IsNull(arrR3Point) Then Exit Function

Dim dblDeviation : dblDeviation = Rhino.Distance(arrR3Point, arrSample)
If dblDeviation <= dblThreshold Then
EvaluateDeviation = True
Exit Function
End If

Call Rhino.AddPoint(arrSample)
Call Rhino.AddLine(arrSample, arrR3Point)
EvaluateDeviation = False
End Function

2009年2月12日 星期四

Rhino Script Excise06



This is a script which adds points according to a specific interval from R1 parameters to R3 spatial positions.

Call Main()
Sub Main()
Dim strCurveID
strCurveID = Rhino.GetObject("select a curve to sample", 4, True,True)
If IsNull(strCurveID) Then Exit Sub

Dim t
Call Rhino.EnableRedraw(False)
For t = 0.0 To 1.0 Step 0.002
Call AddPointAtR1Parameter(strCurveID, t)
Next
Call Rhino.EnableRedraw(True)
End Sub

Function AddPointAtR1Parameter(strCurveID, dblUnitParameter)
AddPointAtR1Parameter = Null

Dim crvDomain : crvDomain = Rhino.CurveDomain(strCurveID)
If IsNull(crvDomain) Then Exit Function

Dim dblR1Param
dblR1Param = crvDomain(0) + dblUnitParameter * (crvDomain(1) - crvDomain(0))
Dim arrR3Point : arrR3Point = Rhino.EvaluateCurve(strCurveID, dblR1Param)
If Not IsArray(arrR3Point) Then Exit Function

Dim strPointId : strPointID = Rhino.AddPoint(arrR3Point)
Call Rhino.ObjectColor(strPointID, ParameterColour(dblUnitParameter))
AddPointAtR1Parameter = strPointID
End Function

Function ParameterColour(dblParam)
Dim RedComponent : RedComponent = 255 * dblParam
If (RedComponent < 0) Then RedComponent = 0
If (RedComponent > 255) Then RedComponent = 255

ParameterColour = RGB(RedComponent, 0, 255 - RedComponent)
End Function

2009年2月9日 星期一

Phase space 相空間




「相空間」描述系統狀態的變化,原使用在物理、數學、化學等領域,後來也被其他領域借用,做為描述系統動態的工具。其實也跟整個電腦興起後所談的非線性空間相關,非線性空間也是一個相空間。這也是有關達爾文的後續生物學家的研究,用相空間來解釋演化的趨勢。

以下是維基的解釋

相空間 From Wikipedia

在數學與物理學中,相空間(phase space)是一個用以表示出一系統所有可能狀態的空間;系統每個可能的狀態都有一相對應的相空間的點。以力學系統來說,相空間通常是由位置變數以及動量變數所有可能值所組成。將位置變數與動量變數畫成時間的函數有時稱為相空間圖,簡稱「相圖」(phase diagram)。然而在物質科學(physical sciences)中,「相圖」這詞更常是留給一化學系統用以表示其熱力學相態多種穩定性區域的圖表,為壓力、溫度及化學組成等等之函數。

在一相空間中,系統的每個自由度或參數可以用多維空間中的一軸來代表。對於系統每個可能的狀態,或系統參數值允許的組合,可以在多維空間描繪成一個點。通常這樣的描繪點連接而成的線可以類比於系統狀態隨著時間的演化。最後相圖可以代表系統可以存在的狀態,而它的外型可以輕易地闡述系統的性質,這在其他的表示方法則不那麼顯明。一相空間可有非常多的維度。舉例來說,一氣體包含許多分子,每個分子在x、y、z方向上就要有3個維度給位置與3個維度給速度,可能還需要額外的維度給其他的性質。

在古典力學中,相空間坐標由廣義坐標qi以及其共軛的廣義動量pi所組成。研究由許多系統所構成的系綜在此空間中的運動是屬於古典統計力學的範疇。


From Wikipedia, the free encyclopedia

Phase space of a dynamical system with focal stability.In mathematics and physics, a phase space, introduced by Willard Gibbs in 1901, is a space in which all possible states of a system are represented, with each possible state of the system corresponding to one unique point in the phase space. For mechanical systems, the phase space usually consists of all possible values of position and momentum variables. A plot of position and momentum variables as a function of time is sometimes called a phase plot or a phase diagram. Phase diagram, however, is more usually reserved in the physical sciences for a diagram showing the various regions of stability of the thermodynamic phases of a chemical system, which consists of pressure, temperature, and composition.

In a phase space, every degree of freedom or parameter of the system is represented as an axis of a multidimensional space. For every possible state of the system, or allowed combination of values of the system's parameters, a point is plotted in the multidimensional space. Often this succession of plotted points is analogous to the system's state evolving over time. In the end, the phase diagram represents all that the system can be, and its shape can easily elucidate qualities of the system that might not be obvious otherwise. A phase space may contain very many dimensions. For instance, a gas containing many molecules may require a separate dimension for each particle's x, y and z positions and velocities as well as any number of other properties.

In classical mechanics the phase space co-ordinates are the generalized coordinates qi and their conjugate generalized momenta pi. The motion of an ensemble of systems in this space is studied by classical statistical mechanics. The local density of points in such systems obeys Liouville's Theorem, and so can be taken as constant. Within the context of a model system in classical mechanics, the phase space coordinates of the system at any given time are composed of all of the system's dynamical variables. Because of this, it is possible to calculate the state of the system at any given time in the future or the past, through integration of Hamilton's or Lagrange's equations of motion. Furthermore, because each point in phase space lies on exactly one phase trajectory, no two phase trajectories can intersect.

For simple systems, such as a single particle moving in one dimension for example, there may be as few as two degrees of freedom, (typically, position and velocity), and a sketch of the phase portrait may give qualitative information about the dynamics of the system, such as the limit-cycle of the Van der Pol oscillator shown in the diagram.


Phase portrait of the Van der Pol oscillatorHere, the horizontal axis gives the position and vertical axis the velocity. As the system evolves, its state follows one of the lines (trajectories) on the phase diagram.

Classic examples of phase diagrams from chaos theory are the Lorenz attractor and Mandelbrot set.

2009年2月8日 星期日

Darwin 200





今年2/12是達爾文200歲冥旦,世界各地都有慶祝活動,為這位十九世紀的先驅者所帶來的先知卓見致意。


關於達爾文的進化論,物競天擇,幾年前讀過中時出版社翻譯的「演化論」(好像叫這個書名),大約有涉略一二。今晚National Geographic Channel也播了達爾文的特別企劃,順便複習了一些所讀過的事物。再一次從記憶裡翻閱達爾文的事蹟,其實還是不禁對於他的成就由心底油然地肅然起敬。


整個進化論的重點,不外乎把生物物種的創造,由宗教造物主創造的觀念,物種恆久不變的觀念,轉變成物種會隨與環境的互動中改變,進而產生新物種或絕種。這在當時的社會與知識界裡都還算是相當激進的想法,由此看他一路由小獵犬號航行世界,逐步從各地的所見所聞,經過多年的思考與研究,才一一拼湊出這樣重大人類的發現,確實是很大的成就。


生物與建築的關係,是目前研究的方向,三不五時總會被人問到為何這二者有關係(包括學生的家長....),其實我確信很有關係,而且在很多方面,每次想到這些白日夢的細節都叫人特別興奮。它會是一種建築的論述,也會是一種建築的實踐,更會是一種生命的宇宙觀,我自己是這樣期待著。

2009年2月5日 星期四

mobile living



詳細資料:
http://chinese.autoblog.com/2009/02/04/japan-guts/

收到之前學生小黑寄來的網路資訊,關於三個日本年輕人,改裝一輛toyota卡車,成為一輛環遊日本、五臟俱全的生活車。一方面聯繫到小湘的畢業設計,同樣是做移動式的車輛/建築;另一方面讓我回想到多年前,我利用我的pickup車廂後斗加遮棚,在東海睡過好幾個晚上,那種游牧式的生活是一種體驗。