api_hex_pattern
List of: Functions
Subjects: Patterns
Contents: Kernel

Action: Creates a hexagonal pattern in two or three dimensions.

Prototype: outcome api_hex_pattern (


pattern*& pat, // created pattern


const SPAvector& normal, // normal to pattern


const SPAvector& x_vec, // starting axis


int num_x, // repeat in x


int num_y, // repeat in y


int num_z // # times to



= 1, // repeat in z


AcisOptions* ao = NULL // acis options


);

Includes: #include "kernel/acis.hxx"

#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 hexagonal pattern in two or three dimensions. For two-dimensional patterns, the normal parameter specifies the direction normal to the pattern plane; for three-dimensional patterns, it sets the z-direction. The x_vec argument defines the pattern's starting axis and displacement; num_x, num_y, and num_z set the number of repetitions in each dimension over which the pattern extends.


The following code snippet shows an example of how this API can be used.


// Create a pattern

pattern* pat = NULL;

SPAvector normal(0, 0, 1);

SPAvector x_vec(2, 0, 0);

int num_x = 4;

int num_y = 4;

int num_z = 4;

check_outcome(result = api_hex_pattern(pat, normal, x_vec, num_x, num_y, num_z));


// Create a sphere

BODY* sph = NULL;

SPAposition center(1, 1, 0);

double radius = 1.0;

check_outcome(result = api_solid_sphere(center, radius, sph));


// Apply the pattern to the sphere

check_outcome(result = api_set_entity_pattern(sph, pat));


// Clean up

pat->remove();

Library: kernel

Filename: kern/kernel/kernutil/law/pattern_api.hxx

Effect: Changes model
PDF/KERN/16FNA.PDF
HTM/DATA/KERN/KERN/16FNA/0078.HTM