Saturday, March 31, 2007

Script

I figured I would post the script I have been working on so that everyone can benefit. Maybe someone could break it down and take it further, or create something more interesting.
Anyway....

Option Explicit
Sub Main
Dim arrObjects, strObject, arrPoints, arrPoint, strPoint
Dim strFileName, strFilter, objFSO, objStream
Dim strPreX, strPreY, strPreZ
Dim strPostX, strPostY, strPostZ
Dim strDelimiter
' User-definable prefixes
strPreX = ""
strPreY = ""
strPreZ = ""
' User-definable postfixes
strPostX = ""
strPostY = ""
strPostZ = ""
' User-definable delimiter(s)
strDelimiter = ","
' User-definable file filters
strFilter = "Excel File (*.xls)*.xlsAll Files (*.*)*.*"
' Get the points to export
Dim strObj : strObj = Rhino.GetObject("Select a curve")
If Rhino.IsCurve(strObj) Then

Dim x : x = 600 arrPoints = Rhino.DivideCurve (strObj, x, vbTrue)
For Each arrPoint In arrPoints
Dim arrPT : arrPT = Rhino.AddPoint (arrPoint)

Next
arrObjects = Rhino.ObjectsByType (1 , vbTrue)
' Get the filename to create
strFileName = Rhino.SaveFileName("Save Point Coordinates As", strFilter)
If IsNull(strFileName) Then Exit Sub
' Get the file system object
Set objFSO = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
' Get a new text file
Set objStream = objFSO.CreateTextFile(strFileName, True)
If Err Then
MsgBox Err.Description
Exit Sub
End If
For Each strObject In arrObjects
Dim k

k = k + 1
Dim arrPTcord : arrPTcord = Rhino.PointCoordinates (strObject)
Dim dblParam : dblParam = Rhino.CurveClosestPoint(strObj, arrPTcord)
Dim arrData : arrData = Rhino.CurveCurvature (strObj, dblParam)

strPoint = CStr(arrData(3))
' Write the coordinate to the file
objStream.WriteLine(strPoint)
Next
End If
objStream.Close

End Sub

Main

-Skylar

Monday, March 26, 2007

Smart Geometry

As discussed in class today here is a link to Smart Geometry. I found they have posted a number of the presentations online in video with slide shows to go with the speakers. You will have to create a log-in user name on Bentley's website. Also Jane do you know which presentation had the project based on the pine cone?

http://www.smartgeometry2007.com/agenda.asp


-Matt

Thursday, March 15, 2007

Thoughts

Does anyone have any suggestions on how to manipulate this script in order to make the pyramids vary in size? They currently vary slightly as the script progresses by using the "i" variable, but it doesn't seem to be creating much differentiation.

p = pyramid width:30 depth:0 height:20 widthsegs:2 depthsegs:2 heightsegs:2
convertToMesh p
for i = 1 to 20 do

(
animate on
(
at time (i * 5)
(
j = instance p pos: [0,i*10,0]
rotAngle = angleAxis (i*25) [0,1,0]
rotate j rotAngle scale j [i/5,i,i/5]
for i = 1 to getNumVerts j-8 do
(
b = pyramid width:i height:i depth:1
rotAngle = angleAxis (i*50) [0,1,0]
rotate b rotAngle
vert = getVert j i
b.pos = vert )
delete j
)
)
)
delete p

-Skylar

Monday, March 5, 2007

Another thought

Does anyone know Max msp? I heard that it is a program that can allow user interaction with sensors and physical buttons etc. It seems like a mod engine, similar to flash, but works with Max.

Also,
http://www.designboom.com/eng/funclub/apoc.html

Computational fashion design?
-skylar
I thought some of you might be interested in this link
http://www.gsd.harvard.edu/events/webcasts/
It has webcasts for a lot of lectures on some pretty intersting topics.

Over the weekend and the time that was spent experimenting on the Max script I started to realize how much more I learned from the collaborative experimenation. I think that I really learned more about Max script and the process/syntax in only a few short hours compared to all of the other tutorials. This led me to think that we could do more collaborative, open ended, experiments in class, hopefully increasing the productivity on the scripts. I also wasn't in class on Monday, due to a design site visit, so I am not sure how the rest of the experiments went, but I would guess that other people experienced a similar result. Does anyone else have thoughts on which ways they think would help enhance their ability to learn scripting?
Skylar