api_radial_pattern
List of: Functions
Subjects: Patterns
Contents: Kernel

Action: Creates a radial pattern.

Prototype: outcome api_radial_pattern (


pattern*& pat, // created pattern


const SPAposition& center,// center (root)




// position


const SPAvector& normal, // normal to pattern




// plane


int num_radial, // # of radial pattern




// rings


int num_angular, // # of polar pattern




// radii


double spacing, // distance between




// pattern rings


const SPAvector& start // start direction



=*(SPAvector*)NULL_REF,


logical not_rotate // rotation flag



= FALSE,


double start_angle // start angle



= 0.0,


double end_angle // end angle



= 2.0* 3.14159265358979323846,


double ratio // ratio of minor/major



= 1.0, // radii


AcisOptions* ao = NULL // acis options


);

Includes: #include "kernel/acis.hxx"

#include "baseutil/logical.h"

#include "baseutil/vector/position.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 two-dimensional radial pattern defined by a root position center (which may or may not lie upon the seed entity) and the vector normal, which sets the orientation of the pattern. The number of elements in the radial and angular directions are specified by num_radial and num_angular, respectively, and the distance between successive rings of the pattern by the spacing argument. The optional start argument specifies the direction of the first spoke of the pattern. The elements of the pattern are kept in a fixed relative orientation if not_rotate is TRUE. The start_angle and end_angle arguments fix the angular extent of the pattern, while the ratio argument sets the ratio of minor/major radii of the pattern perimeter. The pattern coordinates are specified in the order (radial, angular).


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


// Create a pattern

pattern* pat = NULL;

SPAposition center(0, 0, 0);

SPAvector normal(0, 0, 1);

int num_radial = 4;

int num_angular = 5;

double spacing = 3.0;

check_outcome(result = api_radial_pattern(pat, center, normal, num_radial, num_angular, spacing));


// 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
PDF/KERN/16FNA.PDF
HTM/DATA/KERN/KERN/16FNA/0118.HTM