api_polar_grid_pattern
List of: Functions
Subjects: Patterns
Contents: Kernel

Action: Creates a polar-grid pattern.

Prototype: outcome api_polar_grid_pattern (


pattern*& pat, // created pattern


const SPAposition& center,// center (root)




// position


const SPAvector& normal, // normal to pattern




// plane


int num_rings, // # of rings in pattern


double distance, // distance between




// pattern rings


const SPAvector& start // pattern start



=*(SPAvector*)NULL_REF,// direction


logical not_rotate // rotation flag



= FALSE,


logical hex_symmetry // force hex symmetry



= FALSE, // flag


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 polar-grid 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 rings in the grid (including the center) is specified by num_rings, and the distance between rings by spacing. The optional start argument specifies the direction of the first spoke of the pattern. The elements of the pattern are kept in a fixed orientation if not_rotate is TRUE; setting hex_symmetry to TRUE ensures that hexagonal symmetry is maintained for patterns extending either 360 or 180 degrees. The start_angle and end_angle arguments fix the angular extent of the pattern, in radians, and 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_rings = 5;

double spacing = 4.0;

check_outcome(result = api_polar_grid_pattern(pat, center,normal, num_rings, 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/0113.HTM