Introduction to Splines

Splines in general

A spline is a line passing through three or more points with some degree of "curve fitting". A first degree spline has no curvature and looks like a line graph. As the degree of the polynomial increases the line forms a curve which is continuous and passes closer to the defining points.

Splines in Carbon

The spline drawing capability is not fully developed at this time. Many features, such as degrees, specifying pens and curvature, and the GUI interface to interactively create splines, are missing.

But, the ability to draw a spline does exist, and is used in the torture tests as "Thick_open_spaces" and "Wide_open_spaces". These are defined in mxp as a series of points. The coordinate system used for defining a spline is arbitrary, the figure will be scaled to fit the size value, which is defined in virtual units (8640 is full height).

This is the definition of "Thick_open_spaces".

	Object=Spline(RGB(0, 0, 0), 828, RGB(25, 246, 0), a, 0, 65535, 0, 0, 7893, 1, 1, 1)
	{
		0,0 0,100 100,100 100,0
		55,0 55,20 75,5 75,40
		25,40 25,5 45,20 45,0
	}
The values in the main definition are: line_color, line_thickness, fill_color, options, frame_rotation, opacity, X_coord, Y_coord, size, shape_numerator, shape_denominator, degree.

The options byte has the following meaning:
bit 3 = brush (fill) color specified, else transparent
bit 2 = alternate fill specified (will be replaced by brush count)
bit 1 = closed figure (will be replaced by brush count)
bit 0 = not used

The paired values enclosed in curly braces are point coordinates in an arbitrary 100x100 space.

Carbon home Copyright © 2005 - 2010 MPUCoder, all rights reserved. MuxMan home