Model Element |
||||||||||||||||||||||||||||||||||
Class NameCurve Description |
||||||||||||||||||||||||||||||||||
Curve defines a parametric curve in 3D space. A parametric curve has one free parameter, u, and three associated functions f(u), g(u) and h(u). For every value, u=u*, f(u*), g(u*), and h(u*) represent the coordinates of a point in space. As u is swept from its minimum to maximum value, a curve in 3D space is generated. For additional information on the definition of Curve, please see the Description and the Comments section of Reference_ParamCurve. |
||||||||||||||||||||||||||||||||||
Attribute Summary
|
||||||||||||||||||||||||||||||||||
Usage |
||||||||||||||||||||||||||||||||||
Curves are available in three different forms. |
||||||||||||||||||||||||||||||||||
#1: Curve data provided in a Matrix Curve (matrix=objMatrix, type=string, curve_points=Boolean, optional_attributes)
#2. Curve specified in a compiled user-written subroutine Curve (function=userString, routine=string, type=string, optional_attributes)
#3. Curve specified in a Python function Curve (function=userString, routine=functionPointer, type=string, curve_points=boolean, optional_attributes) |
||||||||||||||||||||||||||||||||||
Attribute Description |
||||||||||||||||||||||||||||||||||
Curve data provided in a Matrix |
||||||||||||||||||||||||||||||||||
matrix |
Reference to an existing matrix object. Specifies the Matrix that contains the curve data. The matrix should contain only the x-, y-, and z- data for the individual curve points. Note For a closed curve, the first and last data points must be the same. The matrix attribute is mandatory. |
|||||||||||||||||||||||||||||||||
type |
String Select from "OPEN" or "CLOSED". Note For a closed curve, the first and last data points must be the same. The type attribute is mandatory. |
|||||||||||||||||||||||||||||||||
curve_points |
Boolean Select from TRUE or FALSE.
The curve_points attribute is mandatory. |
|||||||||||||||||||||||||||||||||
Curve specified in a compiled user-written subroutine |
||||||||||||||||||||||||||||||||||
function |
String The list of parameters that are passed from the data file to the user-defined subroutine. The function attribute is mandatory |
|||||||||||||||||||||||||||||||||
routine |
String Specifies an alternative name for the user subroutine. The name consists of two pieces of information, separated by “∷”. The first is the pathname to the shared library containing the function that computes the response of the user-defined Surface. The second is the name of the function in the shared library that does the computation. An example is: routine=”/staff/Altair/engine.dll∷myCurve”
The attribute routine is optional. When not specified, routine defaults to CURSUB. The attribute routine is optional. |
|||||||||||||||||||||||||||||||||
type |
String Select from "OPEN" or "CLOSED". Note For a closed curve, the first and last data points must be the same. The type attribute is mandatory. |
|||||||||||||||||||||||||||||||||
minpar |
Double Specifies the minimum value of the curve parameter. The minpar attribute is optional. When not specified, it defaults to -1. Note When specified, minpar < maxpar. |
|||||||||||||||||||||||||||||||||
maxpar |
Double Specifies the maximum value of the curve parameter. The maxpar attribute is optional. When not specified, it defaults +1. Note When specified, minpar < maxpar. |
|||||||||||||||||||||||||||||||||
Curve specified in a Python function |
||||||||||||||||||||||||||||||||||
function |
String The list of parameters that are passed from the data file to the user-defined subroutine. The function attribute is mandatory |
|||||||||||||||||||||||||||||||||
routine |
Pointer to a callable function in Python. An example is: routine=myCurve”
The attribute routine is optional. When not specified, routine defaults to CURSUB. |
|||||||||||||||||||||||||||||||||
type |
String Select from "OPEN" or "CLOSED". Note: For a closed curve, the first and last data points must be the same. The type attribute is mandatory. |
|||||||||||||||||||||||||||||||||
minpar |
Double Specifies the minimum value of the curve parameter. The minpar attribute is optional. When not specified, it defaults to -1. Note, when specified, minpar < maxpar. |
|||||||||||||||||||||||||||||||||
maxpar |
Double Specifies the maximum value of the curve parameter. The maxpar attribute is optional. When not specified, it defaults +1. Note, when specified, minpar < maxpar. |
|||||||||||||||||||||||||||||||||
Optional Attributes – Available to all description methods |
||||||||||||||||||||||||||||||||||
id |
Integer Specifies the element identification number. This number must be unique among all the Surface objects in the model. This attribute is optional. MotionSolve will automatically create an ID when one is not specified. Range of values: id > 0 |
|||||||||||||||||||||||||||||||||
label |
String Specifies the name of the Surface object. This attribute is optional. When not specified, MotionSolve will create a label for you. |
|||||||||||||||||||||||||||||||||
Comments
|
||||||||||||||||||||||||||||||||||
ExampleA cycloid is defined in parametric space as: x = a * (t – sin(t)) y = a * (1-cos(t)) “t” is the independent parameter. The cycloid is shown in the image below. A parametrically defined cycloid curve |
||||||||||||||||||||||||||||||||||
The statement defining the cycloid described above has the following curve attributes:
The corresponding MotionSolve Python specification is: |
||||||||||||||||||||||||||||||||||
# Note, since curve_points=True, MINPAR=-1 and MAXPAR=+1. # This range in u will accommodate all the data provided in the matrix. curve1 = Curve (type=”OPEN”, curve_points=True, matrix=mat23) |
||||||||||||||||||||||||||||||||||
This example shows how to specify exactly the same for implementation in a user-defined subroutine written in Python: |
||||||||||||||||||||||||||||||||||
# The cycloid function saved in file: cycloid.py from msolve import sin, cos def cycloid (id, par, npar, t, iord, iflag): a = par[0] if iord == 0: x = a * (t – sin(t)) y = a * (1 – cos(t)) z = 0.0 elif iord == 1: x = a * (1 – cos(t)) y = a * sin(t) z = 0.0 else: x = a * sin(t) y = a * cos(t) z = 0.0
return [x, y, z] |
||||||||||||||||||||||||||||||||||
The corresponding MotionSolve Python specification is: |
||||||||||||||||||||||||||||||||||
curve2 = Curve (function=”USER(1)”, routine=cycloid, type=”OPEN”, minpar=0, maxpar=6) |