n
n chooses the side of the shell elements in a region, by the orientation point orpt set before it.
Syntax
n imin jmin kmin imax jmax kmax
The six numbers are a region, as for th: a face on a shell partition.
What it does
A shell element has a side, the direction of its normal, which James takes from the order of its four corners by the right-hand rule. By default the normal points along the increasing index of the direction the shell partition lies across: +i for a shell on an i partition, +j on a j partition, +k on a k partition. That holds whatever the lattice’s hand: on a mirrored lattice (one or three decreasing coordinate lists, or a reflecting cycorsy or tr) James swaps the second and fourth corners of every shell so that the normal still points along the increasing index, as it reorders the corners of a mirrored part’s solid elements; the parts chapter gives the example. n reorders the corners of every shell element whose four corners lie in the region so that its normal agrees with the choice orpt made: toward a point, away from it, or the inverse of the default. The choice in force when n is issued is the one it keeps; a later orpt does not reach it.
When James applies it
After the part’s twenty-one steps, in the order the n commands were written, on the part’s own coordinates before a cylinder part is converted to Cartesian.
Rules James adds
- With no
orptbefore it, or afterorpt off,nleaves the default order. - Toward or away from a point is decided element by element, by the sign of the dot product of the element’s default normal with the vector from its centre to the point. An element whose dot product is zero keeps the default order, and James counts such elements in one warning.
- Each
nsets its elements’ side outright; twonon one element do not cancel, the later one governs. - A region that holds no shell element, by th’s rule (no shell partition with area inside it: a block short of every shell partition, a face on a solid partition, an edge or a vertex), is a warning (E1402); the command is kept and reorders nothing.
Diagnostics
- E1402: the region holds no shell element.
- E0102: a reduced index lies outside the part.
- E0418: a reduced index names a gap.
Example
The script tests/corpus/223-n-box-orpt-minus-p246/input.tg, which make test runs:
c co n's example, Vol. 2, p. 246: a closed box of six shell faces on the unit sphere, every normal outward
block -1 -6;-1 -6;-1 -6;
-1 1 -1 1 -1 1
sd 1 sp 0 0 0 1
sfi -1 -2; -1 -2; -1 -2;sd 1
orpt - 0 0 0
n 1 1 1 1 2 2
n 2 1 1 2 2 2
n 1 1 1 2 1 2
n 1 2 1 2 2 2
n 1 1 1 2 2 1
n 1 1 2 2 2 2
endpart
The closed box of six shell faces is projected onto the unit sphere. By default three of its faces point inward (the ones at the low ends of i, j and k); orpt - 0 0 0 then six n rows, one per face, turn every normal away from the centre.