draw_nurbs_mod🔗
Short description🔗
draw_nurbs_mod — Interactive modification of a NURBS curve.
Warning🔗
This operator does not work in an HDevelop graphics window opened with
dev_open_window.
Signature🔗
draw_nurbs_mod( out xld_cont ContOut, window WindowHandle, string Rotate, string Move, string Scale, string KeepRatio, string Edit, integer Degree, coordinates.y RowsIn, coordinates.x ColsIn, real WeightsIn, out coordinates.y Rows, out coordinates.x Cols, out real Weights )
Description🔗
draw_nurbs_mod returns the contour ContOut and control
information (Rows, Cols, and Weights) of a NURBS
curve of degree Degree, which has been interactively
modified 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 input NURBS curve is specified by its control polygon
(RowsIn, ColsIn), its weight vector WeightsIn and
its degree Degree. The knot vector is assumed to be uniform (i.e.
'auto' in gen_contour_nurbs_xld).
You can modify the curve in two ways: by editing the control polygon,
e.g., by inserting or moving control points, or by transforming the contour
as a whole, e.g., by rotating moving or scaling it. Note that you can only
edit the control polygon if Edit is set to 'true'.
Similarly, you can only rotate, move or scale it if Rotate,
Move, and Scale, respectively, are set to 'true'.
draw_nurbs_mod starts in the transformation mode. In this mode, the
curve is displayed together with 3 symbols: 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'.
To switch into the edit mode, press the Shift key; by pressing it again,
you can switch back into the transformation mode.
Transformation Mode🔗
In this mode a curve can be rotated, moved and scaled, as long as the
respective parameter Rotate, Move and Scale
are set to 'true'. The curve is displayed along with a cross in its
center, an arrow pointing to the right (if Rotate is set to
'true'), and a double arrow (if Scale is set to
'true').
-
To move the curve, click with the left mouse button on the cross in the center and then drag it to the new position, i.e., keep the mouse button pressed while moving the mouse.
-
To rotate it, click with the left mouse button on the arrow and then drag it, till the curve has the right direction.
-
Scaling is achieved by dragging the double arrow. To keep the ratio, the parameter
KeepRatiohas to be set to 'true'.
Edit Mode🔗
In this mode, the curve is displayed together with its control polygon. Start and end point are marked by an additional square and the point which was handled last is surrounded by a circle representing its weight. You can perform the following modifications:
-
To append control points, click with the left mouse button in the window and a new point is added at this position.
-
You can delete the point appended last by pressing the Ctrl key.
-
To move a point, drag it with the mouse.
-
To insert a point on the control polygon, click on the desired position on the polygon.
-
To close respectively open the curve, click on the first or on the last control point.
-
You can modify the weight of a control point by first clicking on the point itself (if it is not already the point which was modified or created last) and then dragging the circle around the point.
Pressing the right mouse button terminates the procedure.
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.
Execution information🔗
Execution information
-
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
-
Multithreading scope: global (may be called from any thread).
-
Processed without parallelization.
Parameters🔗
ContOut (output_object) xld_cont → object
Contour of the modified curve.
WindowHandle (input_control) window → (handle)
Window handle.
Rotate (input_control) string → (string)
Enable rotation?
Default: 'true'
List of values: 'false', 'true'
Move (input_control) string → (string)
Enable moving?
Default: 'true'
List of values: 'false', 'true'
Scale (input_control) string → (string)
Enable scaling?
Default: 'true'
List of values: 'false', 'true'
KeepRatio (input_control) string → (string)
Keep ratio while scaling?
Default: 'true'
List of values: 'false', 'true'
Edit (input_control) string → (string)
Enable editing?
Default: 'true'
List of values: 'false', 'true'
Degree (input_control) integer → (integer)
The degree \(p\) of the NURBS curve. Reasonable values are 3 to 25.
Default: 3
Suggested values: 2, 3, 4, 5
Restriction: Degree >= 2
RowsIn (input_control) coordinates.y-array → (real)
Row coordinates of the input control polygon.
ColsIn (input_control) coordinates.x-array → (real)
Column coordinates of the input control polygon.
WeightsIn (input_control) real-array → (real)
Input weight vector.
Rows (output_control) coordinates.y-array → (real)
Row coordinates of the control polygon.
Cols (output_control) coordinates.x-array → (real)
Columns coordinates of the control polygon.
Weights (output_control) real-array → (real)
Weight vector.
Result🔗
draw_nurbs_mod returns 2 (H_MSG_TRUE) if the window is valid.
If necessary, an exception is raised.
Combinations with other operators🔗
Combinations
Possible predecessors
Possible successors
set_colored, set_line_width, set_draw
Alternatives
draw_nurbs_interp_mod, draw_xld_mod
See also
Module🔗
Foundation