<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>crtl-i &#187; Search Results  &#187;  rhinoscript</title>
	<atom:link href="http://crtl-i.com/blog/?s=rhinoscript&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://crtl-i.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 29 Jun 2010 04:35:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Attracted Flows</title>
		<link>http://crtl-i.com/blog/2009/07/attracted-flows/</link>
		<comments>http://crtl-i.com/blog/2009/07/attracted-flows/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 14:01:10 +0000</pubDate>
		<dc:creator>crtl-i</dc:creator>
				<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[RhinoScript]]></category>
		<category><![CDATA[Attracted]]></category>
		<category><![CDATA[Flows]]></category>

		<guid isPermaLink="false">http://crtl-i.com/blog/?p=319</guid>
		<description><![CDATA[This is a rhinoscript where you can set various points where vectors flow out from according to a certain velocity. As these vectors travel, the flows are attracted to the various attractor points in different weights three dimensionally. It simulates a close logic to the emitted particles being attracted to newton forces in Maya. &#8212;- [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://crtl-i.com/blog/wp-content/uploads/2009/07/4a.jpg"><img class="alignnone size-full wp-image-323" title="4a" src="http://crtl-i.com/blog/wp-content/uploads/2009/07/4a.jpg" alt="4a" width="640" height="405" /></a></p>
<p><a href="http://crtl-i.com/blog/wp-content/uploads/2009/07/3a.jpg"><img class="alignnone size-full wp-image-320" title="3a" src="http://crtl-i.com/blog/wp-content/uploads/2009/07/3a.jpg" alt="3a" width="640" height="405" /></a></p>
<p>This is a rhinoscript where you can set various points where vectors flow out from according to a certain velocity. As these vectors travel, the flows are attracted to the various attractor points in different weights three dimensionally. It simulates a close logic to the emitted particles being attracted to newton forces in Maya.</p>
<p><a href="http://crtl-i.com/blog/wp-content/uploads/2009/07/11.jpg"><img class="alignnone size-full wp-image-321" title="1" src="http://crtl-i.com/blog/wp-content/uploads/2009/07/11.jpg" alt="1" width="640" height="547" /></a></p>
<p><a href="http://crtl-i.com/blog/wp-content/uploads/2009/07/2.jpg"><img class="alignnone size-full wp-image-322" title="2" src="http://crtl-i.com/blog/wp-content/uploads/2009/07/2.jpg" alt="2" width="640" height="572" /></a></p>
<p>&#8212;-</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Option Explicit</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8216;Script written by Howard Jiho Kim / crtl-i.com</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Call Main()</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Sub Main()</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Dim startPt, velocity</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>velocity = Array(10,0,0)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>startPt = Rhino.GetObjects(&#8220;Select Start Points&#8221;,1)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>&#8216;Attractors / Distances</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Dim no_attr, attr, attrStr, i</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>no_attr = Rhino.GetInteger(&#8220;How many attractors?&#8221;)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>ReDim attr(no_attr-1), attrStr(no_attr-1)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>For i=0 To no_attr-1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>attr(i) = Rhino.GetObject(&#8220;Select Attractor &#8221; &amp; (i+1),1)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>attrStr(i) = Rhino.GetReal(&#8220;Enter Strength for Attractor &#8221; &amp; (i+1))</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Next</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>For i=0 To Ubound(startPt)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Flow velocity, startPt(i), no_attr, attr, attrStr, 35</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Next</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">End Sub</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Function Flow(velocity, startPt, no_attr, attr, attrStr, gens)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Dim vec1, vec0</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>vec1 = Rhino.VectorCreate(velocity, Array(0,0,0))</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>vec0 = Rhino.VectorCreate(Rhino.PointCoordinates(startPt), Array(0,0,0))</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Dim totalDistance, distance, i</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>ReDim distance(no_attr-1)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Dim vec, finalVec, vec4, tagStop</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>tagStop = 0</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>ReDim vec(no_attr-1)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Dim newPt, newLine, endPt2</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>totalDistance=0</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>If gens&gt;0 Then</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>For i=0 To no_attr-1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>distance(i) = Rhino.Distance(Rhino.PointCoordinates(startPt), Rhino.PointCoordinates(attr(i)))</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>totalDistance = totalDistance + distance(i)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Rhino.Print distance(i)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Rhino.Print totalDistance</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>If distance(i) &lt; 1 Then</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>gens = -1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>End If</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Next</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>&#8216;Vectors</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>vec4 = vec1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>For i=0 To no_attr-1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>vec(i) = Rhino.VectorCreate(Rhino.PointCoordinates(attr(i)), Rhino.PointCoordinates(startPt))</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>vec(i) = Rhino.VectorUnitize(vec(i))</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>vec(i) = Rhino.VectorScale(vec(i), (attrStr(i)/distance(i))^2)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>vec4 = Rhino.VectorAdd(vec4, vec(i))</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Next</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>finalVec = Rhino.VectorUnitize(vec4)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>finalVec = Rhino.VectorScale(finalVec, 1)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>If tagStop = 0 Then</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>newPt = Rhino.AddPoint(finalVec)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>newLine = Rhino.AddLine(Array(0,0,0), finalVec)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>endPt2 = Rhino.MoveObject(newPt, vec0)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>newLine = Rhino.MoveObject(newLine, vec0)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>End If</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Flow velocity, endPt2, no_attr, attr, attrStr, gens-1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>End If</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1500px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">End Function</div>
<p>Option Explicit</p>
<p>&#8216;Script written by Howard Jiho Kim / crtl-i.com</p>
<p>Call Main()</p>
<p>Sub Main()</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>Dim startPt, velocity</p>
<p><span style="white-space: pre;"> </span>velocity = Array(10,0,0)</p>
<p><span style="white-space: pre;"> </span>startPt = Rhino.GetObjects(&#8220;Select Start Points&#8221;,1)</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>&#8216;Attractors / Distances</p>
<p><span style="white-space: pre;"> </span>Dim no_attr, attr, attrStr, i</p>
<p><span style="white-space: pre;"> </span>no_attr = Rhino.GetInteger(&#8220;How many attractors?&#8221;)</p>
<p><span style="white-space: pre;"> </span>ReDim attr(no_attr-1), attrStr(no_attr-1)</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>For i=0 To no_attr-1</p>
<p><span style="white-space: pre;"> </span>attr(i) = Rhino.GetObject(&#8220;Select Attractor &#8221; &amp; (i+1),1)</p>
<p><span style="white-space: pre;"> </span>attrStr(i) = Rhino.GetReal(&#8220;Enter Strength for Attractor &#8221; &amp; (i+1))</p>
<p><span style="white-space: pre;"> </span>Next</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>For i=0 To Ubound(startPt)</p>
<p><span style="white-space: pre;"> </span>Flow velocity, startPt(i), no_attr, attr, attrStr, 35</p>
<p><span style="white-space: pre;"> </span>Next</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span></p>
<p>End Sub</p>
<p>Function Flow(velocity, startPt, no_attr, attr, attrStr, gens)</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>Dim vec1, vec0</p>
<p><span style="white-space: pre;"> </span>vec1 = Rhino.VectorCreate(velocity, Array(0,0,0))</p>
<p><span style="white-space: pre;"> </span>vec0 = Rhino.VectorCreate(Rhino.PointCoordinates(startPt), Array(0,0,0))</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>Dim totalDistance, distance, i</p>
<p><span style="white-space: pre;"> </span>ReDim distance(no_attr-1)</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>Dim vec, finalVec, vec4, tagStop</p>
<p><span style="white-space: pre;"> </span>tagStop = 0</p>
<p><span style="white-space: pre;"> </span>ReDim vec(no_attr-1)</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>Dim newPt, newLine, endPt2</p>
<p><span style="white-space: pre;"> </span>totalDistance=0</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>If gens&gt;0 Then</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>For i=0 To no_attr-1</p>
<p><span style="white-space: pre;"> </span>distance(i) = Rhino.Distance(Rhino.PointCoordinates(startPt), Rhino.PointCoordinates(attr(i)))</p>
<p><span style="white-space: pre;"> </span>totalDistance = totalDistance + distance(i)</p>
<p><span style="white-space: pre;"> </span>Rhino.Print distance(i)</p>
<p><span style="white-space: pre;"> </span>Rhino.Print totalDistance</p>
<p><span style="white-space: pre;"> </span>If distance(i) &lt; 1 Then</p>
<p><span style="white-space: pre;"> </span>gens = -1</p>
<p><span style="white-space: pre;"> </span>End If</p>
<p><span style="white-space: pre;"> </span>Next</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>&#8216;Vectors</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>vec4 = vec1</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>For i=0 To no_attr-1</p>
<p><span style="white-space: pre;"> </span>vec(i) = Rhino.VectorCreate(Rhino.PointCoordinates(attr(i)), Rhino.PointCoordinates(startPt))</p>
<p><span style="white-space: pre;"> </span>vec(i) = Rhino.VectorUnitize(vec(i))</p>
<p><span style="white-space: pre;"> </span>vec(i) = Rhino.VectorScale(vec(i), (attrStr(i)/distance(i))^2)</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>vec4 = Rhino.VectorAdd(vec4, vec(i))</p>
<p><span style="white-space: pre;"> </span>Next</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>finalVec = Rhino.VectorUnitize(vec4)</p>
<p><span style="white-space: pre;"> </span>finalVec = Rhino.VectorScale(finalVec, 1)</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>If tagStop = 0 Then</p>
<p><span style="white-space: pre;"> </span>newPt = Rhino.AddPoint(finalVec)</p>
<p><span style="white-space: pre;"> </span>newLine = Rhino.AddLine(Array(0,0,0), finalVec)</p>
<p><span style="white-space: pre;"> </span>endPt2 = Rhino.MoveObject(newPt, vec0)</p>
<p><span style="white-space: pre;"> </span>newLine = Rhino.MoveObject(newLine, vec0)</p>
<p><span style="white-space: pre;"> </span>End If</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>Flow velocity, endPt2, no_attr, attr, attrStr, gens-1</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>End If</p>
<p><span style="white-space: pre;"> </span></p>
<p>End Function</p>
]]></content:encoded>
			<wfw:commentRss>http://crtl-i.com/blog/2009/07/attracted-flows/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Sources</title>
		<link>http://crtl-i.com/blog/scripts/</link>
		<comments>http://crtl-i.com/blog/scripts/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 13:36:02 +0000</pubDate>
		<dc:creator>crtl-i</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://crtl-i.com/blog/?page_id=232</guid>
		<description><![CDATA[Grasshopper Definitions Same Area Voronoi Download 3DM // Download GHX // Description &#8212;&#8212;- Two Surfaces Twisted Box Download Definition // Description . RhinoScripts Attracted Flows Download Script // Description &#8212;&#8212;- 3D Pixelate Download Script // Description &#8212;&#8212;- Polyline Network Surface Download Script // Description &#8212;&#8212;- Coordinates to Points Download Script Points to Coordinates Download Script // Description &#8212;&#8212;- Array [...]]]></description>
			<content:encoded><![CDATA[<h2><span style="color: #c0c0c0;"><span style="font-weight: normal;">Grasshopper Definitions</span></span></h2>
<p><span style="color: #ff0000;"><strong><span style="color: #000000;">Same Area Voronoi</span></strong><br />
<span style="color: #000000;"><a href="http://crtl-i.com/blog/sources/hjk_same_area_voronoi_galapagos.3dm">Download 3DM</a> // <a href="http://crtl-i.com/blog/sources/hjk_same_area_voronoi_galapagos.ghx">Download GHX</a> // <a href="http://crtl-i.com/blog/2010/06/same-area-voronoi-using-galapagos/">Description</a></span></span></p>
<p>&#8212;&#8212;-</p>
<p><span style="color: #ff0000;"><strong><span style="color: #000000;">Two Surfaces Twisted Box</span></strong><br />
<span style="color: #000000;"><a href="http://crtl-i.com/blog/wp-content/uploads/2009/02/hjk_two_surface_tbox.ghx">Download Definition</a> // <a href="http://crtl-i.com/blog/2009/09/two-surface-twisted-box/">Description</a></span></span></p>
<p><span style="color: #ffffff;">.</span></p>
<h2><span style="color: #c0c0c0;"><span style="font-weight: normal;">RhinoScripts</span></span></h2>
<p><span style="color: #ff0000;"><strong><span style="color: #000000;">Attracted Flows</span></strong><br />
<span style="color: #000000;"><a href="http://crtl-i.com/blog/wp-content/uploads/2009/02/hjk_attracted_flow.rvb">Download Script</a> // <a href="http://crtl-i.com/blog/2009/07/attracted-flows/">Description</a></span></span><br />
<strong> </strong></p>
<p>&#8212;&#8212;-</p>
<p><span style="color: #ff0000;"><strong><span style="color: #000000;">3D Pixelate</span></strong><br />
<span style="color: #000000;"><a href="http://crtl-i.com/blog/wp-content/uploads/2009/02/hjk_pixelate.rvb">Download Script</a> // <a href="http://crtl-i.com/blog/2009/06/3d-pixelate/">Description</a></span></span><br />
<strong> </strong></p>
<p>&#8212;&#8212;-</p>
<p><span style="color: #ff0000;"><strong><span style="color: #000000;">Polyline Network Surface</span></strong><br />
<span style="color: #000000;"><a href="http://crtl-i.com/blog/wp-content/uploads/2009/02/hjk_polynetworksrf.rvb">Download Script</a> // <a href="http://crtl-i.com/blog/2008/06/poly-network-surface/">Description</a></span></span><br />
<strong> </strong></p>
<p>&#8212;&#8212;-</p>
<p><strong>Coordinates to Points</strong><br />
<span style="text-decoration: underline;"><a href="http://crtl-i.com/blog/wp-content/uploads/2009/02/hjk_text_to_point.rvb">Download Script</a></span><br />
<strong> </strong></p>
<p><strong>Points to Coordinates</strong><br />
<span style="text-decoration: underline;"><a href="http://crtl-i.com/blog/wp-content/uploads/2009/02/hjk_coorinatesbasepoint.rvb">Download Script</a> </span> // <a href="http://crtl-i.com/blog/2007/11/coordinates/">Description</a></p>
<p>&#8212;&#8212;-</p>
<p><strong>Array and Orient Objects to Lines</strong><br />
<span style="text-decoration: underline;"><a href="http://crtl-i.com/blog/wp-content/uploads/2009/02/hjk_orient_to_lines.rvb">Download Script</a></span></p>
<p><strong>Array and Orient Objects based on Two Surfaces</strong><br />
<span style="text-decoration: underline;"><a href="http://crtl-i.com/blog/wp-content/uploads/2009/02/hjk_orient.rvb">Download Script</a></span> // <a href="http://crtl-i.com/blog/2008/03/arrayorient-objects-based-on-two-surfaces/">Description</a></p>
<p>&#8212;&#8212;-</p>
<p><strong>Diffuse Curve</strong><br />
<a href="http://crtl-i.com/blog/wp-content/uploads/2009/02/hjk_noise.rvb">Download Script</a> // <a href="http://crtl-i.com/blog/2009/02/diffuse-curve/">Description 1</a> // <a href="http://crtl-i.com/blog/2008/12/diffuse-noise/">Description 2</a></p>
<p><script type="text/javascript">// <![CDATA[
    google_ad_client = "pub-8453253007955637"; /* 728x90, created 7/28/09 */ google_ad_slot = "6106690488"; google_ad_width = 640; google_ad_height = 90;
// ]]&gt;</script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://crtl-i.com/blog/scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diffuse Curve</title>
		<link>http://crtl-i.com/blog/2009/02/diffuse-curve/</link>
		<comments>http://crtl-i.com/blog/2009/02/diffuse-curve/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 17:31:40 +0000</pubDate>
		<dc:creator>crtl-i</dc:creator>
				<category><![CDATA[RhinoScript]]></category>
		<category><![CDATA[curve]]></category>
		<category><![CDATA[diffuse]]></category>

		<guid isPermaLink="false">http://crtl-i.com/blog/?p=228</guid>
		<description><![CDATA[This is a RhinoScript that I wrote about a few months ago in: http://crtl-i.com/blog/2008/12/diffuse-noise/ It will take a curve and diffuse it into many curves according to a few parameters: devRate: deviation rate vecLenMax: maximum length of a particle vecLenMin: minimum length of a particle noParticle: number of total particles If vecLenMax and vecLenMin are the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a RhinoScript that I wrote about a few months ago in: <a href="http://crtl-i.com/blog/2008/12/diffuse-noise/">http://crtl-i.com/blog/2008/12/diffuse-noise/</a></p>
<p>It will take a curve and diffuse it into many curves according to a few parameters:<br />
devRate: deviation rate<br />
vecLenMax: maximum length of a particle<br />
vecLenMin: minimum length of a particle<br />
noParticle: number of total particles</p>
<p>If vecLenMax and vecLenMin are the same, all the particles will have the same length. </p>
<p>&#8212;</p>
<p>Option Explicit</p>
<p>Call Diffuse()</p>
<p> </p>
<p>Sub Diffuse()</p>
<p> </p>
<p><span> </span>Dim devRate : devRate = 0.01</p>
<p><span> </span>Dim vecLenMax : vecLenMax = 1</p>
<p><span> </span>Dim vecLenMin : vecLenMin = 3</p>
<p><span> </span>Dim noParticle : noParticle = 100</p>
<p> </p>
<p><span> </span>Dim aCrvs : aCrvs = Rhino.GetObjects(&#8220;Select Curves&#8221;, 4)</p>
<p> </p>
<p><span> </span>Dim i,n</p>
<p><span> </span>Dim aPts()</p>
<p><span> </span>Dim crvDom, crvParam, crvLen</p>
<p><span> </span></p>
<p><span> </span>Randomize</p>
<p><span> </span></p>
<p><span> </span>For i = 0 To UBound(aCrvs)</p>
<p> </p>
<p><span> </span>n = 0</p>
<p><span> </span>Dim strCrv : strCrv = aCrvs(i)</p>
<p> </p>
<p><span> </span>crvDom = Rhino.CurveDomain(strCrv)</p>
<p><span> </span>crvLen = Rhino.CurveLength(strCrv)</p>
<p> </p>
<p><span> </span>Rhino.EnableRedraw False</p>
<p> </p>
<p><span> </span>Do Until n = noParticle</p>
<p> </p>
<p><span> </span>crvParam = (RN(0.00, 1.00)) * (crvDom(1))</p>
<p> </p>
<p><span> </span>ReDim Preserve aPts(n)</p>
<p><span> </span>aPts(n) = Rhino.EvaluateCurve(strCrv, crvParam)</p>
<p><span> </span></p>
<p><span> </span>Dim devPt : devPt = aPts(n)</p>
<p><span> </span>Dim devX : devX = crvLen * devRate * RN(-1,1) + devPt(0)</p>
<p><span> </span>Dim devY : devY = crvLen * devRate * RN(-1,1) + devPt(1)</p>
<p><span> </span>Dim devZ : devZ = crvLen * devRate * RN(-1,1) + devPt(2)</p>
<p><span> </span>Dim devPt2 : devPt2 = Array(devX, devY, devZ)</p>
<p><span> </span></p>
<p><span> </span>Dim rndPt : rndPt = Array(RN(-1,1), RN(-1,1), RN(-1,1))</p>
<p><span> </span>Dim rndPt2 : rndPt2 = Rhino.PointAdd(devPt2, rndPt)</p>
<p> </p>
<p><span> </span>If n &gt;= 1 Then</p>
<p><span> </span>Dim vecDir : vecDir = Rhino.AddLine(devPt2, rndPt2)</p>
<p><span> </span>Dim vecLen : vecLen = RN(vecLenMin, vecLenMax)</p>
<p><span> </span>Dim Xform : Xform = Rhino.XformScale(devPt2, vecLen)</p>
<p><span> </span></p>
<p><span> </span>Rhino.TransformObject vecDir, Xform, True</p>
<p><span> </span>End If</p>
<p> </p>
<p><span> </span>n = n + 1</p>
<p> </p>
<p><span> </span>Loop</p>
<p> </p>
<p><span> </span>Rhino.EnableRedraw True</p>
<p><span> </span>Next</p>
<p>End Sub</p>
<p> </p>
<p>Function RN (nMin, nMax)</p>
<p><span> </span>RN = Null</p>
<p><span> </span>Randomize</p>
<p><span> </span>RN = (nMax &#8211; nMin) * Rnd + nMin</p>
<p>End Function</p>
]]></content:encoded>
			<wfw:commentRss>http://crtl-i.com/blog/2009/02/diffuse-curve/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Array/Orient Objects based on Two Surfaces</title>
		<link>http://crtl-i.com/blog/2008/03/arrayorient-objects-based-on-two-surfaces/</link>
		<comments>http://crtl-i.com/blog/2008/03/arrayorient-objects-based-on-two-surfaces/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 06:02:20 +0000</pubDate>
		<dc:creator>crtl-i</dc:creator>
				<category><![CDATA[Patterns]]></category>
		<category><![CDATA[RhinoScript]]></category>
		<category><![CDATA[Orient]]></category>
		<category><![CDATA[Surfaces]]></category>
		<category><![CDATA[two]]></category>

		<guid isPermaLink="false">http://crtl-i.com/blog/?p=115</guid>
		<description><![CDATA[I&#8217;ve been trying to explore more with Rhino Explicit History and also with RhinoScript. Here&#8217;s a simple one that arrays basic object onto a surface and orients them to a target surface. It doesn&#8217;t deform the base object in any ways. It could be a useful tool in trying to create gradient patterns using just [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://crtl-i.com/blog/wp-content/uploads/2008/03/orient1.jpg"><img src="http://crtl-i.com/blog/wp-content/uploads/2008/03/orient1.jpg" /></a></p>
<p><a href="http://crtl-i.com/blog/wp-content/uploads/2008/03/orient1b.jpg"><img src="http://crtl-i.com/blog/wp-content/uploads/2008/03/orient1b.jpg" /></a></p>
<p><a href="http://crtl-i.com/blog/wp-content/uploads/2008/03/orient2.jpg"><img src="http://crtl-i.com/blog/wp-content/uploads/2008/03/orient2.jpg" /></a></p>
<p>I&#8217;ve been trying to explore more with Rhino Explicit History and also with RhinoScript. Here&#8217;s a simple one that arrays basic object onto a surface and orients them to a target surface. It doesn&#8217;t deform the base object in any ways. It could be a useful tool in trying to create gradient patterns using just rotations without changing the shape of the basic components (so the fabrication process is more efficient). RhinoScript is still quite new to me. I started with the Honeycomb script that Andrew Kudless wrote few years ago. The code still needs to be more optimized and cleaned up. But, the code works nonetheless.</p>
<p>&#8212;-</p>
<p>Option Explicit<br />
&#8216;by Andrew Kudless | <a href="mailto:andrew@materialsystems.org" target="_blank">andrew@materialsystems.org</a> | april, 2005<br />
&#8216;Edited by <span class="nfakPe">Howard</span> Jiho Kim | <a href="mailto:kimjiho@gmail.com" target="_blank">kimjiho@gmail.com</a> | March, 2008</p>
<p>Sub OrientObjTwoSurfaces()</p>
<p>Dim orientObj<br />
Dim orientPoint(2)</p>
<p>Dim sourceSurf, sourceSurf2<br />
Dim uDiv, vDiv, maxDiv<br />
Dim uArray, vArray<br />
Dim i,j, index</p>
<p>&#8216;surface 1 variables<br />
Dim uMax, vMax<br />
Dim uInc, vInc<br />
Dim uStart, vStart</p>
<p>&#8216;surface 2 variables<br />
Dim u2Max, v2Max<br />
Dim u2Inc, v2Inc<br />
Dim u2Start, v2Start</p>
<p>&#8216;surface points variables<br />
Dim arrParam(1), arr2Param(1), arrPoint, arr2Point<br />
Dim surface1Points(), surface2Points()</p>
<p>&#8216;Rhino.EnableRedraw vbFalse</p>
<p>orientObj = Rhino.GetObject (&#8220;Select the Object to Orient&#8221;)<br />
If IsNull(orientObj) Then Exit Sub</p>
<p>orientPoint(0) = Rhino.GetPoint(&#8220;Select Point 1 to Orient&#8221;)<br />
If IsNull(orientPoint(0)) Then Exit Sub<br />
orientPoint(1) = Rhino.GetPoint(&#8220;Select Point 2 to Orient&#8221;)<br />
If IsNull(orientPoint(1)) Then Exit Sub<br />
orientPoint(2) = Rhino.GetPoint(&#8220;Select Point 3 to Orient&#8221;)<br />
If IsNull(orientPoint(2)) Then Exit Sub</p>
<p>uDiv = Rhino.GetInteger (&#8220;Enter the number of divisions in the U direction&#8221;)<br />
If IsNull(uDiv) Then Exit Sub</p>
<p>vDiv = Rhino.GetInteger (&#8220;Enter the number of divisions in the V direction&#8221;)<br />
If IsNull(vDiv) Then Exit Sub</p>
<p>&#8216;Get inputs<br />
sourceSurf = Rhino.GetObject (&#8220;Select the base Surface&#8221;, 8)<br />
If IsNull(sourceSurf) Then Exit Sub</p>
<p>&#8216;Get inputs<br />
sourceSurf2 = Rhino.GetObject (&#8220;Select a target Surface&#8221;, 8)<br />
If IsNull(sourceSurf2) Then Exit Sub</p>
<p>ReDim uVal(uDiv)<br />
ReDim vVal(vDiv)</p>
<p>ReDim u2Val(uDiv)<br />
ReDim v2Val(vDiv)</p>
<p>uMax = Rhino.SurfaceDomain (sourceSurf, 0)<br />
vMax = Rhino.SurfaceDomain (sourceSurf, 1)</p>
<p>uInc = uMax(1)/uDiv<br />
vInc = vMax(1)/vDiv</p>
<p>For i = 0 To uDiv<br />
uVal(i) = i * uInc<br />
Rhino.Print &#8220;uVal(&#8221; &amp; i &amp; &#8220;):&#8221; &amp; uVal(i)</p>
<p>Next</p>
<p>For i = 0 To vDiv<br />
vVal(i) = i * vInc<br />
Rhino.Print &#8220;vVal(&#8221; &amp; i &amp; &#8220;):&#8221; &amp; vVal(i)<br />
Next</p>
<p>u2Max = Rhino.SurfaceDomain (sourceSurf2, 0)<br />
v2Max = Rhino.SurfaceDomain (sourceSurf2, 1)</p>
<p>u2Inc = u2Max(1)/uDiv<br />
v2Inc = v2Max(1)/vDiv</p>
<p>For i = 0 To uDiv<br />
u2Val(i) = i * u2Inc<br />
Rhino.Print &#8220;u2Val(&#8221; &amp; i &amp; &#8220;):&#8221; &amp; u2Val(i)<br />
Next</p>
<p>For i = 0 To vDiv<br />
v2Val(i) = i * v2Inc<br />
Rhino.Print &#8220;v2Val(&#8221; &amp; i &amp; &#8220;):&#8221; &amp; v2Val(i)<br />
Next</p>
<p>Rhino.Print &#8220;Calculating Array&#8230;&#8221;</p>
<p>&#8216;Find which direction has more points<br />
If uDiv &gt;= vDiv Then<br />
maxDiv = uDiv<br />
Else<br />
maxDiv = vDiv<br />
End If</p>
<p>&#8216;ARRAY POINS on SURFACE1<br />
Dim targetPoint(2)<br />
Dim p1, arrVector, NewLine, NewLine2, line1, line2, line3, arrXform<br />
Dim arrPlane, arrRotated</p>
<p>For i=0 To uDiv</p>
<p>For j=0 To vDiv<br />
arrParam(0) = uVal(i)<br />
arrParam(1) = vVal(j)<br />
arrPoint = Rhino.EvaluateSurface(sourceSurf, arrParam)<br />
line1 = Rhino.AddPoint(arrPoint)<br />
targetPoint(0) = Rhino.PointCoordinates(line1)</p>
<p>arr2Param(0) = uVal(i)<br />
arr2Param(1) = vVal(j)<br />
arr2Point = Rhino.EvaluateSurface(sourceSurf2, arr2Param)<br />
line2 = Rhino.AddPoint(arr2Point)<br />
targetPoint(2) = Rhino.PointCoordinates(line2)</p>
<p>NewLine = Rhino.AddLine (arrPoint, arr2Point)</p>
<p>arrVector = Rhino.VectorCreate(arr2Point, arrPoint)<br />
Rhino.ViewCPlane , Rhino.PlaneFromNormal(arrPoint, arrVector)</p>
<p>arrPlane = ViewCPlane<br />
arrRotated = RotatePlane(arrPlane, 90, arrPlane(1))<br />
Rhino.ViewCPlane , arrRotated</p>
<p>arrPlane = ViewCPlane</p>
<p>NewLine2 = Rhino.RotateObject(NewLine, arrPlane(0), 90.0, ,True)</p>
<p>arrPoint = Rhino.CurveEndPoint(NewLine2)<br />
line3 = Rhino.AddPoint(arrPoint)<br />
targetPoint(1) = Rhino.PointCoordinates(line3)</p>
<p>If IsArray(orientPoint) Then<br />
If IsArray(targetPoint) Then<br />
Rhino.OrientObject orientObj, orientPoint, targetPoint, 1<br />
End If<br />
End If</p>
<p>Rhino.DeleteObject (line1)<br />
Rhino.DeleteObject (line2)<br />
Rhino.DeleteObject (line3)<br />
&#8216;Rhino.DeleteObject (NewLine)<br />
Rhino.DeleteObject (NewLine2)</p>
<p>Next<br />
Next</p>
<p>&#8216;Rhino.EnableRedraw vbTrue<br />
End Sub</p>
<p>OrientObjTwoSurfaces<br />
Rhino.Print &#8220;Array Complete&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://crtl-i.com/blog/2008/03/arrayorient-objects-based-on-two-surfaces/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>coordinates</title>
		<link>http://crtl-i.com/blog/2007/11/coordinates/</link>
		<comments>http://crtl-i.com/blog/2007/11/coordinates/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 17:12:22 +0000</pubDate>
		<dc:creator>crtl-i</dc:creator>
				<category><![CDATA[RhinoScript]]></category>
		<category><![CDATA[coordinates]]></category>

		<guid isPermaLink="false">http://crtl-i.com/blog/?p=19</guid>
		<description><![CDATA[If the tower you&#8217;re designing is super curvy and if none of your floor plates are shaped the same, it becomes really hard to transfer the geometry into construction. One of the most basic information that the builders need is coordinates from different areas of the building. The more organic the design, the more points [...]]]></description>
			<content:encoded><![CDATA[<p>If the tower you&#8217;re designing is super curvy and if none of your floor plates are shaped the same, it becomes really hard to transfer the geometry into construction. One of the most basic information that the builders need is coordinates from different areas of the building. The more organic the design, the more points you&#8217;ll have to provide them in order for the actual structure to come close to what you designed. aka. This can take forever.</p>
<p>So here&#8217;s a little script that will do this for you. This is actually the first rhinoscript I wrote :P  First it&#8217;ll ask you to choose a base point. The coordinates of the other points will be calculated using the base point as (0,0,0).</p>
<p><img src="http://crtl-i.com/blog/wp-content/uploads/2007/11/coordinate_basepoint.jpg" alt="BasePointCoordinates" /></p>
<p>Sub CoordinatesBasePoint</p>
<p>Dim baseObject<br />
baseObject = Rhino.GetPoint(&#8220;Select base point to be set as (0,0,0)&#8221;)<br />
If IsNull(baseObject) Then Exit Sub</p>
<p>Dim arrObjects<br />
arrObjects = Rhino.GetObjects(&#8220;Select points to calculate coordinates&#8221;, 1, True, True)<br />
If Not IsArray(arrObjects) Then Exit Sub</p>
<p>Dim arrPoint0, arrVector, arrPoint3<br />
arrPoint0 = Array(0,0,0)<br />
arrVector = Rhino.VectorCreate(baseObject, arrPoint0)</p>
<p>Dim strObject, arrPoint, arrPoint2<br />
For Each strObject In arrObjects<br />
arrPoint = Rhino.PointCoordinates(strObject)<br />
arrPoint2 = Rhino.PointSubtract(arrPoint, arrVector)<br />
Rhino.AddTextDot Rhino.Pt2Str(arrPoint2, 3), arrPoint<br />
Next</p>
<p>End Sub</p>
<p>CoordinatesBasePoint</p>
]]></content:encoded>
			<wfw:commentRss>http://crtl-i.com/blog/2007/11/coordinates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Links</title>
		<link>http://crtl-i.com/blog/links/</link>
		<comments>http://crtl-i.com/blog/links/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 21:16:24 +0000</pubDate>
		<dc:creator>crtl-i</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://crtl-i.com/blog/?page_id=8</guid>
		<description><![CDATA[These are mainly for my own chaotic use. &#8212;&#8211; http://www.byrhino3d.com http://plusplastic.com http://wieandpartners.com http://dkstudio.sejong.ac.kr http://reprap.org http://vimeo.com/rhino http://decked.ning.com http://rhinofab.com &#8212;&#8211; http://blog.algorithmicdesign.net/tutorials/cellular-automata http://pruned.blogspot.com/2009/09/avian-turners.html http://boiteaoutils.blogspot.com/2009/08/symbiosis-hood-by-r.html http://www.new-territories.com/siymbiosishood.htm http://www.cdnarchitect.com/asf/principles_of_enclosure/enclosure_typologies/enclosure_typologies.htm http://spacesymmetrystructure.wordpress.com/rheotomic-surfaces/ http://www.designboom.com/weblog/cat/16/view/6609/rob-ley-and-joshua-stein-reef.html http://sac3.blogspot.com http://rhinos.co.kr http://popabczhang.blogspot.com &#8212;&#8211; 2008 / 6 / 14 &#8211; 2009 / 6 / 26 ynotwhy.com rhinoscriptingresources.blogspot.com uli-s.spaces.live.com/blog markuskison.de people.bath.ac.uk/abscjkw andreagraziano.blogspot.com designemergente.org mediartchina.org proxyarch.com/wiki/index.php?title=Helpful_mel_commands grasshopper.rhino3d.com themakingofcloud9projects.com blog.booksforce.com dataisnature.com ted.com/index.php/talks/view/id/27 gernot.xarch.at [...]]]></description>
			<content:encoded><![CDATA[<p>These are mainly for my own chaotic use.</p>
<p>&#8212;&#8211;</p>
<p><a href="http://www.byrhino3d.com/">http://www.byrhino3d.com</a></p>
<p><a href="http://plusplastic.com/">http://plusplastic.com</a></p>
<p><a href="http://wieandpartners.com/">http://wieandpartners.com</a></p>
<p><a href="http://dkstudio.sejong.ac.kr/">http://dkstudio.sejong.ac.kr</a></p>
<p><a href="http://reprap.org">http://reprap.org</a></p>
<p><a href="http://vimeo.com/rhino">http://vimeo.com/rhino</a></p>
<p><a href="http://decked.ning.com/">http://decked.ning.com</a></p>
<p><a href="http://rhinofab.com">http://rhinofab.com</a></p>
<p>&#8212;&#8211;</p>
<p><a href="http://blog.algorithmicdesign.net/tutorials/cellular-automata">http://blog.algorithmicdesign.net/tutorials/cellular-automata</a></p>
<p><a href="http://pruned.blogspot.com/2009/09/avian-turners.html">http://pruned.blogspot.com/2009/09/avian-turners.html</a></p>
<p><a href="http://boiteaoutils.blogspot.com/2009/08/symbiosis-hood-by-r.html">http://boiteaoutils.blogspot.com/2009/08/symbiosis-hood-by-r.html</a></p>
<p><a href="http://www.new-territories.com/siymbiosishood.htm">http://www.new-territories.com/siymbiosishood.htm</a></p>
<p><a href="http://www.cdnarchitect.com/asf/principles_of_enclosure/enclosure_typologies/enclosure_typologies.htm">http://www.cdnarchitect.com/asf/principles_of_enclosure/enclosure_typologies/enclosure_typologies.htm</a></p>
<p><a href="http://spacesymmetrystructure.wordpress.com/rheotomic-surfaces/">http://spacesymmetrystructure.wordpress.com/rheotomic-surfaces/</a></p>
<p><a href="http://www.designboom.com/weblog/cat/16/view/6609/rob-ley-and-joshua-stein-reef.html">http://www.designboom.com/weblog/cat/16/view/6609/rob-ley-and-joshua-stein-reef.html</a></p>
<p><a href="http://sac3.blogspot.com">http://sac3.blogspot.com</a></p>
<p><a href="http://rhinos.co.kr/">http://rhinos.co.kr</a></p>
<p><a href="http://popabczhang.blogspot.com/">http://popabczhang.blogspot.com</a></p>
<p>&#8212;&#8211;</p>
<p><strong>2008 / 6 / 14 &#8211; 2009 / 6 / 26</strong></p>
<p><a href="http://ynotwhy.com">ynotwhy.com</a></p>
<p><a href="http://rhinoscriptingresources.blogspot.com/">rhinoscriptingresources.blogspot.com</a></p>
<p><a href="http://uli-s.spaces.live.com/blog/">uli-s.spaces.live.com/blog</a></p>
<p><a href="http://www.markuskison.de/">markuskison.de</a></p>
<p><a href="http://people.bath.ac.uk/abscjkw/">people.bath.ac.uk/abscjkw</a></p>
<p><a href="http://andreagraziano.blogspot.com/">andreagraziano.blogspot.com</a></p>
<p><a href="http://www.designemergente.org/">designemergente.org</a></p>
<p><a href="http://www.mediartchina.org">mediartchina.org</a></p>
<p><a href="http://www.proxyarch.com/wiki/index.php?title=Helpful_mel_commands">proxyarch.com/wiki/index.php?title=Helpful_mel_commands</a></p>
<p><a href="http://grasshopper.rhino3d.com/">grasshopper.rhino3d.com</a></p>
<p><a href="http://themakingofcloud9projects.com/">themakingofcloud9projects.com</a></p>
<p><a href="http://blog.booksforce.com/">blog.booksforce.com</a></p>
<p><a href="http://www.dataisnature.com/">dataisnature.com</a></p>
<p><a href="http://www.ted.com/index.php/talks/view/id/27">ted.com/index.php/talks/view/id/27</a></p>
<p><a href="http://gernot.xarch.at/index.html">gernot.xarch.at</a></p>
<p><a href="http://www.chrisjordan.com/current_set2.php?id=7">chrisjordan.com/current_set2.php?id=7</a></p>
<p><a href="http://www.plantsci.cam.ac.uk/Haseloff/imaging/CellArchitecture/page48/page10/index.html">plantsci.cam.ac.uk/Haseloff/imaging/CellArchitecture</a></p>
<p><a href="http://www.moma.org/exhibitions/2008/elasticmind/">moma.org/exhibitions/2008/elasticmind/</a></p>
<p><a href="http://www.s-m-i-t.com/">s-m-i-t.com</a></p>
<p><a href="http://www.systemicprocess.com/">systemicprocess.com</a></p>
<p><a href="http://www.alavs.com/">alavs.com</a></p>
<p><a href="http://nsystemlab.com/">nsystemlab.com</a></p>
<p><a href="http://madeincalifornia.blogspot.com/">madeincalifornia.blogspot.com</a></p>
<p><a href="http://drawnline.net/">drawnline.net</a></p>
<p><a href="http://wright20.com/events/levy/">wright20.com/events/levy</a></p>
<p><a href="http://www.digit-all.net/">digit-all.net</a></p>
<p>&#8212;&#8211;</p>
<p><strong>BEFORE 2008 / 6 / 14</strong></p>
<p><a href="http://robotic-ecologies.blogspot.com">robotic-ecologies.blogspot.com</a></p>
<p><a href="http://structuringmedia.blogspot.com">structuringmedia.blogspot.com</a><a href="http://structuringmedia.blogspot.com"><br />
</a></p>
<p><a href="http://www.sojamo.de/blog">sojamo.de/blog</a></p>
<p><a href="http://www.hyperthesis.com">hyperthesis.com<br />
</a><br />
<a href="http://i-mad.com">i-mad.com</a><a href="http://i-mad.com"><br />
</a></p>
<p><a href="http://theverymany.net">theverymany.net</a><a href="http://theverymany.net"><br />
</a></p>
<p><a href="http://processing.org">processing.org</a><a href="http://processing.org"><br />
</a></p>
<p><a href="http://www.mit.edu/~snavely/rhinoscripting/">mit.edu/~snavely/rhinoscripting</a><a href="http://www.mit.edu/~snavely/rhinoscripting/"><br />
</a></p>
<p><a href="http://reconstructivism.net">reconstructivism.net</a></p>
<p><a href="http://materialsystems.org">materialsystems.org</a></p>
<p><a href="http://m-any.org">m-any.org</a></p>
<p><a href="http://infosthetics.com/">infosthetics.com</a></p>
<p><a href="http://www.yannarthusbertrand.com/yann2/affichage.php?reference=083&amp;pais=Argentine">yannarthusbertrand.com/yann2/affichage.php?reference=083&amp;pais=Argentine</a></p>
<p><a href="http://www.mrgd.co.uk/">mrgd.co.uk</a></p>
<p><a href="http://www.metaphys.jp">metaphys.jp</a></p>
<p><a href="http://cspacepavilion.blogspot.com">cspacepavilion.blogspot.com</a></p>
<p><a href="http://destech.mit.edu/akilian">destech.mit.edu/akilian</a></p>
<p><a href="http://tigoe.net/">tigoe.net</a></p>
<p><a href="http://www.pyrofersprojects.com/blog/">pyrofersprojects.com/blog</a></p>
<p><a href="http://www.sparkfun.com">sparkfun.com</a></p>
<p><a href="http://www.glitchbuster.com/wallwart.htm">glitchbuster.com/wallwart.htm</a></p>
<p><a href="http://robotics.wizard.com.hk/index-e.html">robotics.wizard.com.hk/index-e.html</a></p>
<p><a href="http://blog.maxray.net">blog.maxray.net</a></p>
<p><a href="http://www.kxcad.net/Rhinoceros/RhinoScript/">kxcad.net/Rhinoceros/RhinoScript</a></p>
<p><a href="http://www.csidata.com/custserv/onlinehelp/VBSdocs/VBSTOC.htm">csidata.com/custserv/onlinehelp/VBSdocs/VBSTOC.htm</a></p>
<p><a href="http://squ1.com">squ1.com</a></p>
<p><a href="http://www.tobesch.de/">tobesch.de</a></p>
<p><a href="http://physbam.stanford.edu/~fedkiw/">physbam.stanford.edu/~fedkiw</a></p>
<p><a href="http://www.qhull.org/">qhull.org</a></p>
<p><a href="http://data-tribe.net/wework4her/">data-tribe.net/wework4her</a></p>
<p><a href="http://area.autodesk.com/index.php/blogs_duncan/blog_list/">area.autodesk.com/index.php/blogs_duncan/blog_list</a></p>
<p><a href="http://wiki.caad.arch.ethz.ch/Education/MAS">wiki.caad.arch.ethz.ch/Education/MAS</a></p>
<p><a href="http://www.kokkugia.com/wiki/index.php5?title=Swarm_intelligence_2008_spring_sci-arc">kokkugia.com/wiki/index.php5?title=Swarm_intelligence_2008_spring_sci-arc</a></p>
<p><a href="http://www.commonwealth.nu">commonwealth.nu</a></p>
<p><a href="http://www.tsplines.com">tsplines.com</a></p>
<p><a href="http://www.maedastudio.com">maedastudio.com</a></p>
<p><a href="http://www.kokkugia.com/">kokkugia.com</a></p>
<p><a href="http://ffffound.com/">ffffound.com</a></p>
<p><a href="http://www.artcom.de">artcom.de</a></p>
<p><a href="http://www.emanate.org/">emanate.org</a></p>
<p><a href="http://local.wasp.uwa.edu.au/~pbourke/surfaces_curves/">local.wasp.uwa.edu.au/~pbourke/surfaces_curves</a></p>
<p><a href="http://www.flight404.com/blog/">flight404.com/blog</a></p>
<p><a href="http://www.fluent.com/software/fluent">fluent.com/software/fluent</a></p>
<p><a href="http://www.brettsteele.net/">brettsteele.net</a></p>
<p><a href="http://destech.mit.edu/akilian">destech.mit.edu/akilian</a></p>
<p><a href="http://architettura.supereva.com/files/20070206/index.htm">architettura.supereva.com/files/20070206/index.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://crtl-i.com/blog/links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
