Suppose that you want to create a radial pattern of bumps on a
BODY object
ent. As with the linear pattern example, radial patterns have an API function to facilitate their creation. The default behavior of this function:
|
|
|
Produces pattern elements that rotate with the pattern
|
|
Chooses an arbitrary starting direction (perpendicular to the specified normal)
|
|
Fills a full 360-degree angle
|
|
Uses a perfect circle as its elliptical perimeter
|
|
To use the default behavior, you can generate and apply the pattern as follows:
|
|
// define the pattern parameters
|
pattern* pat = NULL;
|
SPAposition center(,. . .,. . .);
|
SPAvector normal(. . .,. . .,. . .);
|
double spacing = . . .;
|
int num_radial = . . .;
|
int num_angular = . . .;
|
|
// create the pattern
|
outcome result = api_radial_pattern(pat, center,
|
|
normal, num_radial, num_angular, spacing);
|
check_outcome(result);
|
// define the bump by one of its faces
|
ENTITY_LIST face_list;
|
result = api_get_faces(ent, face_list);
|
check_outcome(result);
|
FACE* bump_face = face_list[0];
|
// apply the pattern to the face
|
result = api_set_entity_pattern(bump_face, pat);
|
check_outcome(result);
|
// clean up
|
pat->remove();
|