Just an implementation of what we' ve experienced in classroom. A similarity with the biological world that change according to the curvature.
New version of script.
Option Explicit
'Giacomo Damiani
'Script version lunedì 9 febbraio 2009 11.58.55
Call Main()
Sub Main()
Dim i, arrCirc, dblRadius, arrPts
'puÚ anche essere dinamico; ma se assegno un valore standard di grandezza del cerchio anche
'quando ho curvatura nulla, va bene cosÏ
Dim strCurve: strCurve = Rhino.GetObject("select curve", 4)
Dim StrCurveCrv
If isNull (strCurve) Then Exit Sub
Dim IntNPts: intNPts = Rhino.GetInteger("how many samples?", 100, 50, 500) 'chiedo il dimensionamento
If isNull (intNpts) Then Exit Sub
Dim arrDom: arrDom = Rhino.CurveDomain(strCurve)
Dim dblparam, arrCrvData, dblStep, arrPlane
ReDim arrCirc(intNpts)
dblStep = (arrDom(1)-arrDom(0))/intNPts
For i=0 To intNPts
dblParam = arrDom(0) + i*dblStep
arrCrvData = Rhino.CurveCurvature (strCurve, dblParam)
'puo anche essere che il raggio di curvatura sia 0, puÚ tornare indietro 1null
arrPlane = Rhino.CurvePerpFrame(strCurve, dblParam)
'sta fuori dal ciclo perchË faccio il cerchio anche se arrCrvData Ë nullo
If Not isNull (arrCrvData) Then
dblRadius= 10/arrCrvData(3)
Else
dblRadius = 0.1
End If
arrCirc(i) = Rhino.AddCircle(arrPlane, dblRadius)
'strCurveCrv = Rhino.AddInterpCurve(arrCirc)
Next
Call Rhino.AddLoftSrf(arrCirc)
Call Rhino.EnableRedraw(True)
End Sub
Could you post an image which shows how you draw the spline to reach that curvature? Is that simply reducing curvature on the top or has a particular design?
ReplyDeleteGiacomo, are you sure you posted the right script? It seems in your picture that you are extruding circles of varying radius along the curve, while the one you posted does not contain any circle.
ReplyDeleteAlso watch out for your AddInterpCurve, you are adding as many overlapping curves as the number of sample points! Check its position in the script.
Last thing: you are talking about a similarity with the biological world. Could you specify which property or condition do you refer to?
I refer to a gererical condition, the similirality it's only connected with the form of mushrooms in the end of their growth. I would like in the next experiments search also a new type of references more adherents to the biologicals systems of development and form-finding. Thanks also to your suggestions and advices.
ReplyDeleteJack