api_elliptical_pattern
List of: Functions
Subjects: Patterns
Contents: Kernel

Action: Creates an elliptical pattern.

Prototype: outcome api_elliptical_pattern (


pattern*& pat, // created pattern


const SPAposition& center,// center of pattern


const SPAvector& normal, // normal to pattern




// plane


int num_elements, // # of pattern elements


logical not_rotate // TRUE eliminates



= FALSE, // rotation of elements


const SPAposition& root // position mapped to



=*(SPAposition*)NULL_REF,// pattern sites


double angle // angular extent



= 2.0* 3.14159265358979323846,// of pattern


double ratio // ratio of major/minor



= 1.0, // radii


const SPAvector& major_axis// orientation of



=*(SPAvector*)NULL_REF,// major axis


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 one-dimensional elliptical pattern defined by an axis of rotation. The center and normal arguments indicate the (global) position and orientation of the axis. The number argument defines the number of entities in the pattern. These elements are kept in a fixed relative orientation if not_rotate is TRUE, in which case root, the position that is mapped to the pattern sites, must be specified. The angle argument fixes the angular extent of the pattern, with positive or negative values indicating a pattern proceeding clockwise or counter-clockwise about the normal vector. The ratio argument sets the ratio of minor/major radii of the pattern. If major_axis is given, it specifies the major axis of the pattern; otherwise, this axis is directed from center to root.


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


// Create a pattern

pattern* pat = NULL;

SPAposition center(10, 0, 0);

SPAvector normal(0, 0, 1);

int number = 12;

check_outcome(result = api_elliptical_pattern(pat, center, normal, number));


// 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();

Errors: The number of elements is less than one, or the user failed to supply a root position with not_rotate set to TRUE.

Library: kernel

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

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