This section describes the 3D Curve entity of MotionView and shows the various usage, creation, and editing methods.
3D Curves are geometrical curves in a three dimensional space that can be used to define entities such as Point-to-Curve joints and other Advanced Joints.
The are two types of 3D curves available in MotionView:
3D Cartesian |
3D Cartesian curves consist of three vectors. All three vectors must be of the same length (or in other words, should have the same number of data points). |
3D Parametric |
A 3D parametric curve is defined in terms of one free parameter, u, and the remaining three vectors that are function of u. 3D parametric curves can be defined either by explicitly defining the vectors, or as a user-defined curve using a user subroutine. |
To learn how to add a 3D Curve to a model, please see the Curves topic.
Curve Panel - Properties Tab
To know more about how define the curve data using the curve vector types, please refer to the Vector Types topic.
|
Syntax: *Curve(crv_name, "crv_label", 3D, CARTESIAN, [WRITE|NOWRITE], [CONTROL_POINTS|CURVE_POINTS], OPEN|CLOSED]) Example: *Curve( crv_3D_cart, "3D_Cartesian", 3D, CARTESIAN, WRITE, CURVE_POINTS, OPEN ) The syntax to define the curve data: *SetCurve(crv_name, Block-X, Block-Y, LIN_EXTRAP) Block-X, Block-Y, Block-Z can be of the following three types: FILE: "[path]/filename", datatype, request, component MATH: expr VALUE: numpts, v1, v2, v3, ..., vn Example: *SetCurve( crv_3d_cart, FILE, "3D-Cart-Curve.txt", "Unknown", "Block 1", "X", FILE, "3D-Cart-Curve.txt", "Unknown", "Block 1","Y", FILE, "3D-Cart-Curve.txt", "Unknown", "Block 1","Z" ) To understand the complete syntax of the MDL statements mentioned above, please refer to the following MotionView MDL Reference Guide topics: *Curve() and *SetCurve(). |
MotionSolve writes out the 3D Cartesian curve as Reference_ParamCurve when exported to the MotionSolve XML format. Syntax: <Reference_ParamCurve id = "integer" label = “Name of the Curve” is_u_closed = { "TRUE" | "FALSE" } is_curve_points = { "TRUE" | "FALSE" } { matrix_id = "integer" > | u_start = "real" u_end = "real" usrsub_dll_name = "valid_path_name" usrsub_param_string = "USER( [[par_1][, ...][, par_n]] )" usrsub_fnc_name = "custom_fnc_name" > | u_start = "real" u_end = "real" script_name = valid_path_name interpreter = "PYTHON" | "MATLAB" usrsub_param_string = "USER( [[par_1 [, ...][,par_n]] )" usrsub_fnc_name = "custom_fnc_name" > | num_xyz_triple = "integer" > x1 y1 z1 x2 y2 z2 ... ... ... xn yn zn } /> In case of the 3D Cartesian curve, the model statement will be as shown below: <Reference_ParamCurve id = "301002" label = "3D_Cartesian" is_u_closed = "FALSE" is_curve_points = "TRUE" num_xyz_triple = "10"> 1.0000000E+00 2.0000000E+00 3.0000000E+00 2.0000000E+00 4.0000000E+00 6.0000000E+00 3.0000000E+00 6.0000000E+00 9.0000000E+00 4.0000000E+00 8.0000000E+00 1.2000000E+01 5.0000000E+00 1.0000000E+01 1.5000000E+01 6.0000000E+00 1.2000000E+01 1.8000000E+01 7.0000000E+00 1.4000000E+01 2.1000000E+01 8.0000000E+00 1.6000000E+01 2.4000000E+01 9.0000000E+00 1.8000000E+01 2.7000000E+01 0.0000000E+00 0.0000000E+00 0.0000000E+00 </Reference_ParamCurve> To understand the complete syntax of the Reference_ParamCurve XML model statement, please refer to the MotionSolve Reference Guide topic for Reference_ParamCurve. |
In MotionView, Tcl can be used to add any MDL entities to the model. There are two Tcl commands that can be used to add an entity:
The InterpretEntity command is used to add entities to the model and the InterpretSet command is used to set the entity properties. To understand the complete usage and syntax of these commands, please refer to the InterpretEntity and InterpretSet topics located within the HyperWorks Desktop Reference Guide. Note - When using the InterpretEntity and InterpretSet commands, it is important to also use the Evaluate command in order for the changes to take effect immediately. To learn how to create a complete model using Tcl commands, please refer to tutorial MV-1040: Model Building Using Tcl. |
In the case of a Parametric curve, a parameter U will be introduced more arbitrarily, mainly as a tool for describing the curve. One often uses the language of a point "moving" along the curve even in more abstract situations where the curve does not have a mechanical interpretation. An example use case for using 3D parametric curves is discussed below. The data of the u parameter of the curve is available in a File vector type. The X, Y, and Z vectors of the 3D Parametric curve are derived from the File based U vector. The example curve could be represented like this:
The values for the X and Y are computed using the Math expressions, by taking the u parameter as the reference values.
Curve Panel - Properties Tab
To know more about how define the curve data using the curve vector types, please refer to the Vector Types topic.
|
Syntax: *Curve(crv_name, "crv_label", 3D, PARAMETRIC, [WRITE|NOWRITE], [CONTROL_POINTS|CURVE_POINTS], OPEN|CLOSED]) Example: *Curve( crv_3D_para, "3D_Parametric", 3D, PARAMETRIC, WRITE, CURVE_POINTS, OPEN ) The syntax to define the curve data: *SetCurve(crv_name, Block-U, Block-X, Block-Y, Block-Z ) Block-X and Block-Y can be of the following three types: FILE: "[path]/filename", datatype, request, component MATH: expr VALUE: numpts, v1, v2, v3, ..., vn Example: *SetCurve(crv_3d_para, MATH, 1:100:1, MATH, crv_3d_para.u, MATH, crv_3d_para.u, MATH, cos(crv_3d_para.u)+sin(crv_3d_para.u) ) To understand the complete syntax of the MDL statements mentioned above, please refer to the following MotionView MDL Reference Guide topics: *Curve() and *SetCurve(). |
MotionSolve writes out the 3D Cartesian curve as Reference_ParamCurve when exported to the MotionSolve XML format. The syntax for the 3D Parametric curve is same as the 3D Cartesian curve. While getting exported to XML, MotionSolve writes out the values for X, Y, and Z by taking the U parameter as the reference value. The extent of the curve is governed by the number of U points (that is, the start and end points). Syntax: <Reference_ParamCurve id = "integer" label = “Name of the Curve” is_u_closed = { "TRUE" | "FALSE" } is_curve_points = { "TRUE" | "FALSE" } { matrix_id = "integer" > | u_start = "real" u_end = "real" usrsub_dll_name = "valid_path_name" usrsub_param_string = "USER( [[par_1][, ...][, par_n]] )" usrsub_fnc_name = "custom_fnc_name" > | u_start = "real" u_end = "real" script_name = valid_path_name interpreter = "PYTHON" | "MATLAB" usrsub_param_string = "USER( [[par_1 [, ...][,par_n]] )" usrsub_fnc_name = "custom_fnc_name" > | num_xyz_triple = "integer" > x1 y1 z1 x2 y2 z2 ... ... ... xn yn zn } /> To understand the complete syntax of the Reference_ParamCurve XML model statement, please refer to the MotionSolve Reference Guide topic for Reference_ParamCurve. |
In MotionView, Tcl can be used to add any MDL entities to the model. There are two Tcl commands that can be used to add an entity:
The InterpretEntity command is used to add entities to the model and the InterpretSet command is used to set the entity properties. To understand the complete usage and syntax of these commands, please refer to the InterpretEntity and InterpretSet topics located within the HyperWorks Desktop Reference Guide. Note - When using the InterpretEntity and InterpretSet commands, it is important to also use the Evaluate command in order for the changes to take effect immediately. To learn how to create a complete model using Tcl commands, please refer to tutorial MV-1040: Model Building Using Tcl. |
The following example shows the 3D curve entity in various formats:
*BeginMDL( the_model, "Model", "12.0.110.20" )
*StandardInclude(FILE) *SetCurrentSolverMode(MotionSolve) *Point( p_a, "Point A" ) *Point( p_b, "Point B" ) *SetPoint(p_b, 50) *Body( b_a, "Body A", p_a, , , , ) *Body( b_b, "Body B", p_b, , , , ) *Set( b_a.usecm, true ) *Set( b_b.usecm, true )
//Example for 3D Cartesian Curve *Curve( crv_3d_cart, "3D_Cartesian", 3D, CARTESIAN, WRITE, CURVE_POINTS, OPEN ) *SetCurve( crv_3d_cart, FILE, "D:/Documents/curve.csv", "Unknown", "Block 1", "column0", FILE, "D:/Documents/curve.csv", "Unknown", "Block 1", "column0", FILE, "D:/Documents/curve.csv", "", "", "" )
//Example for 3D Parametric Curve *Curve( crv_3d_para, "3D_Parametric", 3D, PARAMETRIC, WRITE, CURVE_POINTS, OPEN ) *SetCurve( crv_3d_para, FILE, "D:/Documents/curve.csv", "Unknown", "Block 1", "column0", FILE, "D:/Documents/curve.csv", "Unknown", "Block 1", "column0", FILE, "D:/Documents/curve.csv", "Unknown", "Block 1", "column0", FILE, "D:/Documents/curve.csv", "", "", "" )
*PointToCurveJoint( aj_ptcv_cartcrv, "PTCV_Cartesian_CurveValue", b_a, , p_a, crv_3d_cart, Global_Frame, aj_ptcv_cartcrv.rm ) *PointToCurveJoint( aj_ptcv_paracrv, "PTCV_Parametric_CurveValue", b_b, , p_b, crv_3d_para, Global_Frame, aj_ptcv_paracrv.rm ) *EndMDL() |
See Also:
*Curve() (MDL Model Statement)
*SetCurve() (MDL Model Statement)
Reference_ParamCurve (XML Command)
InterpretEntity (Tcl Command)
InterpretSet (Tcl Command)