Action:
|
Creates a linear pattern.
|
|
Prototype:
|
outcome api_linear_pattern (
|
|
|
pattern*& pat,
|
// created pattern
|
|
|
const SPAvector& x_vec,
|
// displacement vector
|
|
|
|
|
// in the x-direction
|
|
|
int num_x,
|
// # of elements in
|
|
|
|
|
// the x-direction
|
|
|
const SPAvector& y_vec
|
// displacement vector
|
|
|
|
=*(SPAvector*)NULL_REF,// in the y-direction
|
|
|
int num_y
|
// # of elements in
|
|
|
|
= 1,
|
// the y-direction
|
|
|
const SPAvector& z_vec
|
// displacement vector
|
|
|
|
=*(SPAvector*)NULL_REF,// in the z-direction
|
|
|
int num_z
|
// # of elements in
|
|
|
|
= 1,
|
// the z-direction
|
|
|
logical y_staggered
|
// flag to stagger the
|
|
|
|
= FALSE,
|
// pattern y-components
|
|
|
logical z_staggered
|
// flag to stagger the
|
|
|
|
= FALSE,
|
// pattern z-components
|
|
|
logical fit_distance
|
// displacement flag
|
|
|
|
= FALSE,
|
|
|
AcisOptions* ao = NULL
|
// acis options
|
|
|
);
|
|
Includes:
|
#include "kernel/acis.hxx"
|
|
#include "baseutil/logical.h"
|
|
#include "baseutil/vector/vector.hxx"
|
|
#include "kernel/kernapi/api/api.hxx"
|
|
#include "kernel/kernutil/law/pattern.hxx"
|
|
#include "kernel/kernutil/law/pattern_api.hxx"
|
|
#include "kernel/kernapi/api/acis_options.hxx"
|
|
Description:
|
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_linear_pattern(pat, x_vec, num_x, y_vec, num_y, z_vec, num_z));
|
|
|
// Create a prism
|
|
BODY* prism = NULL;
|
|
double height = 1.0;
|
|
double maj_rad = 1.0;
|
|
double min_rad = 0.5;
|
|
int num_sides = 3;
|
|
check_outcome(result = api_make_prism(height, maj_rad, min_rad, num_sides, prism));
|
|
|
// Apply the pattern to the prism
|
|
check_outcome(result = api_set_entity_pattern(prism, pat));
|
|
|
// Clean up
|
|
pat->remove();
|
|
Library:
|
kernel
|
|
Filename:
|
kern/kernel/kernutil/law/pattern_api.hxx
|
|
Effect:
|
Changes model
|