Action:
|
Creates a hexagonal pattern with cylindrical symmetry.
|
|
Prototype:
|
outcome api_hex_cylindrical_pattern (
|
|
|
pattern*& pat,
|
// created pattern
|
|
|
const FACE* in_face,
|
// face defining
|
|
|
|
|
// the pattern
|
|
|
int num_angular,
|
// # of pattern elements
|
|
|
|
|
// about cylinder axis
|
|
|
int num_axial
|
// # of pattern elements
|
|
|
|
= 1,
|
// along cylinder axis
|
|
|
double spacing
|
// spacing of pattern
|
|
|
|
= 0.0,
|
// elements
|
|
|
AcisOptions* ao = NULL
|
// acis options
|
|
|
);
|
|
|
outcome api_hex_cylindrical_pattern (
|
|
|
pattern*& pat,
|
// created pattern
|
|
|
const SPAposition& center,// start position
|
|
|
const SPAvector& normal,
|
// direction of
|
|
|
|
|
// cylinder axis
|
|
|
int num_angular,
|
// # of pattern elements
|
|
|
|
|
// about cylinder axis
|
|
|
int num_axial
|
// # of pattern elements
|
|
|
|
= 1,
|
// along cylinder axis
|
|
|
double spacing
|
// spacing of pattern
|
|
|
|
= 0.0,
|
// elements
|
|
|
AcisOptions* ao = NULL
|
// acis options
|
|
|
);
|
|
Includes:
|
#include "kernel/acis.hxx"
|
|
#include "baseutil/vector/position.hxx"
|
|
#include "baseutil/vector/vector.hxx"
|
|
#include "kernel/kernapi/api/api.hxx"
|
|
#include "kernel/kerndata/top/face.hxx"
|
|
#include "kernel/kernutil/law/pattern.hxx"
|
|
#include "kernel/kernutil/law/pattern_api.hxx"
|
|
#include "kernel/kernapi/api/acis_options.hxx"
|
|
Description:
|
Creates a two-dimensional hexagonal pattern with cylindrical symmetry, with a radius and axis defined either by the center position and normal vector or by the cylindrical face
in_face. The number of angular and axial elements in the pattern are set by
num_angular and
num_axial, respectively, and the distance between pattern elements by spacing. The pattern coordinates are specified in the order (angular, axial).
|
|
|
The following code snippet shows an example of how this API can be used.
|
|
|
// Create a pattern
|
|
pattern* pat = NULL;
|
|
SPAposition center(5, 0, 0);
|
|
SPAvector normal(0, 1, 0);
|
|
int num_angular = 8;
|
|
int num_axial = 6;double spacing = 3.0;
|
|
check_outcome(result = api_hex_cylindrical_pattern(pat, center,
|
normal, num_angular, num_axial, spacing));
|
|
|
// Create a cylinder
|
|
BODY* cylinder = NULL;
|
|
SPAposition bottom(0, 0, 0);
|
|
SPAposition top(0.5, 0, 0);
|
|
double maj_rad = 1.0;
|
|
double min_rad = 1.0;
|
|
check_outcome(result = api_solid_cylinder_cone(bottom, top, maj_rad, min_rad, maj_rad, NULL, cylinder));
|
|
|
// Apply the pattern to the cylinder
|
|
check_outcome(result = api_set_entity_pattern(cylinder, pat));
|
|
|
// Clean up
|
|
pat->remove();
|
|
Library:
|
kernel
|
|
Filename:
|
kern/kernel/kernutil/law/pattern_api.hxx
|
|
Effect:
|
Changes model
|