Tutorial Toolkit Function Descriptions > Geometry > Curve
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Curve
  
asm_db_get_curve_geo
( curve_id, geo_coefs, status )
Description:
Get the geometric format of a curve.
Input:
INTEGER
curve_id
Curve id (internal db id).
Output:
REAL
geo_coefs(12)
Geometric coefficients of the curve.
INTEGER
status
0 , no error.
-1 , data base not responding.
Example:
Please see asm_db_get_curve_geo (p. 516) in the MSC Acumen Toolkit - Code Example.
  
asm_db_get_next_line_label
( domessage, integerlabel, stringlabel )
Description:
Get the next highest line label from the database.
Input:
LOGICAL
domessage
Tells the routine to issue an error message if an error occurs.
Output:
INTEGER
integerlabel
The next highest curve label.
STRING
stringlabel
0 , no error.
-1 , data base not responding.
INTEGER
<Return Value>
Success or an error code.
Example:
Please see asm_db_get_next_line_label (p. 521) in the MSC Acumen Toolkit - Code Example.
  
asm_const_curve_2d_arc2point_v2
(output_ids, num_curves, arc_method, radius,create_center, center_rev_direction, arc_angle,plane_list, center_point_list, start_point_list,end_point_list, project_points, created_ids)
Description:
This function creates an arc from ‘two points and center point’ or from ‘start, end point and radius’.
Input:
 
 
STRING
output_ids[]
This value specifies the curve ID list. If this value is set to an empty string or to “#”, the function will automatically allocate and assign a sequential list of curve IDs.
INTEGER
num_curves
Number of curves to be created.
INTEGER
arc_method
This value specifies the arc method: 1 = define arc by center, start and end points, and 2 = define arc by start point, end point and radius.
REAL
radius
This value specifies the arc radius if the input value arc_method is set to 2.
LOGICAL
create_center
This value is set to TRUE if the arc center point is to be created along with the arc and if the input value arc_method is equal to 2.
LOGICAL
center_rev_direction
This value is set to TRUE if the arc center is to be flipped/rotated in the counter-clockwise direction before the arc is created and if the input value arc_method is equal to 2.
INTEGER
arc_angle
This value specifies the arc angle to use: 1 = minimum arc angle, and 2 = maximum arc angle.
STRING
plane_list[]
This value specifies the list of planes in which to construct the arcs.
STRING
center_point_list[]
This value specifies the list of points defining the center points of the circular arcs.
STRING
start_point_list[]
This value specifies the list of points defining the starting points of the circular arcs.
STRING
end_point_list[]
This value specifies the list of points defining the ending points of the circular arcs.
LOGICAL
project_points
This value specifies, when set to TRUE, that the center points be projected onto the plane. When this value is set to FALSE and the input value arc_method is not set to 2, the construction plane will be translated to the center point location and will still be parallel to the original plane. If this value is set to FALSE and the input value arc_method is set to 2, the construction plane is translated to the starting point location and will still be parallel to the original plane.
Output:
STRING
created_ids[VIRTUAL]
This value returns the created ID list.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
38000845
 
Unable to acquire %I% words of virtual memory.
38000424
 
The center point and start point define a zero radius.
38000413
 
Zero length plane normal vector
38000440
 
Invalid 2D Arc2Point method. Must be 1 or 2. Try again.
1000578
 
The number of Curves per Arc must be greater than or equal to one. The invalid value input was %I%
38000442
 
The Radius value of %G% is too small for the input start and end points. Radius magnitude must be at least %G%. Modify application input and try again.
38000418
 
The Arc radius must be greater than zero. Invalid value input was %G%
Example:
Please see asm_const_curve_2d_arc2point_v2 (p. 507) in the MSC Acumen Toolkit - Code Example.
  
asm_const_curve_2d_arc3point_v1
(output_ids, num_curves, create_center, plane_list, start_list, mid_list, end_list, project_flag, created_ids)
Description:
This function creates an arc-shaped or parametric cubic curve in two dimensional space, defined by a start point, midpoint, and an end point.
Input:
STRING
output_ids[]
This value specifies the curve ID list. If this value is set to an empty string or to “#”, the function will automatically allocate and assign a sequential list of curve IDs.
INTEGER
num_curves
This value specifies the number of curves per arc to create.
LOGICAL
create_center
This value is set to TRUE if a point is to be created at the center of the arc.
STRING
plane_list[]
This value specifies the construction plane of the arc.
STRING
start_list[]
This value specifies the start point of the arc.
STRING
mid_list[]
This value specifies the midpoint of the arc.
STRING
end_list[]
This value specifies the end point of the arc.
LOGICAL
project_flag
TRUE if the center point is to be projected onto the plane.
Output:
STRING
created_ids[VIRTUAL]
This value returns the created ID list.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
38000845
 
Unable to acquire %I% words of virtual memory.
38000423
 
The three points specified are nearly collinear.
38000413
 
Zero length plane normal vector
1000578
 
The number of Curves per Arc must be greater than or equal to one. The invalid value input was %I%
Example:
Please see asm_const_curve_2d_arc3point_v1 (p. 509) in the MSC Acumen Toolkit - Code Example.
  
asm_const_curve_2d_circle_v1
(output_ids, num_curves, radius_method, radius, plane_list, radius_point_list, center_point_list, created_ids)
Description:
This function creates a circular-shaped or parametric cubic curve in two-dimensional space, defined by a center point and a radius.
Input:
STRING
output_ids[]
This value specifies the curve ID list. If this value is set to an empty string or to “#”, the function will automatically allocate and assign a sequential list of curve IDs.
INTEGER
num_curves
This value specifies the number of curves per circle to create.
INTEGER
radius_method
This value specifies the method used to define a radius: 1 = scalar radius value, and 2 = point location.
REAL
radius
This value specifies the radius of the circle if the input value radius_method is set to 1.
STRING
plane_list[]
This value specifies the list of planes in which to construct the arcs.
STRING
radius_point_list[]
This value specifies the list of points defining the radius of the circle if the input value radius_method is set to 2.
STRING
center_point_list[]
This value specifies the list of points defining the center point of the circle.
LOGICAL
project_flag
TRUE if the center point is to be projected onto the plane.
Output:
STRING
created_ids[VIRTUAL]
This value returns the created ID list.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
38000845
 
Unable to acquire %I% words of virtual memory.
38000413
 
Zero length plane normal vector
38000425
 
The Circle radius must be greater than zero. Invalid value input was %G%
38000426
 
The center point and start point define a zero radius.
1000579
 
The number of Curves per Circle must be greater than or equal to two. The invalid value input was %I%.
Example:
Please see asm_const_curve_2d_circle_v1 (p. 510) in the MSC Acumen Toolkit - Code Example.
  
asm_const_curve_project_v1
(output_ids, curve_list, entity_list, entity_type, delete_original, method, vector, coord_frame, num_curves, projection_tolerance, created_ids)
Description:
This function creates a parametric cubic curve from the projection of curves onto surfaces.
Input:
STRING
output_ids[]
This value specifies the curve ID list. If this value is set to an empty string or to “#”, the function will automatically allocate and assign a sequential list of curve IDs.
STRING
curve_list[]
This value specifies the curve list to project.
STRING
entity_list[]
This value specifies the entity list to project onto.
INTEGER
entity_type
The entity type to be projected.
LOGICAL
delete_original
This value is set to TRUE if the original curves to project are to be deleted after the projection. If this value is set to FALSE, the original entities will not be deleted.
INTEGER
method
This value specifies the projection method: 1 = the curve to be projected lies in a plane and it is desired to project the curve normal to this plane, 2 = the direction of projection is normal to the surface at the point of closest approach, 3 = the direction of projection is given by a vector, and 4 = the direction of projection is the view vector.
STRING
vector[]
This value specifies the projection vector.
STRING
coord_frame[]
This value specifies the coordinate frame ID for the projection vector.
INTEGER
num_curves
This value specifies the number of curves per projection to create. If this value is set to 0, then the number of curves created will be based on the projection tolerance.
REAL
projection_tolerance
This value specifies a tolerance parameter determining the density of intersection points generated.
Output:
STRING
created_ids[VIRTUAL]
This value returns the created ID list.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see asm_const_curve_project_v1 (p. 512) in the MSC Acumen Toolkit - Code Example.
  
curve_arc_to_parm
(curve_id, num_values, arc_lengths, parametric_coord, status )
 
Description:
This function determines the corresponding coordinates for various input values of percent arclength along a curve.
Input:
INTEGER
curve_id
The id of the curve for which data is required.
INTEGER
num_values
The number of values for which the parametric coordinates are required.
REAL ARRAY
arc_lengths(num_values)
Array of arc lengths at which the parameters are desired.
Output:
REAL ARRAY
parametric_coord(num_values)
Array of parametric coordinates for the curve.
INTEGER
status
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see curve_arc_to_parm (p. 525) in the MSC Acumen Toolkit - Code Example.
  
curve_parm_to_arc
(curve_id, num_values, parameters, arc_lengths, status )
Description:
This function determines the corresponding arc length coordinates for various input values of parametric coordinates along a curve.
Input:
INTEGER
curve_id
The id of the curve for which data is required.
INTEGER
num_values
The number of values for which the arc lengths are required.
REAL ARRAY
parameters(num_values)
Array of parametric coordinates for the curve at which the arc lengths are desired.
Output:
REAL ARRAY
arc_lengths(num_values)
Array of arc lengths.
INTEGER
status
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see curve_parm_to_arc (p. 527) in the MSC Acumen Toolkit - Code Example.
  
db_count_curve
( count )
Description:
Counts all curves in the database.
Input:
none
Output:
INTEGER
count
The integer number of curves in the database.
INTEGER
<Return Value>
Integer indicating success or failure of the routine. If the routine failed, this value contains an indication of the reason.
Example:
Please see db_count_curve (p. 531) in the MSC Acumen Toolkit - Code Example.
 
db_get_curve_coo_and_type
( id, coo, type )
  
Description:
Gets a geometric coo and type from the database given an id.
Input:
INTEGER
id
The unique internal curve id identifying the association of the information to be retrieved from the database.
Output:
INTEGER
coo
The geometric company of origin stored in the database.
INTEGER
type
The geometric type of data stored in the database.
INTEGER
<Return Value>
Integer indicating success or failure of the routine. If the routine failed, this value contains an indication of the reason.
Example:
Please see db_get_curve_coo_and_type (p. 544) in the MSC Acumen Toolkit - Code Example.
  
db_get_curve_id
( label, id )
Description:
Gets a curve id from the database given a curve label.
Input:
INTEGER
label
The unique external curve id identifying the curve to be retrieved from the database
Output:
INTEGER
id
The unique internal curve id identifying the curve retrieved from the database.
INTEGER
<Return Value>
Integer indicating success or failure of the routine. If the routine failed, this value contains an indication of the reason.
Example:
Please see db_get_curve_id (p. 546) in the MSC Acumen Toolkit - Code Example.
  
db_get_curve_label
( id, label )
Description:
Gets a curve label from the database given a curve id.
Input:
INTEGER
id
The unique internal curve id identifying the curve to be retrieved from the database.
Output:
INTEGER
label
The unique external curve id identifying the curve to be retrieved from the database.
INTEGER
<Return Value>
Integer indicating success or failure of the routine. If the routine failed, this value contains an indication of the reason.
Example:
Please see db_get_curve_label (p. 547) in the MSC Acumen Toolkit - Code Example.
  
db_get_max_curve_label
( label )
Description:
Gets the largest curve label from the database.
Input:
none
Output:
INTEGER
label
Highest curve label used.
INTEGER
<Return Value>
Integer indicating success or failure of the routine. If the routine failed, this value contains an indication of the reason.
Example:
Please see db_get_max_curve_label (p. 551) in the MSC Acumen Toolkit - Code Example.
  
db_get_min_curve_label
( label )
Description:
Gets the smallest curve label from the database.
Input:
none
Output:
INTEGER
label
Lowest curve label used.
INTEGER
<Return Value>
Integer indicating success or failure of the routine. If the routine failed, this value contains an indication of the reason.
Example:
Please see db_get_min_curve_label (p. 556) in the MSC Acumen Toolkit - Code Example.
 
sgm_associate_nodes_curve
(node_list, curve_list)
  
Description:
This function associates nodes with a given set of curves.
Input:
STRING
node_list[ ]
The list of nodes to be associated with the curves.
STRING
curve_list[ ]
The list of curves to which the nodes are to be associated.
Output:
INTEGER
<Return_value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see sgm_associate_nodes_curve (p. 577) in the MSC Acumen Toolkit - Code Example.
  
sgm_const_curve_project_v1
(output_ids, curve_list, surface_list,entity_type, delete_original, project_method, vector, coord_frame, projection_tolerance, created_ids)
Description:
This function constructs curves on a set of surfaces by projecting an existing set of curves along a projection vector onto a set of surfaces.
Input:
STRING
output_ids[]
This value specifies the curve ID list. If this value is set to an empty string or to “#”, the function will automatically allocate and assign a sequential list of curve IDs.
STRING
curve_list[]
This value specifies the list of curves to project onto the list of surfaces.
STRING
surface_list[]
This value specifies the list of surfaces onto which the curves are to be projected.
INTEGER
entity_type
=1 Project to surface
=2 Project to plane
LOGICAL
delete_original
This value is set to TRUE if the original curves are to be deleted. If this value is set to FALSE, the original entities will not be deleted.
INTEGER
project_method
This value specifies the method of defining the projection vector: 1 = the curves to be projected lie in a plane and it is desired to project the curves normal to this plane, 2 = the direction of projection is normal to the surface at the point of closest approach to the curve, 3 = the direction of projection is to be given by a vector, and 4 = the direction of projection is the view vector.
STRING
vector[]
This value specifies the projection vector.
STRING
coord_frame[]
This value specifies the coordinate frame for the projection vector.
REAL
projection_tolerance
This value specifies a tolerance parameter. The algorithm creates all curves along the projected surface so that the maximum distance lies between them is the distance defined by this value.
Output:
STRING
created_ids[VIRTUAL]
This value returns the created ID list.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see sgm_const_curve_project_v1 (p. 579) in the MSC Acumen Toolkit - Code Example.
  
sgm_create_curve_on_surface
(direction, param_value, surface_blob, curve_blob)
Description:
This function creates curve on a surface in any of the u /v directions at a given parameter and returns the blob of the curve created.
Input:
INTEGER
direction
The direction to create the curve.
1 = u direction , 2 = v direction.
REAL
param_value
The value of the parameter for creating the curve (0 < param_value < 1)
REAL ARRAY
surface_blob()
The blob of the surface on which to create the curve. The functions to be used for getting the blob are sgm_db_get_blob_size() followed by sgm_db_get_surface().
Output:
REAL ARRAY
curve_blob()
The blob of the curve returned. The functions to be used for getting the blob size are sgm_db_get_blob_size() followed by sgm_db_get_curve().
INTEGER
<Return_value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see sgm_create_curve_on_surface (p. 585) in the MSC Acumen Toolkit - Code Example.
 
sgm_curve_convert_s_to_u
(curve_data, num_points, arc_lengths, parametric_coord, status )
  
Description:
This function determines the corresponding coordinates for various input values of percent arclength along the curve.
Input:
REAL ARRAY
curve_data()
The blob of curve the curve for which data is required. The functions to be used for getting the blob are sgm_db_get_blob_size() followed by sgm_db_get_curve().
INTEGER
num_points
The number of points for which the parametric coordinates are required.
REAL ARRAY
arc_lengths
(num_points)
Array of arc lengths at which the parameters are desired.
 
Output:
REAL ARRAY
parametric_coord
(num_points)
Array of parametric coordinates for the curve.
INTEGER
status
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see sgm_curve_convert_s_to_u (p. 597) in the MSC Acumen Toolkit - Code Example.
  
sgm_curve_convert_u_to_s
(curve_data, num_points, parameters, arc_lengths, status )
Description:
This routine determines the corresponding arclength coordinates for various input values of parametric coordinates along the curve.
Input:
REAL ARRAY
curve_data()
The blob of curve the curve for which data is required. The functions to be used for getting the blob are sgm_db_get_blob_size() followed by sgm_db_get_surface().
INTEGER
num_points
The number of points for which the arc lengths are required.
REAL ARRAY
parameters(num_points)
Array of parametric coordinates for the curve at which the arc lengths are desired.
Output:
REAL ARRAY
arc_lengths(num_points)
Array of arc lengths at the parameters.
INTEGER
status
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see sgm_curve_convert_u_to_s (p. 599) in the MSC Acumen Toolkit - Code Example.
  
sgm_curve_evaluate
(blob, para_parameter, out_type, output_data, status )
 
Description:
This function will evaluate a data table representing the geometry of a curve, returning information about the point of origin and the first, second, and third derivatives of the curve.
Input:
REAL
blob( )
This value specifies the curve data table. This array must be allocated with at least 6 offsets and no more than the number of offsets set by the following formula: s(s(6)). The value stored in the array at offset 6 must be equal to or greater than 0. See the comments below.
REAL
para_parameter
This value specifies a parametric coordinate value and has a range from 0.0 to 1.0.
INTEGER
out_type
This value specifies the type output expected from this function call. See the remarks below.
Output:
REAL
output_data (n,3)
This value returns the output data table. See the remarks below.
INTEGER
status
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Remarks:
The input value out_type can be set to the following values:
 
Value
Description
0
Output point information only.
1
Output point and first derivative information.
2
Output point, first, and second derivative information. For an “N dimensional cubic spline” this value would cause the point, first and second derivitive of the first three dimensional vector to be returned.
3
Output point, first, second, and third derivatives.
The output value output_data should have its first dimension allocated to the following sizes:
 
para_parameter value
output_data first dimensional value
0
4
1
4
2
4
3
4
A curve data table can be retrieved with a call to the sgm_db_get_curve() PCL function. The size of the data curve table can be retrieved with a call to the PCL function sgm_db_get_blob_size().
Example:
Please see sgm_curve_evaluate (p. 602) in the MSC Acumen Toolkit - Code Example.
  
sgm_db_get_curve
( curveid, blobsize, blob, status )
Description:
Get the geometric definition of a curve from the database.
Input:
INTEGER
curveid
Id of the curve.
INTEGER
blobsize
Size of the blob in words.
Output:
REAL
blob ( )
Geometric description of the curve.
INTEGER
status
Success or an error code.
Error Conditions:
38000001
The allocated space for the blob is too small.
Example:
See example for sgm_curve_evaluate, 214. See also sgm_db_get_curve (p. 607) in the MSC Acumen Toolkit - Code Example.
 
 
    
sgm_get_arc_center_radius
(arc_id, start_point, center_point, radius)
Description:
This function gets the start point, center point and the radius for any arc.
Input:
INTEGER
arc_id
The id for the arc.
Output:
REAL ARRAY
start_point(3)
The starting point of the curve.
REAL ARRAY
center_point(3)
The center point of the curve.
REAL
radius
The radius of the curve.
INTEGER
<Return_value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see sgm_get_arc_center_radius (p. 647) in the MSC Acumen Toolkit - Code Example.
  
sgm_get_curve_length
( curveid, length )
Description:
Gets the length of a curve.
Input:
INTEGER
curveid
The ID of the curve.
Output:
REAL
length
The length of the curve.
INTEGER
<Return Value>
0: successful, otherwise return error code.
Example:
Please see sgm_get_curve_length (p. 651) in the MSC Acumen Toolkit - Code Example.
  
sgm_node_on_curve
( geotol, num_crvs, crv_id_list, list_size, init_flag, num_nodes, node_id_list, node_u_list )
Description:
Get the nodes close to the given curves within the geometric tolerance.
Input:
REAL
geotol
The geometric tolerance.
INTEGER
num_crvs
The number of the given curves.
INTEGER
crv_id_lis (num_crvs)
The ID list of the given curves.
INTEGER
list_size
The size of the node_id_list.
INTEGER
init_flag
Initial call ( = 0 ) or continued call ( = 1 ).
Output:
 
 
INTEGER
num_nodes ( )
The number of the nodes found.
INTEGER
node_id_list (num_nodes)
The ID list of the nodes found.
REAL
node_u_list (num_nodes)
The list of the node parameter U.
INTEGER
<Return Value>
Success or an error code.
Comments:
If the node_id_list is not BIG enough to accommodate all found nodes, the return value is 9999. Allocate another memory space, set init_flag == 1, call this routine again to get the rest nodes. ( until <return value> == 0 ).
Error Conditions:
1000025
Error attempting to allocate virtual memory.
1000564
Data for curve %I% not found.
48000004
No Node found
1000547
No curves were found to exist in the database as defined in the curve list. The curve list input was %A%
Example:
Please see sgm_node_on_curve (p. 662) in the MSC Acumen Toolkit - Code Example.
  
sgm_show_angle_between_curves
(curvelist_1, curvelist_2, seg_id, marker_type, marker_color, marker_size, angle)
Description:
This function gets the angle between any two curves and marks it on the user interface.
Input:
STRING
curvelist_1[ ]
The first list of curves.
STRING
curvelist_2[ ]
The second list of curves.
INTEGER
seg_id
The id of the segment for the marker.
INTEGER
marker_type
The type of marker for the angle.
INTEGER
marker_color
The color of marker for the angle.
INTEGER
marker_size
The size of marker for the angle.
Output:
STRING
angle[ ]
The value of the angle between the curve.
INTEGER
<Return_value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see sgm_show_angle_between_curves (p. 668) in the MSC Acumen Toolkit - Code Example.