Antiprism Up Next
Home
Programs
Examples
Album
Download
Project
Forum
About

off_color - adds colours to an OFF file

Usage    |    Examples    |    Notes

Usage

Synopsis

off_color [options] [input_files]

Description

Read a file in OFF format and add colours to it.

Options

input_file
input file in OFF format, or if not given the program reads from standard input

-h
program help

-f <col>
colour the faces according to
  • one integer - colour index for all faces (-1 to clear all colours)
  • colour value in form r_val,g_val,b_val (values 0.0-1.0, or 0-255) or hex xFFFFFF - colour value for all faces
  • u - unique colour using colour indexes
  • U - unique colour using colour values
  • p - minimal proper colouring using colour indexes
  • P - minimal proper colouring using colour values
  • n - different colour index for each polygon type (num of sides)
  • N - different colour for each polygon type (num of sides)
  • G[HSV] - gradient on Y coordinate of normal, the gradient can be on the H, S and V range (default: H)
  • C[HSV] - gradient on Y coordinate of centroid, the gradient can be on the H, S and V range (default: H)
  • R[HSVA] - map HSVA values onto the specified HSVA ranges
  • L[HSVA] - lighting effect by normal (see option -l) and map HSVA values onto the specified HSVA ranges
  • l[HSVA] - lighting effect by centroid (see option -l) and map HSVA values onto the specified HSVA ranges

-E <type>
colour by edge type, e - explicit edges, i - implicit edges I - implicit edges which are not explicit edges (default: explicit and implicit)

-e <col>
colour the edges according to
  • one integer - colour index for all edges (-1 for edges without colour)
  • colour value in form r_val,g_val,b_val (values 0.0-1.0, or 0-255) or hex xFFFFFF - colour value for all edges
  • u - unique colour using colour indexes
  • U - unique colour using colour values
  • p - minimal proper colouring using colour indexes
  • P - minimal proper colouring using colour values
  • F - colour with average adjoining face colour
  • G[HSV] - gradient on Y coordinate of edge direction, the gradient can be on the H, S and V range (default: H)
  • C[HSV] - gradient on Y coordinate of centroid, the gradient can be on the H, S and V range (default: H)
  • R[HSVA] - map HSVA values onto the specified HSVA ranges
  • L[HSVA] - lighting effect (see option -l) and map HSVA values onto the specified HSVA ranges

-v <col>
colour the vertices according to
  • one integer - colour index for all vertices (-1 to clear all colours)
  • colour value in form r_val,g_val,b_val (values 0.0-1.0, or 0-255) or hex xFFFFFF - colour value for all vertices
  • u - unique colour using colour indexes
  • U - unique colour using colour values
  • p - minimal proper colouring using colour indexes
  • P - minimal proper colouring using colour values
  • n - different colour index for each order of vertex
  • N - different colour for each order of vertex
  • F - colour with average adjoining face colour
  • F - colour with average adjoining edge colour
  • R[HSVA] - map HSVA values onto the specified HSVA ranges
  • C[HSV] - gradient on Y coordinate, the gradient can be on the H, S and V range (default: H)
  • L[HSV] - lighting effect (see option -l) and map HSVA values onto the specified HSVA ranges

-s <sch>
use the colour scheme given by a number (all numbers have a scheme), or if 0 then use a scheme chosen at random

-l <file>
lights for colouring type L in a file in OFF format, each vertex and its colour gives a light direction and colour (default: a set of six lights giving a rainbow colouring

-m <file>
map colour indexes into colour values using colour map file, which contains a list of mappings in the format index_number = colour e.g.
   9 = 0.5 1.0 0.0
with one mapping per line (implies -c which defaults to 2).

-M <elems>
apply colour map to element types, given by v, e, and f (default: vef)
-c <conv>
convert indexes after all processing, can be:
  • 1 - convert all, use only colours in the colour map file
  • 2 - convert all, use colour scheme for index numbers not listed in the colour map file
  • 3 - convert only the index numbers listed in the colour map file

-H <range>
range for hue in generated color map, one or two values, (separated by a comma) between 0.0 and 1.0 (default:0.0,1.0)

-S <range>
range for saturation in generated color map, one or two values, (separated by a comma) between 0.0 and 1.0 (default:0.7,1.0)

-V <range>
range for hue in generated color map, one or two values, (separated by a comma) between 0.0 and 1.0 (default:0.7,1.0)

-A <range>
range for alpha value (opacity) in generated color map, one or two values, (separated by a comma) between 0.0 and 1.0 (default:1.0)

-U
colour only uncoloured elements

-o <file>
write output to file, if this option is not used the program writes to standard output

Examples

Make a cuboctahedron with the triangle faces a different colour to the square faces
   unipoly cuboctahedron | off_color -f N -o cubo.off
Same again, but make the colours black and white. Create a file called my_colormap.txt with these two lines which convert index numbers into colour values (with the -f n option faces have an index number the same as their number of sides).
   3 = 0.0 0.0 0.0
   4 = 1.0 1.0 1.0
Now the command is
   unipoly cuboctahedron | off_color -f n -m my_colormap.txt -o cubo.off
Colour faces with unique colours
   geodesic 2 | off_color -f U | antiview -x ve
May a blue-green range for U by specifying a range of the hue
   geodesic 2 | off_color -f U -H 0.4,0.7| antiview -x ve
Make pastel colours for U by decreasing the saturation
   geodesic 2 | off_color -f U -S 0.4| antiview -x ve
Make dark colours for U by decreasing the value
   geodesic 2 | off_color -f U -V 0.4 -S 1| antiview -x ve
Choose from all possible colours for U by giving the full ranges of H, S and V
   geodesic 2 | off_color -f U -H 0,1 -S 0,1 -V 0,1| antiview -x ve
Colour edges and vertices with a rainbow effect
   geodesic 5 | off_color -f 1.0,1.0,1.0 -e L -v L | antiview -v 0.05
Make a lights file placing a red, green, blue and white light tetrahedrally, call it lts.off
OFF
4 4 0
1 1 1
1 -1 -1
-1 -1 1
-1 1 -1
1 0 255 0 0
1 1 0 255 0
1 2 0 0 255
1 3 255 255 255
Colour faces with a lighting effect using these lights
   geodesic 5 | off_color -l lts.off -f L | antiview -x ve

Notes

A selection of lights files and colour map files are included with the Antiprism resources. More colour maps are available from Colorzilla Palettes.

Proper colourings are not always optimal.

Face colourings G and L which use normals are affected by the orientation of the faces. If the colouring is patchy then orient the faces with off_util -O


     Next: off_trans - transformations (rotations etc) of OFF files
     Up: Programs and Documentation


Home   |   Programs   |   Examples   |   Album   |   Download   |   Project   |   Forum   |   About

Contact: adrian@antiprism.com      -      Modified 4.1.2008