cylinder
cylinder opens a part like block, but its coordinate lists are radius, angle in degrees and height.
Syntax
cylinder i_index_list ; j_index_list ; k_index_list ;
r_list [ ; ] theta_list [ ; ] z_list [ ; ]
The three index lists are those of block. The coordinate lists are:
r_list: radii, one per entry of the i index list.theta_list: angles in degrees, one per entry of the j index list.z_list: heights, one per entry of the k index list.
The ; that ends a coordinate list may be left out, as in block. cyli is another spelling of cylinder.
What it does
cylinder lays out a part exactly as block does, with the first direction running outward from the axis, the second around it and the third along it. A part ends in Cartesian coordinates: the radius, angle and height of every node become x = r cos(theta), y = r sin(theta) and z when the part ends. The merge phase sees only the Cartesian result.
When James applies it
Step 1i of the hierarchy, like block, and legal in the Control, Part and Merge phases. It ends an open part first. The conversion to Cartesian coordinates happens once, when the part ends. Between the two, pb, mb and mbi read and write radius, angle and height. tr and tri work in Cartesian coordinates and convert back for the part.
Rules James adds
- A negative radius is refused. A negative entry in
r_liststops the run with an engine error that names the part and the value. So does a node whose radius turns negative when the part is converted, for example after anmbwith a large negative offset inx. That error names the node. Zero is legal, so a solid slice may touch its axis. - An angle past 360 degrees is neither wrapped nor refused. It passes through unchanged and converts periodically when the part ends, so 450 degrees lands where 90 does.
- Angles between two vertices interpolate as ordinary numbers. A part from 350 degrees that goes the short way round 0 writes 370, not 10.
- Gaps and shell partitions are refused as for
block.
Diagnostics
- E0400: an index list has a negative entry.
- E0401: an index list does not start with
1. - E0402: an index list entry does not exceed an earlier one.
- E0403: a coordinate list’s length does not match its index list.
- E0413: an index list holds a
0. - E0416: related. James raises it at
endor at the end of the input, not at this command, when a part is still open.
A negative radius has no code. James prints error: part #0 has a negative radius -1.00000E+00 in its r-list and exits with status 2. A node that turns negative is reported as error: node (1, 1, 1) of part #0 has a negative radius -2.00000E+00, also with status 2.
Example
The script examples/ring.tg, which make test runs:
c A ring about the z axis, r 1 to 2, a whole turn in eight intervals. The
c part's faces at 0 and at 360 degrees are one face in space, and stp merges
c them: 81 nodes become 72.
c
c james ring.tg --format exodus -o ring.exo
cylinder 1 3;1 9;1 3;1 2;0 360;0 1;
endpart
merge
stp .0001
write
The part has 3 nodes along the radius, 9 around the turn and 3 up the height. James writes node 1 at (1, 0, 0), and stp merges the nine nodes at 360 degrees into those at 0, so the mesh has 72 nodes.