=================
TKE_NURBS_Surface
=================

Opcode
======

.. csv-table::

	"ASCII", "A"
	"Hexadecimal", "0x41"
	"Decimal", "65"


Operands
========

| Byte options, Byte u_degree, Byte v_degree, Long u_count, Long v_count, 
| (u_count x v_count)xPoint control_points, [(u_count x v_count)xFloat weights],
| [(u_count+degree+1)xFloat u_knots],
| [(v_count+degree+1)xFloat v_knots],
| [variable trims] 

.. csv-table::

	"options", "bitmask indicating which options are present"
	"u_degree", "degree of the surface in the u direction"
	"v_degree", "degree of the surface in the v direction"
	"u_count", "number of control points in the surface in the u direction"
	"v_count", "number of control points in the surface in the v direction"
	"v_count", "number of control points in the surface in the v direction"
	"control_points", "``u_count`` x ``v_count`` triplets of x, y, z data. A two dimensional array sorted such that the v direction is varying fastest"
	"weights", "``u_count`` x ``v_count`` weight factors. Arranged in the same order as ``control_points``."
	"knots", "``u_count + degree + 1`` knot values in the u direction"
	"knots", "``v_count + degree + 1`` knot values in the v direction"
	
	
Notes
=====

Option flags:

.. csv-table::

	"0001", "Weights are specified"
	"0002", "Knots are specified"
	"0004", "Surface is trimmed"
	
Surface is inserted into the currently opened segment.

If trim operations are present, as indicated by the one of the bits in ``options``, the surface is followed by a variable-length list of trim operations, as described in :doc:`trim.html </general/hsf/opcodes/trim>`.

NURBS Surfaces were first added with version 7.0.
