*linecreatenurbs

Create a NURBS line using input parameters.

Syntax

*linecreatenurbs degree dimension knot_count pole_count ratnl double_array number_of_doubles

Type

HyperMesh Tcl Modify

Description

This command creates a generic NURBS type line using input parameters.

Inputs

degree
Polynomial degree of the created line.
dimension
Dimension of created line. Valid values are:
  • 2 - Planar line
  • 3 - 3-dimensional line
knot_count
Number of knot values. See Comments section.
pole_count
Number of NURBS control points/poles.
ratnl
Parameter that specifies whether weights are used in addition to control points. Valid values are:
0 – Use weights
1 – Do not use weights
double_array
The ID of the double array that contains the value of the knots, control points and weights (if ratnl is 1). The double array is created using the *createdoublearray command. This should always be set to 1.
number_of_doubles
Integer indicating the size (number of doubles) in the double array created using *createdoublearray.

To reduce input, the usual NURBS convention that for the curve with polynomial degree first and last degree+1 knots must have the same value is enforced internally. Input for this command should only contain one value. For all internal knot values, multiplicity should still be provided explicitly. All knot values must be provided in non-decreasing order.

Values in double_array array should be arranged as follows:

First knot_countt entries – knot values.

Next pole_count × dimension values are x, y, z values of control points for 3-dimensional line, or u, v values for planar line.

If ratnl is not zero, then next pole_count entries are NURBS weights values.

Examples

To create a planar line segment connecting points (0,0) and (1,1):

*createdoublearray 6 0 1 0 0 1 1
*linecreatenurbs 1 2 2 2 0 1 6

To create a 90 degree arc starting at (0,0) and ending at (2.0):

*createdoublearray 11 0 1 0 0 1 1 2 0 1 0.7071067811 1
*linecreatenurbs 2 2 2 3 1 1 11

To create a 180 degree arc:

*createdoublearray 19 0 1 1 2 0 0 1 1 2 0 3 -1 2 -2 1 0.707106 1 0.707106 1
*linecreatenurbs 2 2 4 5 1 1 19

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

10.0