Operators |
draw_nurbs — Interactive drawing of a NURBS curve.
The operator does not work in a buffer window.
draw_nurbs returns the contour ContOut and control information (Rows, Cols, and Weights) of a NURBS curve of degree Degree, which has been created interactively by the user in the window WindowHandle. For additional information concerning NURBS curves, see the documentation of gen_contour_nurbs_xld. To use the control information Rows, Cols, and Weights in a subsequent call to the operator gen_contour_nurbs_xld, the knot vector Knots should be set to 'auto' .
The NURBS curve is created and manipulated by the means of its control polygon. By contrast, using the operator draw_nurbs_interp, it is possible to create a NURBS curve that interpolates points specified by the user. Directly after calling draw_nurbs , you can add control points by clicking with the left mouse button in the window at the desired positions.
When there are three control points or more, the first and the last point will be marked with an additional square. By clicking on them you can close the curve or open it again. You delete the point appended last by pressing the Ctrl key.
As soon as the number of control points exceeds Degree, the NURBS curve given by the specified control polygon and weight vector is displayed in addition to the control polygon.
The control point which was handled last is surrounded by a circle representing its weight. By simply dragging the circle you can increase or decrease the weight of this control point.
Existing control points can be moved by dragging them with the mouse. Further new points on the control polygon (to refine the control polygon) can be inserted by a left click on the desired position on the control polygon.
By pressing the Shift key, you can switch into the transformation mode. In this mode you can rotate, move, and scale the contour as a whole, but only if you set the parameters Rotate, Move, and Scale, respectively, to 'true' . Instead of the pick points and the control polygon, 3 symbols are displayed with the contour: a cross in the middle and an arrow to the right if Rotate is set to 'true' , and a double-headed arrow to the upper right if Scale is set to 'true' .
You can
move the curve by clicking the left mouse button on the cross in the center and then dragging it to the new position,
rotate it by clicking with the left mouse button on the arrow and then dragging it, till the curve has the right direction, and
scale it by dragging the double arrow. To keep the ratio the parameter KeepRatio has to be set to 'true' .
By pressing the Shift key again you can switch back to the edit mode. Pressing the right mouse button terminates the procedure. On macOS draw_nurbs can also be terminated by pressing the escape key.
The appearance of the curve while drawing is determined by the line width, size, and color set via the operators set_color, set_colored, set_line_width, and set_line_style. The control polygon and all handles are displayed in the second color set by set_color or set_colored. Their line width is fixed to 1 and their line style is fixed to a drawn-through line.
Contour approximating the NURBS curve.
Window handle.
Enable rotation?
Default value: 'true'
List of values: 'false' , 'true'
Enable moving?
Default value: 'true'
List of values: 'false' , 'true'
Enable scaling?
Default value: 'true'
List of values: 'false' , 'true'
Keep ratio while scaling?
Default value: 'true'
List of values: 'false' , 'true'
The degree p of the NURBS curve. Reasonable values are 3 to 25.
Default value: 3
Suggested values: 2, 3, 4, 5
Restriction: Degree >= 2
Row coordinates of the control polygon.
Columns coordinates of the control polygon.
Weight vector.
draw_nurbs returns 2 (H_MSG_TRUE), if the window is valid. If necessary, an exception is raised.
set_colored, set_line_width, set_draw, set_insert
draw_nurbs_mod, draw_nurbs_interp, gen_contour_nurbs_xld
Foundation
Operators |