Graph Interpolation
Last changed: -204.177.179.123

.
SummaryCreate a 3D colour graph from a set of measurements

 

Graph interpolation

This plugin creates a smooth colour distribution over a 3D mesh based on spatial relationships of sample points. A sample point is a combination of a 3D coordinate and a sample value. When multiple sample points occupy the same space, the sample value at any given coordinate can be guessed (interpolated). The diagram below is a one-dimensional representation of this algorithm:

 

 

In this case only two sample points are specified; A and B. The null-effect line represents the zero-influence line. Let's assume that Sample A has a value of 2.0 and Sample B a value of -0.5. When we calculate the value at point 2, the resulting value is the exact average of A and B; +0.75. In a 3D environment, every vertex of a mesh is interpolated and the local value mapped to a colour gradient which gives the following result for three Sample-points:

 

 

 

Careful! Might be unstable. Save before using any of these commands to prevent accidental loss of data.

Download the plugin for Rhino4.

 

Contact the author

Back to top

 

 

Commands

Before a graph can be interpolated, you must add a number of sample objects to the document. The only way to do this at present is to use the _GradientSample command or to copy/array/duplicate an existing sample. There is no mechanism yet to change the values of existing samples.

When you have a mesh and a number of sample points you can run the _GradientGraph command which will display the main window for this command. This window lists all selected samples and allows you to change the properties of the interpolator and the gradient. The gradient control is fairly basic and works as follows:

 

 

Gradients

There are a number of predefined gradients (Click on the button in the main window for a dropdown list of available gradients) which can be assigned at any time. The default is the Spectrum gradient, but if you applied a gradient once to a mesh that gradient will become the default for that mesh. Gradients are defined by a series of grips. The image above shows three grips, each of them simple, one-colour grips. The gradient can have any number of grips (except less than 1). You can add grips by double clicking in he desired location on the grip-bar below the gradient. You can move grips by dragging them or by setting a new location in the grip-properties. A grips location is a number between 0.0 (leftmost location) and 1.0 (rightmost location). Grip colour can be changed by selecting it (clicking on the grip) and clicking on the colour field in the grip properties. Grips can be deleted by dragging them off the grip-bar. Gradients can be saved and loaded using the buttons on the dialog, but gradients will also be stored inside the Mesh objects.

 

When you change a gradient, the mesh in the document will be automatically updated. Note that textured meshes only appear properly textured in Rendered mode. Gradient textures are stored in the temp directory of your pc and thus might not survive for a long time. If you intend to open the file at a later stage, you should save the gradient bitmap to a safe location and adjust the material to point to this new bitmap. You can save a gradient from the toolbar.

 

 

 

Interpolator

The interpolator depends on two settings, both of which can be freely changed. Note that changing interpolator settings does not update the mesh because a new solution must be computed first. This is potentially an long-term process which is why you have to press the Apply button yourself to see the changes. The first setting is the Domain of the graph. Let us assume that we have a collection of 100 samples, most of which are in the range {5.0~20.0}, but with a few anomalies with extremely high values -say- >1000. If we allow the domain encompass the entire set, there will be no visible differences between the 5.0 and 20.0 samples because they are relatively close together. Instead, it might make more sense to define the domain as {0.0~30.0} and thus get a much bigger contrast where it matters.

The following animation has samples that range from {0.0~2.0}. Note how we can 'zoom in' on specific differences when we adjust the domain:

 

 

 

The second interpolator setting is the Bias value. By default this value is 2.0 which means that the effect of a particle decreases with the inverse of the square of the distance. The bias can be changed to any value betwen -10.0 and +10.0, eventhough very small and negative bias values are probably completely pointless. The animation below displays the behaviour of the Bias setting from {0.6~10.0}:

 

 

Back to top