<?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>W:Blut &#187; Java</title>
	<atom:link href="http://www.wblut.com/tags/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wblut.com</link>
	<description>Experiments in generative graphics</description>
	<lastBuildDate>Tue, 13 Dec 2011 18:12:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>

   <image>
    <title>W:Blut</title>
    <url>http://0.gravatar.com/avatar/f53eecb68a71cc8113e72e1e53c94f7d.png?s=48</url>
    <link>http://www.wblut.com</link>
   </image>
		<item>
		<title>Hemesh : a 3D mesh library for Processing</title>
		<link>http://www.wblut.com/2010/05/04/hemesh-a-3d-mesh-library-for-processing/</link>
		<comments>http://www.wblut.com/2010/05/04/hemesh-a-3d-mesh-library-for-processing/#comments</comments>
		<pubDate>Tue, 04 May 2010 21:09:19 +0000</pubDate>
		<dc:creator>Frederik Vanhoutte</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Hemesh]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[generative]]></category>
		<category><![CDATA[geometry]]></category>
		<category><![CDATA[half-edge]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[voronoi]]></category>
		<category><![CDATA[wblut]]></category>

		<guid isPermaLink="false">http://www.wblut.com/?p=1017</guid>
		<description><![CDATA[UPDATE : He_Mesh has grown enough to give it its own site: http://hemesh.wblut.com/. In time, the new site will contain tutorials and in-depth explanations. Coded, recoded, lost, recoded and recoded … hemesh, the half-edge mesh library for Processing has slowly accreted to a state that warrants a release. A release in more than one way. [...]]]></description>
			<content:encoded><![CDATA[

<div style="float:left; width:500px;">
<p><strong>UPDATE :</strong> He_Mesh has grown enough to give it its own site: <a href="http://hemesh.wblut.com/" title="He_Mesh" target="_blank" class="liexternal">http://hemesh.wblut.com/</a>. In time, the new site will contain tutorials and in-depth explanations.</p>
<p></p>

<p>Coded, recoded, lost, recoded and recoded … <em>hemesh</em>, the half-edge mesh library for Processing has slowly accreted to a state that warrants a release. A release in more than one way. In retrospect, the current functionality looks depressingly small, especially compared to the hundreds of hours that already went into coding it. But like a broke home-owner with a basement and a half-finished first floor, I comfort myself with the thought that at least it holds potential for growth.</p>
<p></p>
<h3>What is <em>hemesh</em>?</h3>
<p><em>hemesh</em> is an implementation of a <a href="http://www.cgafaq.info/wiki/Half_edge_general" class="liexternal">half-edge datastructure</a> for manipulating 3D meshes in Processing. Basically it’s a toolset to extend my Processing sandbox to a proper playground.</p>
<p>Generating and displaying a mesh requires nothing more than a list of vertices and a list of faces connecting them. This hardly requires a special dataset. However, manipulating a mesh in any but a trivial way requires a lot of connectivity information: neighboring vertices, neighboring faces, shared edges,… Keeping track of this in a simple facelist type structure is difficult. Hence the need for a datastructure that incorporates connectivity information in an efficient way: the <a href="http://www.cgafaq.info/wiki/Half_edge_general" class="liexternal">half-edge mesh</a>.</p>
<h3>What can <em>hemesh</em> do?</h3>
<p>The library is currently focused on the stuff I coded it for: 3D voronoi and random plane divisions. So with <em>hemesh</em> we can create 3D meshes. Several primitives are built-in, but any kind of <a href="http://en.wikipedia.org/wiki/2-manifold" rel="nofollow" class="liwikipedia">2-manifold</a> mesh can be turned into a half-edge mesh from its vertices and facelist. The weight of the implementation lies in closed meshes but open surfaces are handled as well.</p>
<p>Creating meshes is cool (for a given amount of cool) but destroying them is cooler. Several modifiers are provided, either as part of the basic mesh functionality or as separate modifier classes. Subdividors are a special class of modifier oriented towards subdivisions. (The names might not be original but I guess it’s easier to remember than quaghot and umpsink.)</p>
<h3>What <em>hemesh</em> can’t do…</h3>
<p>The half-edge datastructure has <a href="http://www.cgafaq.info/wiki/Half_edge_capabilities" class="liexternal">a few limitations</a> in itself. In practice, each edge in a mesh can be shared by at most two faces. The implementation is strongly face-based, isolated vertices and edges are not supported and will lead to ouchie.
</p><p>The initial intent of <em>hemesh</em> was to build a system to prototype geometric play. So large-scale systems were never a goal. Several implemented algorithms are O(n²)  and use a lot of storage. Connaiseurs and lectors in computational geometry are advised to avoid perusing the code, bleeding eyes often offend. On the positive side, there’s room for improvement…</p> 
<h3>Getting <em>hemesh</em></h3>
<p>The library is maintained at <a href="http://code.google.com/p/hemesh2010/" class="liexternal">code.google.com</a>. <em>hemesh</em> is currently at beta version <del datetime="2011-02-14T14:27:31+00:00">1.1.0</del>1.3.0 Download and extract the  <a href="http://code.google.com/p/hemesh2010/downloads/list" class="liexternal">archive</a> inside the Processing ‘libraries’ folder. The ‘hemesh’ subfolder contains several examples. A <a href="http://www.processing.org/download/" class="liexternal">Processing</a> version supporting JAVA 1.5 syntax is recommended, Rev 180 or higher. In the coming days, I’ll post some tutorials and spielerei to illustrate further use. </p>
<h3>Future</h3>
<p>At this time, the library reflects my current interests. If you want it to do something else, have a suggestion or <em>hemesh</em> goes haywire on you, let <a href="http://www.wblut.com/about/" class="liinternal">me</a> know! One major addition is already planned: boolean mesh operations. This is a small step away from completion. </p>
</div>

<div style="float:right; width:400px;"><a href="http://www.wblut.com/2010/05/04/hemesh-a-3d-mesh-library-for-processing/"><em>Click here to view the embedded slideshow.</em></a>
<p></p>
<pre><code>

import processing.opengl.*;
import wblut.hemesh.*;
import wblut.geom.*;

HE_Mesh box;

void setup(){
&nbsp;&nbsp;size(600,600,OPENGL);
&nbsp;&nbsp;hint(ENABLE_OPENGL_4X_SMOOTH);
&nbsp;&nbsp;HEC_Box boxCreator=new HEC_Box(this)
&nbsp;&nbsp;&nbsp;&nbsp;.setWidth(400).setWidthSegments(10)
&nbsp;&nbsp;&nbsp;&nbsp;.setHeight(200).setHeightSegments(4)
&nbsp;&nbsp;&nbsp;&nbsp;.setDepth(200).setDepthSegments(4);
&nbsp;&nbsp;boxCreator.setCenter(100,100,0).setAxis(1,1,1);
&nbsp;&nbsp;box=new HE_Mesh(boxCreator);
&nbsp;&nbsp;HEM_Lattice lattice=new HEM_Lattice().setDepth(10)
&nbsp;&nbsp;.setWidth(10).setFuse(true).setThresholdAngle(HALF_PI);
&nbsp;&nbsp;box.modify(lattice)
}

void draw(){
&nbsp;&nbsp;background(120);
&nbsp;&nbsp;lights();
&nbsp;&nbsp;translate(300,300,0);
&nbsp;&nbsp;rotateY(mouseX*1.0f/width*TWO_PI);
&nbsp;&nbsp;rotateX(mouseY*1.0f/height*TWO_PI);
&nbsp;&nbsp;noStroke();
&nbsp;&nbsp;box.drawFaces();
&nbsp;&nbsp;stroke(0);
&nbsp;&nbsp;box.drawEdges();
}

</code></pre>


</div>
<div style="clear:both"></div>

]]></content:encoded>
			<wfw:commentRss>http://www.wblut.com/2010/05/04/hemesh-a-3d-mesh-library-for-processing/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 11/20 queries in 0.033 seconds using disk: basic

Served from: www.wblut.com @ 2012-02-05 05:52:58 -->
