<?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>@improved &#187; programming</title>
	<atom:link href="http://improved.ro/blog/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://improved.ro/blog</link>
	<description>[a,e]</description>
	<lastBuildDate>Fri, 09 Dec 2011 16:06:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>3d Voronoi in grasshopper</title>
		<link>http://improved.ro/blog/2009/05/3d-voronoi-in-grasshopper/</link>
		<comments>http://improved.ro/blog/2009/05/3d-voronoi-in-grasshopper/#comments</comments>
		<pubDate>Fri, 01 May 2009 20:48:24 +0000</pubDate>
		<dc:creator>Dimitrie Andrei Stefanescu</dc:creator>
				<category><![CDATA[grasshopper]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[arhitectura]]></category>
		<category><![CDATA[computational]]></category>
		<category><![CDATA[computational architecture]]></category>
		<category><![CDATA[dimitrie]]></category>
		<category><![CDATA[geometry]]></category>
		<category><![CDATA[parametric]]></category>
		<category><![CDATA[parametric architecture]]></category>
		<category><![CDATA[parametric modelling]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[qhull]]></category>
		<category><![CDATA[rhino]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[voronoi]]></category>

		<guid isPermaLink="false">http://dimitrie.wordpress.com/?p=394</guid>
		<description><![CDATA[Deprecated. Here&#8217;s the new version. More as a scripting experiment, when i was mucking about trying to make the delaunay triangulation work in grasshopper i somehow found the wonderfully complex qhull library which i promptly set to push and pull to get it to work with grasshopper. As advised on their website, the best way [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dimitrie.files.wordpress.com/2009/05/header-copy.jpg"><img class="alignnone size-full wp-image-395" title="3d voronoi qhull dimitrie stefanescu" src="http://dimitrie.files.wordpress.com/2009/05/header-copy.jpg" alt="3d voronoi qhull dimitrie stefanescu" width="500" height="330" /></a></p>
<h1><span style="color: #ff0000;">Deprecated. <a href="http://improved.ro/blog/2011/06/gh-3d-voronoi-for-grasshopper-update/">Here&#8217;s the new version</a></span>.</h1>
<p>More as a scripting experiment, when i was mucking about trying to make the<a href="http://dimitrie.wordpress.com/2009/04/15/delaunay-triangulation-in-grasshopper/"> delaunay triangulation</a> work in grasshopper i somehow found the wonderfully complex <a href="http://qhull.org">qhull</a> library which i promptly set to push and pull to get it to work with grasshopper. As advised on their website, the best way to do it is to call it as an external program, which is exactly what i&#8217;ve done:  no files are written or read, no dos windows pop up, everything&#8217;s smooth.</p>
<p>Given that you don&#8217;t have many complex operations in grasshopper after the solution is generated, you&#8217;ll be able to handle <em>quite </em>an impressive amount of points (say 200 on my three-year old toplap) in real time. If you add the simple planarSrf operation, then say 60-70 and it gets sloppy.</p>
<p>What you&#8217;ll need to do to get things rolling:</p>
<p>0. <a href="http://improved.ro/Grasshopper/qhull.zip">Download the 3dvqhull definition and example file</a>, and remember not to use it for commercial purposes, share-alike whatever you do with it and take the time to give the proper credits:  <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" target="_blank"><img class="alignnone" title="licence" src="http://i.creativecommons.org/l/by-nc-sa/3.0/us/80x15.png" alt="" width="80" height="15" /></a> <img src='http://improved.ro/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>1. <a href="http://www.qhull.org/download/qhull-2003.1.zip">Download qhull</a>, and unzip it in a folder of your choice.</p>
<p>2. Get going and search for &#8220;System.dll&#8221;. What you&#8217;re interested in is the 2.0 version which you&#8217;ll usually find in here: &#8220;C:\WINDOWS\Microsoft.NET\Framework\v2.0.5[...]\&#8221;. If you can&#8217;t find it, I&#8217;m amazed grasshopper works for you. Anyway, you can find and install it from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&amp;displaylang=en" target="_blank">here</a>.</p>
<p>3. Add the newly found System.dll version 2.o as a referenced assembly of the qhull component in the definition file.<a href="http://dimitrie.files.wordpress.com/2009/05/refass.jpg"><img class="alignnone size-full wp-image-396" title="refass" src="http://dimitrie.files.wordpress.com/2009/05/refass.jpg" alt="refass" width="500" height="323" /></a></p>
<p>If it turns orange, it&#8217;s cool.</p>
<p>4. Write in the panel that is linked to the &#8220;path&#8221; input the full path to the qhull program <em>qvoronoi</em>. You don&#8217;t need to add the .exe extension, but you can do it if you feel confortable.</p>
<p><a href="http://dimitrie.files.wordpress.com/2009/05/pathh.jpg"><img class="alignnone size-full wp-image-397" title="pathh" src="http://dimitrie.files.wordpress.com/2009/05/pathh.jpg" alt="pathh" width="500" height="323" /></a></p>
<p>5. There&#8217;s just one more thing you should know: facets that contain the infinite vertex are omitted altogether, without remorse. So as to have as little facets tending towards <em>infinitum</em>, I always add the corners of the points bounding box to the input sites.</p>
<p><a href="http://dimitrie.files.wordpress.com/2009/05/bbx.jpg"><img class="alignnone size-full wp-image-398" title="bbx" src="http://dimitrie.files.wordpress.com/2009/05/bbx.jpg" alt="bbx" width="500" height="323" /></a></p>
<p>You can scale the bounding box in respect with its center, or you can just call the whole thing off &#8211; it&#8217;s your choice.</p>
<p>I think this just about covers everything. Take care and have fun.</p>
<h6><em>didi out.</em></h6>
<p><em>PS: Qhull does more than voronoi. So if you have the time to explore and test, please do &#8211; the package is very powerfull and it can be used for more than this.<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://improved.ro/blog/2009/05/3d-voronoi-in-grasshopper/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>Qhull+GH=love.</title>
		<link>http://improved.ro/blog/2009/04/qhullghlove/</link>
		<comments>http://improved.ro/blog/2009/04/qhullghlove/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 19:45:52 +0000</pubDate>
		<dc:creator>Dimitrie Andrei Stefanescu</dc:creator>
				<category><![CDATA[grasshopper]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rhino]]></category>
		<category><![CDATA[voronoi]]></category>

		<guid isPermaLink="false">http://dimitrie.wordpress.com/?p=389</guid>
		<description><![CDATA[How about 60 points for real-time 3d voronoi manipulation in grasshopper? Here&#8217;s a screenshot: This isn&#8217;t a scam. Stay tuned for more free voronoi PrOn (and other qhull-enabled goodies.)]]></description>
			<content:encoded><![CDATA[<p><a href="http://dimitrie.files.wordpress.com/2009/04/qhull-copy.jpg"><img class="alignnone size-full wp-image-390" title="qhull-copy" src="http://dimitrie.files.wordpress.com/2009/04/qhull-copy.jpg" alt="qhull-copy" width="500" height="129" /></a></p>
<p>How about 60 points for real-time 3d voronoi manipulation in <a href="http://grasshopper.rhino3d.com/">grasshopper</a>?</p>
<p>Here&#8217;s a screenshot:</p>
<p><a href="http://dimitrie.files.wordpress.com/2009/04/screenshot.jpg"><img class="alignnone size-full wp-image-391" title="screenshot" src="http://dimitrie.files.wordpress.com/2009/04/screenshot.jpg" alt="screenshot" width="500" height="195" /></a></p>
<p>This isn&#8217;t a scam. Stay tuned for more free voronoi PrOn (and other <a href="http://www.qhull.org/">qhull</a>-enabled goodies.)</p>
]]></content:encoded>
			<wfw:commentRss>http://improved.ro/blog/2009/04/qhullghlove/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Grashopper attractors working on curves</title>
		<link>http://improved.ro/blog/2008/11/grashopper-attractors-working-on-curves/</link>
		<comments>http://improved.ro/blog/2008/11/grashopper-attractors-working-on-curves/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 19:36:52 +0000</pubDate>
		<dc:creator>Dimitrie Andrei Stefanescu</dc:creator>
				<category><![CDATA[grasshopper]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[dimitrie]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[grashopper]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rhino]]></category>
		<category><![CDATA[stefanescu]]></category>

		<guid isPermaLink="false">http://dimitrie.wordpress.com/?p=245</guid>
		<description><![CDATA[UPDATED HERE! Having some more haha with the previous grashopper sketch, this time working on curves. This is intended in some sort of terrain manipulation for the ongoing project &#8211; too bad things started shaping like some sort of electrical field/strange attractor (it has nothing to do with the above, the similarity is purely formal). [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dimitrie.wordpress.com/2009/02/16/multiple-attractors-revisited/"><span style="color:#ff0000;"><strong>UPDATED HERE!</strong></span></a></p>
<p>Having some more haha with the <a href="http://dimitrie.wordpress.com/2008/11/02/grasshopper-multiple-attractors/" target="_blank">previous</a> <a href="http://groups.google.com/group/grasshopper3d" target="_blank">grashopper </a>sketch, this time working on curves.</p>
<p><a href="http://dimitrie.files.wordpress.com/2008/11/multattcrv.jpg"><img class="alignnone size-full wp-image-246" title="multattcrv" src="http://dimitrie.files.wordpress.com/2008/11/multattcrv.jpg" alt="multattcrv" width="500" height="385" /></a></p>
<p>This is intended in some sort of terrain manipulation for the <a href="http://dimitrie.wordpress.com/2008/10/29/strips/">ongoing project</a> &#8211; too bad things started shaping like some sort of electrical field/strange attractor (it has nothing to do with the above, the similarity is purely formal).</p>
<p><img class="size-full wp-image-247 alignnone" title="multattcrv2" src="http://dimitrie.files.wordpress.com/2008/11/multattcrv2.jpg" alt="multattcrv2" width="500" height="410" /></p>
<p><a href="http://www.improved.ro/Grasshopper/massMultipleAttractorsCRVS_F.ghx">Download the .ghx file here.</a> (right click, save target as)</p>
<p>Also there&#8217;s a bug in the code &#8211; something&#8217;s not working right. Initial attractors seem to have much more power than the latter. Maybe someone that takes a fresh look over the code could <a href="mailto:didi@improved.ro">point out my mistakes</a>.</p>
<p><a href="http://dimitrie.files.wordpress.com/2008/11/sk.jpg"><img class="alignnone size-full wp-image-248" title="sk" src="http://dimitrie.files.wordpress.com/2008/11/sk.jpg" alt="sk" width="500" height="282" /></a></p>
<p>&#8211; LATER EDIT &#8211;</p>
<p>There seems to be also a little glitch in provding the code for curve_gen scripting node, so here it is (copy and paste it):</p>
<div><span><em>y = int(y)</em></span></div>
<div><span><em> </em></span></div>
<div><span><em> Dim pt As on3dPoint</em></span></div>
<div><span><em> Dim i As Double </em></span></div>
<div><span><em> i = -1</em></span></div>
<div><span><em> </em></span></div>
<div><span><em> Dim crvs As New List(Of onNurbsCurve)</em></span></div>
<div><span><em> </em></span></div>
<div><span><em> &#8216;Dim arr As New List (Of on3dPoint)</em></span></div>
<div><span><em> </em></span></div>
<div><span><em> Dim crvarr() As On3dPoint</em></span></div>
<div><span><em> ReDim crvarr(y)</em></span></div>
<div><span><em> </em></span></div>
<div><span><em> For Each pt In x</em></span></div>
<div><span><em> i = i + 1</em></span></div>
<div><span><em> crvarr(i) = pt</em></span></div>
<div><span><em> </em></span></div>
<div><span><em> If (i Mod (y) = 0) And (i &lt;&gt; 0) Then</em></span></div>
<div><span><em> Dim crvv As New OnNurbsCurve</em></span></div>
<div><span><em> crvv.</em><em>CreateClampedUniformNurbs(3, 4, crvarr)</em></span></div>
<div><span><em> crvs.Add(crvv)</em></span></div>
<div><span><em> Print(&#8220;curveout &#8221; + CStr(crvs.Count))</em></span></div>
<div><span><em> ReDim crvarr(y)</em></span></div>
<div><span><em> i = -1</em></span></div>
<div><span><em> End If</em></span></div>
<div><span><em> </em></span></div>
<div><span><em> Next</em></span></div>
<div><span><em> A = crvs</em></span></div>
<div>Take care,</div>
<div>d.</div>
]]></content:encoded>
			<wfw:commentRss>http://improved.ro/blog/2008/11/grashopper-attractors-working-on-curves/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>


