api_cylindrical_pattern
List of: Functions
Subjects: Patterns
Contents: Kernel

Action: Creates a pattern with cylindrical symmetry.

Prototype: outcome api_cylindrical_pattern (


pattern*& pat, // created pattern


const FACE* in_face, // face defining pattern




// axis and radius


int num_angular, // # of pattern elements




// about cylinder axis


int num_axial // # of pattern elements



= 1, // along cylinder axis


double ring_spacing // distance between



= 0.0, // circular pattern




// layers


logical alternating // flag to stagger angle



= FALSE, // between layers


AcisOptions* ao = NULL // acis options


);


outcome api_cylindrical_pattern (


pattern*& pat, // created pattern


const SPAposition& center,// starting position for




// cylinder axis


const SPAvector& normal, // direction of the




// cylinder axis


int num_angular, // # of pattern elements




// about cylinder axis


int num_axial // # of pattern elements



= 1, // along cylinder axis


double ring_spacing // distance between



= 0.0, // circular pattern




// layers


logical alternating // flag to stagger angle



= FALSE, // between layers


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/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 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 numbers of angular and axial elements in the pattern are set by num_angular and num_axial, respectively, and the distance between circular pattern layers by the spacing argument. If alternating is TRUE, adjacent layers are staggered in angle. The pattern coordinates are specified in the order (angular, axial).


The following code snippet gives an example of using this API.


// Create a pattern

pattern* pat = NULL;

SPAposition center(5, 0, 0);

SPAvector normal(0, 1, 0);

int num_angular = 8;

int num_axial = 5;

double spacing = 5.0;

check_outcome(result = api_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 = 0.5;

check_outcome(result = api_solid_cylinder_cone(bottom, top, maj_rad, min_rad, maj_rad, NULL, cylinder));


// Apply the pattern to the prism

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


// Clean up

pat->remove();

Errors: The number of angular or axial elements is less than one, or the face that is specified is not cylindrical.

Library: kernel

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

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