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 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". Splines are also used, along with polygons, ellipses, pies, and chords, to form the masks for iris transitions.
Splines 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 mxp version 3 definition of "Thick_open_spaces", the torture test uses mxp version 2 for backwards verification.
	Object=Spline(RGB(0, 0, 0), 828, RGB(25, 246, 0), 0, 65535, 0, 0, 7893, 1, 1, 1, 0)
	{
		Options=closed, filled
		0,0 0,100 100,100 100,0
		55,0 55,20 75,5 75,40
		25,40 25,5 45,20 45,0
	}
And here is the definition of the heart created by the Transition Assistant.
	Object=Spline(RGB(255, 0, 0), 18, RGB(0, 255, 0), 0, 0, 0, -50, 250, 4, 3, 1, 0)
	{
		Options=closed, altfill, filled, conform
		ID=10000102
		Display=00:00:00.000
		Duration=00:00:00.149
		1,0 0,6,2160C 1,7,2160C 2,6
		Move=(RGB(255, 0, 0), 18, RGB(0, 255, 0), 0, 0, 0, -1440, 19152, 4, 3, 0, 0)
		{
			Display=00:00:00.000
			Duration=00:00:00.115
		}
	}

The values in the main definition are: line_color, line_thickness, fill_color, frame_rotation, opacity, X_coord, Y_coord, size, shape_numerator, shape_denominator, degree, and figure_rotation.
The list of grouped values enclosed in curly braces are point coordinates in an arbitrary 100x100 space for thick_open_spaces and 8x2 space for the heart.
The heart also uses a third value on the second and third point, this is the relative curvature of the second and third lines respectively.
The value 2160 represents a curvature (the deviation from a straight line at the midpoint of the arc or line) of half the line length. This produces a semi-circle.
Carbon home Copyright © 2005 - 2014 MPUCoder, all rights reserved. MuxMan home