All Frameworks  Class Hierarchy  This Framework  Indexes

SPAkern Global Function api_pattern_create_linear


outcome api_pattern_create_linear(pattern*& pat,
const SPAvector& x_vec,
int num_x,
const SPAvector& y_vec= *(SPAvector*)NULL_REF,
int num_y= 1,
const SPAvector& z_vec= *(SPAvector*)NULL_REF,
int num_z= 1,
logical y_staggered= FALSE,
logical z_staggered= FALSE,
logical fit_distance= FALSE,
AcisOptions* ao= NULL)
Creates a linear pattern.

Role: Creates a linear pattern in one, two, or three dimensions, depending upon the number of input arguments. The pattern orientation is specified by x_vec, y_vec, and z_vec, which are neither required to be in the coordinate directions nor to be orthogonal. The number of repetitions along each axis is defined by num_x, num_y, and num_z. If y_staggered or z_staggered is TRUE, the pattern is staggered along the associated directions. If fit_distance is TRUE, the vectors x_vec, y_vec, and z_vec represent displacements over the entire pattern rather than displacements between adjacent pattern elements.

The following code snippet shows an example of how this API can be used.
 // Create a pattern
 pattern* pat = NULL;
 SPAvector x_vec(2, 0, 0);
 int num_x = 4;
 SPAvector y_vec(0, 2, 0);
 int num_y = 3;
 SPAvector z_vec(1, 1, 2);
 int num_z = 3;
 check_outcome(result = api_pattern_create_linear(pat, x_vec, num_x, 
     y_vec, num_y, z_vec, num_z));

 // Create a prism
 double height = 1.0;
 double maj_rad = 1.0;
 double min_rad = 0.5;
 int num_sides = 3;
 BODY* prism = NULL;
 check_outcome(result = api_make_prism(height, maj_rad, 
     min_rad, num_sides, prism));

 // Apply the pattern to the prism
 check_outcome(result = api_pattern_apply_to_entity(prism, pat));

 // Clean up
 check_outcome(result = api_pattern_destroy(pat));
Effect: Changes model

Journal: Not Available

Parameters:
pat
created pattern.
x_vec
displacement vector in the x-direction.
num_x
# of elements in the x-direction.
y_vec
displacement vector in the y-direction.
num_y
# of elements in the y-direction.
z_vec
displacement vector in the z-direction.
num_z
# of elements in the z-direction.
y_staggered
flag to stagger the pattern y-components.
z_staggered
flag to stagger the pattern z-components.
fit_distance
displacement flag acis options.
ao
acis options.

This object is included in the file: pattern_api.hxx

Copyright (c) 1989-2007 by Spatial Corp. All rights reserved.