Psuedo Code 1.0 by jonbailey
March.28.2009, 11:31 pm
Filed under: Script, Studio Talk

After talking tonight we seem to be headed towards writing a script where a surface is generated from a three-dimensional attractor point cloud, where the cloud is formed based on proximities to the attractor points. the resulting cloud leaves behind vector geometry that is then swept with a curve and lofted. the resulting surface is then woven by the midaregami + knotting technique. the sketches show how the structure might fit around a surface formed from the point cloud, and the functions behind the stress/strain loading on the structure, where denser weaving will happen at areas seeing more stress. below is a psuedo code for the script we are working on:


‘ declarevariables
”’ Dim
‘ select vector field boundaries
”’ Rhino.GetObject
‘ select point attractors
‘ enter distance threshold
‘ enter scale factor
‘ loop through objects to get closest attractor
‘ get object bounding box centerpoint
‘ loop through attractors to find the distance to the closest
‘ get closest point – use for curves rather than points
‘ check distance
‘ if/then distance test
‘ if the object is within the threshold then operate on it
‘ get vector to attractor
‘ get cross product
‘ get angle between vectors
‘ adjust angle based on adj amount
‘ rotate object using cross prod as axis
‘ get vector points.
‘ draw curve from points perpendicular with vector as centerpoint
‘ loft surface

‘ select a surface
”’ strsurface = Rhino.GetObject(“select a surface”)
‘ directional input
”’ ptBase = Rhino.GetPoint(” select the base point “)
‘ enter radius of pipes
”’ radius = Rhino.GetReal(“enter radius”); Rhino.AddCircle (arrPlane, dblRadius)
‘ declare primary variables
”’ dim
‘ # of divisions along a surface
”’ Dim udiv, vdiv udiv=x, vdiv=x
‘ declare secondary variables
”’ dim
‘ capture the domain of the surface
”’ Rhino.SurfaceDomain (strObject, intDirection)
‘ nested loop
”’ ((i,j))
‘ evaluate surface
”’ Rhino.EvaluateSurface (strObject, arrParameter)
‘ store array
”’ arrpts((i,j))
‘ collection of two points
‘ create curve along the surface R
”’ Rhino.AddInterpCrvOnSrfUV (strObject, arrPoints)
‘ create circles perpendicular to surface
”’ Rhino.CurvePerpFrame (strObject, dblParameter)
‘ loft circles or sweept curve along surface
”’ Rhino.AddLoftSrf (arrObjects [, arrStartPt [, arrEndPt [, intType [, intStyle [, nValue [, blnClosed]]]]]])
‘ weave curves, 0,1,0,1,0,1…
‘ find points of intersection at curves
”’ Rhino.CurveCurveIntersection (strObject1 [, strObject2 [, dblTolerance]])
‘ add torus at intersection
”’ Rhino.AddTorus (arrBase, dblMajorRadius, dblMinorRadius [, arrDirection])


Leave a Comment so far
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: