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. 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.
hemesh is an implementation of a half-edge datastructure for manipulating 3D meshes in Processing. Basically it’s a toolset to extend my Processing sandbox to a proper playground.
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 half-edge mesh.
The library is currently focused on the stuff I coded it for: 3D voronoi and random plane divisions. So with hemesh we can create 3D meshes. Several primitives are built-in, but any kind of 2-manifold 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.
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.)
The half-edge datastructure has a few limitations 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.
The initial intent of hemesh 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…
The library is maintained at code.google.com. hemesh is currently at beta version 1.1.01.3.0 Download and extract the archive inside the Processing ‘libraries’ folder. The ‘hemesh’ subfolder contains several examples. A Processing 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.
At this time, the library reflects my current interests. If you want it to do something else, have a suggestion or hemesh goes haywire on you, let me know! One major addition is already planned: boolean mesh operations. This is a small step away from completion.
import processing.opengl.*;
import wblut.hemesh.*;
import wblut.geom.*;
HE_Mesh box;
void setup(){
size(600,600,OPENGL);
hint(ENABLE_OPENGL_4X_SMOOTH);
HEC_Box boxCreator=new HEC_Box(this)
.setWidth(400).setWidthSegments(10)
.setHeight(200).setHeightSegments(4)
.setDepth(200).setDepthSegments(4);
boxCreator.setCenter(100,100,0).setAxis(1,1,1);
box=new HE_Mesh(boxCreator);
HEM_Lattice lattice=new HEM_Lattice().setDepth(10)
.setWidth(10).setFuse(true).setThresholdAngle(HALF_PI);
box.modify(lattice)
}
void draw(){
background(120);
lights();
translate(300,300,0);
rotateY(mouseX*1.0f/width*TWO_PI);
rotateX(mouseY*1.0f/height*TWO_PI);
noStroke();
box.drawFaces();
stroke(0);
box.drawEdges();
}
thanks again for the superb and hard work!
super!
regards,
corneel
Looks pretty damn nice. Look forward to playing with it!
Amazing job. Great open source library.
Thanks
Nice! This will be really useful.
Hello remeshing, decimation and mesh smoothing…
Thanks.
[…] Hemesh: An implementation of a half-edge datastructure for manipulating 3D meshes in Processing. […]
[…] lograr hacer un ‘mesh’ en el cubo para futuras alteraciones con randomSeed(). Encontré ‘Hemesh‘ que salió el 4 de Mayo (Hace menos de un mes! Que […]
[…] model viewer — unwrappingLib for polygon unwrapping — Unfold Fab project for 3D printing ceramics — Hemesh library for complex 3D […]
[…] Hemesh — реализация half-edge structures под язык Processing. Красивые […]
Looks really great, but I couldn’t use it in my workflow because of the following problem. Right now all you can get are quad faces, but these are very cumbersome to combine within a greater project where triangles are used/required. I tried the functions getVerticesAsPoint() and getFacesAsInt(), but obviously the last returns the indexes for quads. I tried triangulation myself, but didn’t work out
I’m sure it’s possible, but unfortunately don’t have the time right now to work on it. So I would really like to see triangulation added (i.e. getTriangulatedFacesAsInt or something) so this library would be much more flexible and easier to use with other projects/libraries.
Hi Amon,
actually hemesh is general-polygon-based. So there’s no preference for quads or tris.
Triangulation is implemented as triangulateFaces(). Have fun.
Excellent! Will try it out some more then, this really helps. Thanks for the quick reply
Hi,
I tried to do a checkout with “svn checkout http://hemesh2010.googlecode.com/svn/trunk/ hemesh2010-read-only”, but this resulted in the following error:
svn: URL ‘http://hemesh2010.googlecode.com/svn/trunk’ doesn’t exist
Is the source code (at least the read only) still available somewhere?
Thanks,
Best
[…] So far I’ve successfully come up with methods to get stuff from Toxiclibs into Sunflow, from HEMesh into Sunflow and from external 3D model files into Sunflow. All of them go through Sunflow’s […]
[…] edge data structure is Über Powërful, someone I amdire actually does incredible things with it: W:Blut – Hemesh : a 3D mesh library for Processing this is inspiring and I’ll keep exploring what can be achieved with […]
Are the Voronoi features in HeMesh actually 3d voronoi? They look like it but the setPoints operator in HEMC_VoronoiCells seem to only take points with (X,Y) coordinates, I’ve been wading through the library and a lot of it is over my head.….. so my apologies if I’ve misunderstood. The results you’ve gotten from your coding are thrilling and it’s great to see Processing being pushed to this level of rendering but I’m wondering if I misread the documentation.
I’m trying to figure out on my own how to implement Fortune’s algorithm in 3d to quickly generate voronoi volumes from a given set of points but that’s a few orders of magnitude more math & programming than I’ve attempted before
Any advice or tips on using Hemesh for passing an array of points to be turned into Voronoi volumes would be appreciated, if you have the time, of course.
Cheers,
Voronoi_pilgrim
This is a fantastic library and quality addition to the Processing community. Thanks for this and looking forward to you making it to Paris to present your work some day :–)
Big well done to Amnon too for getting this plugged in with ControlP5 & Sunflow.
regards from Paname.
Mark
[…] Hemesh : a 3D mesh library for Processing | W:Blut. […]
[…] librería que usaré se llama Hemesh. La misión de esta nueva librería es manipular con vértices que se conectan entre sí, para […]
[…] computer based structure generator Cet article a été publié dans la catégorie 3d. Lien Permanent. […]
[…] made with Processing and Hemesh. These incredible shapes have been created with Hemesh, a library for […]
[…] A beautiful library for the manipulation of 3D meshes. […]
amazing work !
thank you very much.
[…] Vanhoutte’s Hemesh library is a comprehensive set of tools for constructing and modifying meshes through procedural […]
[…] Vanhoutte’s Hemesh library is a comprehensive set of tools for constructing and modifying meshes through procedural […]
[…] (very) heavily on the brilliant Hemesh library created by the über talented W:Blut (aka Frederik Vanhoutte) I created the Voronoi […]
[…] generative lamp, coded in processing using HE_Mesh library. The processing code generates corner pieces that can be 3D printed (in this case on our reprap) […]
[…] Vanhoutte (www.wblut.com) Frederik’s presentation and explanation with links to his HE_Mesh library is on his […]
Thanks for this and looking forward to you making it to Paris to present your work some day!!
[…] a non Anar+ version see W:Blut’s HEMesh library) GA_googleAddAttr(“AdOpt”, “1”); GA_googleAddAttr(“Origin”, “other”); […]
I can’t seem to download the current version of the library on http://code.google.com/p/hemesh2010/.
hemesh_b1_50a.zip
Is there another way to get it?
I get this. I’m in the US.
403. That’s an error.
Your client does not have permission to get URL /files/hemesh_b1_50a.zip from this server. (Client IP address: 128.111.221.48)
You are accessing this page from a forbidden country. That’s all we know.
Gack, what the…? Try this one: http://hemesh.wblut.com/hemesh-latest.zip
Cheers,
F.
Here’s some springy meshes that I’ve tried my hand at. Sorry for the preliminary condition the blog is in but I like hemesh so much that I wanted to get it out there as soon as I got a domain.
http://bicirim.com/projects/pmm/
http://bicirim.com/projects/wormbin/
Great, great, great work !. Congratulations !!!