Model Element |
||||||||||||||||||||||||||||
Class NameSurface Description |
||||||||||||||||||||||||||||
Surface defines a parametric surface element in 3D space. A parametric surface is defined in terms of two free parameters: u and v. This means that the 3 coordinates (x,y,z) of any point P on the surface is a function of the two free parameters u and v. Surface is available in 3 flavors. Attribute Summary |
||||||||||||||||||||||||||||
Usage#1: Defined in a compiled user-written subroutine Surface (function=userString, routine=string, optional_attributes)
#2: Defined in a Python script Surface (function=userString, routine=functionPointer, optional_attributes) |
||||||||||||||||||||||||||||
Attribute Description |
||||||||||||||||||||||||||||
Defined 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∷mySurface”
The attribute routine is optional. When not specified, routine defaults to SURSUB. |
|||||||||||||||||||||||||||
Defined in a Python function |
||||||||||||||||||||||||||||
function |
String The list of parameters that are passed from the data file to the user defined Python function. The function attribute is mandatory |
|||||||||||||||||||||||||||
routine |
Pointer to a callable function in Python An example is: routine=mySurface”
The attribute routine is optional. When not specified, routine defaults to SURSUB. |
|||||||||||||||||||||||||||
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. |
|||||||||||||||||||||||||||
uclosed |
Boolean If the surface is closed in the u parametric space, select True. The uclosed attribute is optional. When not specified, it defaults to False. |
|||||||||||||||||||||||||||
vclosed |
Boolean If the surface is closed in the v parametric space, select True. The vclosed attribute is optional. When not specified, it defaults to False |
|||||||||||||||||||||||||||
minpar |
List of 2 Doubles Specifies the list of minimum value of u and v. The minpar attribute is optional. When not specified, it defaults to [-1,-1] Note, when specified, minpar < maxpar. |
|||||||||||||||||||||||||||
maxpar |
List of 2 Doubles Specifies the list of maximum value of u and v. The maxpar attribute is optional. When not specified, it defaults to [+1,+1] Note, when specified, minpar < maxpar. |
|||||||||||||||||||||||||||
Comments
|
||||||||||||||||||||||||||||
Example
|
||||||||||||||||||||||||||||
#Define the surface in the function cylindricalSurface () from math import sin, cos, pi def cylindricalSurface (id, par, npar, u, v, iord, iflag):
values = [] r = par [0]
if iord == 0: values.append (r * cos (u)) # x values.append (r * sin (u)) # y values.append (v) # z
elif iord == 1: values.append (-r * sin (u)) # dx / du values.append ( r * cos (u)) # dy / du values.append (0.0) # dz / du values.append (0.0) # dx / dv values.append (0.0) # dy / dv values.append (1.0) # dz / dv
elif iord == 2: values.append (-r * cos (u)) # d2x / du du values.append (-r * sin (u)) # d2y / du du values.append (0.0) # d2z / du du values.append (0.0) # d2x / du dv values.append (0.0) # d2y / du dv values.append (0.0) # d2z / du dv values.append (0.0) # d2x / dv dv values.append (0.0) # d2y / dv dv values.append (0.0) # d2z / dv dv
elif iord == 3: values.append ( r * sin (u)) # d3x / du du du values.append (-r * cos (u)) # d3y / du du du values.append (0.0) # d3z / du du du values.append (0.0) # d3x / du du dv values.append (0.0) # d3y / du du dv values.append (0.0) # d3z / du du dv values.append (0.0) # d3x / du dv dv values.append (0.0) # d3y / du dv dv values.append (0.0) # d3z / du dv dv values.append (0.0) # d3x / dv dv dv values.append (0.0) # d3y / dv dv dv values.append (0.0) # d3z / dv dv dv
# Return the computed values return values
# Define the Surface and refer to the user-subroutine cylindricalSurface () mysurface = Surface (function=”user (10)”, routine=cylindricalSurface, uclosed=True,
|