All Frameworks Class Hierarchy This Framework Indexes
| outcome api_pattern_create_on_curve( | pattern*& | pat, | |
| const curve& | in_curve, | ||
| const SPAinterval& | param_range, | ||
| int | num_elements, | ||
| const SPAposition& | root, | ||
| logical | on_endpoints | = FALSE, | |
| law* | rail_law | = NULL, | |
| const SPAvector& | rail_dir | = *(SPAvector*)NULL_REF, | |
| const SPAvector& | tangent_dir | = *(SPAvector*)NULL_REF, | |
| const SPAtransf& | in_trans | = *(SPAtransf*)NULL_REF, | |
| AcisOptions* | ao | = NULL) |
// Create a spiral curve
EDGE* edge = NULL;
SPAposition center(0, 0, 0);
SPAvector normal(0, 0, 1);
SPAposition start_position(3, 0, 0);
double width = 3.0;
double angle = 6.0 * M_PI;
check_outcome(result = api_edge_spiral(center, normal,
start_position, width, angle, edge));
const curve& crv = edge->geometry()->equation();
SPAinterval param_range = edge->param_range();
if (edge->sense() == REVERSED)
param_range.negate();
// Create a pattern
pattern* pat = NULL;
int number = 36;
SPAposition root(0, 0, 0);
check_outcome(result = api_pattern_create_on_curve(pat, crv,
param_range, number, root));
// Create a prism
double height = 1.0;
double maj_rad = 1.0;
double min_rad = 0.5;
int num_sides = 3;
BODY* prism = NULL;
check_outcome(result = api_make_prism(height, maj_rad,
min_rad, num_sides, prism));
// Apply the pattern to the prism
check_outcome(result = api_pattern_apply_to_entity(prism, pat));
// Clean up
check_outcome(result = api_pattern_destroy(pat));
check_outcome(result = api_del_entity(edge));
Errors: The number of elements is less than one, or the rail direction was
specified without specifying a tangent direction.
Copyright (c) 1989-2007 by Spatial Corp. All rights reserved.