Mesh Export

mesh transfer

Rhino to Processing

In a previous post I covered the implementation of a Half-Edged Mesh as a class in Processing. In that definition, however, both the vertex coordinates and face indexing were hard-coded in the body of the script (Lines 8-9). This may be acceptable for a mesh with only 16 faces, but for most occasions – and particularly for the terrain models which this class was originally written for – direct input of the mesh data is not plausible.

This rhinoscript file creates a pair of .txt files: one storing the vertex coordinates, the other storing the vertex indices for each face. Additionally, the rhinoscript allows one to remove very small faces (defined by the average distance between vertices and centroid, an imperfect but effective measure) which are collapsed to a single point in the occasion that the Rhino generated mesh proves too heavy for interacting with in Processing. For the code to reconstruct the mesh in Processing using these text files see this post.

(.rvb download)

Advertisements
Comments
One Response to “Mesh Export”
Trackbacks
Check out what others are saying...
  1. […] This sketch expands on the earlier Half-Edge Mesh sketch, demonstrating how to generate a large HEM class from text files containing the vertex positions and the vertex indices for each face as comma separated lists. (To generate these .txt files from Rhino via Rhinoscript see this post.) […]



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: