draw_nurbsT_draw_nurbsDrawNurbsDrawNurbsdraw_nurbs (算子)

名称

draw_nurbsT_draw_nurbsDrawNurbsDrawNurbsdraw_nurbs — 交互式绘制一条非均匀有理 B 样条(Non-Uniform Rational B-Splines,NURBS)曲线。

警告

This operator does not work in an HDevelop graphics window opened with dev_open_window.

签名

draw_nurbs( : ContOut : WindowHandle, Rotate, Move, Scale, KeepRatio, Degree : Rows, Cols, Weights)

Herror T_draw_nurbs(Hobject* ContOut, const Htuple WindowHandle, const Htuple Rotate, const Htuple Move, const Htuple Scale, const Htuple KeepRatio, const Htuple Degree, Htuple* Rows, Htuple* Cols, Htuple* Weights)

void DrawNurbs(HObject* ContOut, const HTuple& WindowHandle, const HTuple& Rotate, const HTuple& Move, const HTuple& Scale, const HTuple& KeepRatio, const HTuple& Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights)

void HXLDCont::DrawNurbs(const HWindow& WindowHandle, const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights)

void HXLDCont::DrawNurbs(const HWindow& WindowHandle, const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights)

void HXLDCont::DrawNurbs(const HWindow& WindowHandle, const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights)   ( Windows only)

HXLDCont HWindow::DrawNurbs(const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights) const

HXLDCont HWindow::DrawNurbs(const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights) const

HXLDCont HWindow::DrawNurbs(const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights) const   ( Windows only)

static void HOperatorSet.DrawNurbs(out HObject contOut, HTuple windowHandle, HTuple rotate, HTuple move, HTuple scale, HTuple keepRatio, HTuple degree, out HTuple rows, out HTuple cols, out HTuple weights)

void HXLDCont.DrawNurbs(HWindow windowHandle, string rotate, string move, string scale, string keepRatio, int degree, out HTuple rows, out HTuple cols, out HTuple weights)

HXLDCont HWindow.DrawNurbs(string rotate, string move, string scale, string keepRatio, int degree, out HTuple rows, out HTuple cols, out HTuple weights)

def draw_nurbs(window_handle: HHandle, rotate: str, move: str, scale: str, keep_ratio: str, degree: int) -> Tuple[HObject, Sequence[float], Sequence[float], Sequence[float]]

描述

draw_nurbsdraw_nurbsDrawNurbsDrawNurbsDrawNurbsdraw_nurbs returns the contour ContOutContOutContOutContOutcontOutcont_out and control information (RowsRowsRowsRowsrowsrows, ColsColsColsColscolscols, and WeightsWeightsWeightsWeightsweightsweights) of a NURBS curve of degree DegreeDegreeDegreeDegreedegreedegree, which has been created interactively by the user in the window WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle. For additional information concerning NURBS curves, see the documentation of gen_contour_nurbs_xldgen_contour_nurbs_xldGenContourNurbsXldGenContourNurbsXldGenContourNurbsXldgen_contour_nurbs_xld。To use the control information RowsRowsRowsRowsrowsrows, ColsColsColsColscolscols, and WeightsWeightsWeightsWeightsweightsweights in a subsequent call to the operator gen_contour_nurbs_xldgen_contour_nurbs_xldGenContourNurbsXldGenContourNurbsXldGenContourNurbsXldgen_contour_nurbs_xld, the knot vector KnotsKnotsKnotsKnotsknotsknots should be set to 'auto'"auto""auto""auto""auto""auto".

The NURBS curve is created and manipulated by the means of its control polygon. By contrast, using the operator draw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterpDrawNurbsInterpdraw_nurbs_interp, it is possible to create a NURBS curve that interpolates points specified by the user. Directly after calling draw_nurbsdraw_nurbsDrawNurbsDrawNurbsDrawNurbsdraw_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 DegreeDegreeDegreeDegreedegreedegree, 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 RotateRotateRotateRotaterotaterotate, MoveMoveMoveMovemovemove, and ScaleScaleScaleScalescalescale, respectively, to 'true'"true""true""true""true""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 RotateRotateRotateRotaterotaterotate is set to 'true'"true""true""true""true""true", and a double-headed arrow to the upper right if ScaleScaleScaleScalescalescale is set to 'true'"true""true""true""true""true".

You can

By pressing the Shift key again you can switch back to the edit mode. 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_colorset_colorSetColorSetColorSetColorset_color, set_coloredset_coloredSetColoredSetColoredSetColoredset_colored, set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidthset_line_width, and set_line_styleset_line_styleSetLineStyleSetLineStyleSetLineStyleset_line_style。The control polygon and all handles are displayed in the second color set by set_colorset_colorSetColorSetColorSetColorset_color or set_coloredset_coloredSetColoredSetColoredSetColoredset_colored。Their line width is fixed to 1 and their line style is fixed to a drawn-through line.

执行信息

参数

ContOutContOutContOutContOutcontOutcont_out (输出对象)  xld_cont objectHXLDContHObjectHXLDContHobject *

Contour approximating the NURBS curve.

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (输入控制)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

窗口句柄。

RotateRotateRotateRotaterotaterotate (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Enable rotation?

默认值: 'true' "true" "true" "true" "true" "true"

值列表: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

MoveMoveMoveMovemovemove (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Enable moving?

默认值: 'true' "true" "true" "true" "true" "true"

值列表: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

ScaleScaleScaleScalescalescale (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Enable scaling?

默认值: 'true' "true" "true" "true" "true" "true"

值列表: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

KeepRatioKeepRatioKeepRatioKeepRatiokeepRatiokeep_ratio (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Keep ratio while scaling?

默认值: 'true' "true" "true" "true" "true" "true"

值列表: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

DegreeDegreeDegreeDegreedegreedegree (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

The degree p of the NURBS curve. Reasonable values are 3 to 25.

默认值: 3

建议值: 2, 3, 4, 5

限制: Degree >= 2

RowsRowsRowsRowsrowsrows (输出控制)  coordinates.y-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Row coordinates of the control polygon.

ColsColsColsColscolscols (输出控制)  coordinates.x-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Columns coordinates of the control polygon.

WeightsWeightsWeightsWeightsweightsweights (输出控制)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Weight vector.

结果

draw_nurbsdraw_nurbsDrawNurbsDrawNurbsDrawNurbsdraw_nurbs returns 2 ( H_MSG_TRUE) , if the window is valid。如有必要,则抛出异常。

可能的前趋

open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window

可能的后继

set_coloredset_coloredSetColoredSetColoredSetColoredset_colored, set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidthset_line_width, set_drawset_drawSetDrawSetDrawSetDrawset_draw, set_insertset_insertSetInsertSetInsertSetInsertset_insert

替代

draw_xlddraw_xldDrawXldDrawXldDrawXlddraw_xld, draw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterpDrawNurbsInterpdraw_nurbs_interp

另见

draw_nurbs_moddraw_nurbs_modDrawNurbsModDrawNurbsModDrawNurbsModdraw_nurbs_mod, draw_nurbs_interpdraw_nurbs_interpDrawNurbsInterpDrawNurbsInterpDrawNurbsInterpdraw_nurbs_interp, gen_contour_nurbs_xldgen_contour_nurbs_xldGenContourNurbsXldGenContourNurbsXldGenContourNurbsXldgen_contour_nurbs_xld

模块

基础