edge
edge puts the nodes of one mesh edge on a side of a surface, as cur puts them on a 3D curve.
Syntax
edge imin jmin kmin imax jmax kmax s.e
imintokmax: a region of reduced indices that must be an edge: two of the three pairs are equal. A0in a minimum means the first reduced index of its direction and a0in a maximum the last.s.e: one word, a surface numbers, a dot and a side numberefrom 1 to 4. The surface is one thatsddefined.
What it does
The command names side e of surface s and attaches the edge to it. The two end vertices of the edge move to their closest points on the side. The nodes between them are placed along the side by arc length, under the spacing rule of the edge, exactly as cur places them along a 3D curve, and a spacing command at step 4 spreads them again along the same stretch of the side. A side that is a circle, such as the rim of a revolved curve or of a pipe, is followed along the shorter arc between the two end vertices.
Only a surface that has sides can take an edge. The geometry chapter says which kinds have sides and how James numbers them: sides 1 and 2 lie at the two ends of a kind’s first parameter and sides 3 and 4 at the two ends of its second, a revolved open curve has its two rims as sides 1 and 2, and blend3 has three, numbered round its loop. Every kind but blend3 is numbered by the ends of its two parameters. The command places the nodes of one edge on a curve of the surface. It does not project a face, which sf and sfi do.
When James applies it
Step 2 of the hierarchy, with the other edge commands, after every vertex has been placed. edge is legal only in the Part phase.
After every command of step 2 has run, James measures again each stretch of a side or a curve whose end vertex a later command moved, from the vertices as they stand, and lays it out again. So four edge commands on a block whose corners lie off the surface land as if the corners had been placed on it.
Rules James adds
- The edge number is checked as soon as James reads it. A number outside 1 to 4 is E0604 at that point. A surface number that names no surface is also E0604, which James reports when the part ends, because an
sdafter theedgemay still define it. - A surface without sides is an error that the engine reports when it reaches the step, with exit status 2:
edge 1.1 names surface #0, a plane, which has no sides. The infinite kinds, the closed kinds,sdsandintphave no sides. - A side that the surface lacks, though its number lies inside 1 to 4, is an error as well:
edge 1.3 names surface #0, a surface of revolution, which has 2 sides. - A side of no length, such as the rim of a revolution at an end that lies on the axis, is an error that says so:
edge 1.1: surface #0, a surface of revolution: side 1 is a single point, not a curve. - The message counts surfaces from 0 in the order of definition, so the first
sdissurface #0whatever number it carries. - James numbers the sides of its own kinds by its own rule, which TrueGrid states only for its spline surfaces. A script written for TrueGrid that names a side by the label its display draws may find another side in James. The compatibility chapter lists the difference.
Diagnostics
- E0600: the region is not an edge.
- E0604: the surface or the edge number does not exist.
- E0102: a reduced index lies outside the part.
- E0106: a minimum is larger than its maximum.
The refusals of the engine have no code. The run ends with exit status 2, the status of an engine error.
Example
The script tests/golden/060-pipe-rims/input.tg, which make test runs:
c A pipe of varying radius about a straight 3D curve along z, radius .5 at its
c start and 1 at its end. A block straddling it has its far face, outside the
c pipe, projected onto it, the face's two end edges attached to the pipe's two
c rims (sides 1 and 2) with edge. The list of radii ends with one semicolon and
c the empty transformation list with another.
curd 1 lp3 0 0 0 0 0 4;
sd 1 pipe 1 .5 0 1 1; ;
block 1 5;1 2;1 5;-.3 .3 0 1.2 0 4
edge 1 2 1 2 2 1 1.1
edge 1 2 2 2 2 2 1.2
sfi ;-2;;sd 1
endpart
merge
neutral
write
The pipe about a line along z has radius 0.5 at its start and 1 at its end, and its sides 1 and 2 are the circles at those two ends. The block straddles the pipe: its near face lies inside it and its far face outside. The far face of the block is projected onto the pipe, and its two end edges are attached to the two rims, so the nodes of those edges lie on the circles at z = 0 and z = 4. All 25 nodes of the far face lie on the pipe. The case writes 50 nodes and 16 elements.
The script tests/golden/058-r3dc-four-edges/input.tg, which make test runs:
c The surface of Vol. 1, pp. 223-224 (a patch of the unit sphere between
c longitudes 0 and 90 and latitudes -45 and 45, rotated by ry -45) built as the
c revolution of a meridian arc (arc3 seqnc) about the z axis (r3dc) instead of
c the manual's function surface, and the page's shell block of 16 by 11 nodes
c attached to its four sides with four edge commands and projected onto it, with
c a thickness so the shells are whole. The page labels the function surface's
c edges as a loop (Figure 240): 1.1 the bottom, 1.2 the left, 1.3 the top and
c 1.4 the right; by the pb corners, 1.1 and 1.3 are the meridians at longitude 0
c and 90, and 1.2 and 1.4 the parallels at latitude 45 and -45. James numbers an
c r3dc's sides as Vol. 2, p. 98 does: 1 and 2 at the ends of the generatrix, the
c parallels at latitude -45 and 45, and 3 and 4 at the ends of the turn, the
c meridians at longitude 0 and 90. Each block edge goes to the side beside it,
c as on the page: j = 1 to 1.3, i = 16 to 1.1, i = 1 to 1.2 and j = 11 to 1.4.
curd 1 arc3 seqnc rt [cos(-45)] 0 [sin(-45)] rt 1 0 0 rt [cos(45)] 0 [sin(45)];
sd 1 r3dc 0 0 0 0 0 1 1 0 90 ry -45;
block 1 16;1 11;-1;
-.5 1; 0 1; 0;
pb 2 2 1 2 2 1 x .5
pb 1 2 1 1 2 1 z .75
pb 1 1 1 1 1 1 xz -.1 .75
edge 1 1 1 2 1 1 1.3
edge 2 1 1 2 2 1 1.1
edge 1 1 1 1 2 1 1.2
edge 1 2 1 2 2 1 1.4
sfi ;;-1;sd 1
thic .1
endpart
merge
neutral
write
This is the shape of four edge commands on one surface, here a patch of the unit sphere built as a revolved arc (r3dc). The shell block’s four edges are attached to the surface’s four sides, before the ry -45 of the sd turns the patch: the edge at j = 1 and the edge at j = 11 go to the meridians at longitude 0 and 90, which are sides 3 and 4, and the edge at i = 16 and the edge at i = 1 go to the circles at latitude -45 and 45, which are sides 1 and 2. The TrueGrid example that this script adapts labels the same four block edges 1.1, 1.4, 1.2 and 1.3 in this order, by the loop its display draws, so only 1.2 names the same side in both; the script carries James’s numbers, as the compatibility chapter says a TrueGrid script may need. The corners that the block and pb commands give the block need not lie on the surface, and the settle pass above makes the four edges land as if the corners were on it. The sfi then projects the block onto the surface. The mesh has 176 nodes and 150 shell elements.
A surface with no sides is refused. The script tests/corpus/176-edge-refused-no-surface-edge/input.tg, which make test runs:
c edge asks for edge 1 of surface 1; a plane has no edge, so the engine refuses.
sd 1 plan 0 0 0 0 0 1
block 1 3;1 3;1 2;0 1;0 1;0 1;
edge 1 1 1 2 1 1 1.1
endpart
The sd defines surface 1 as a plane. The edge asks for its edge 1. James prints the engine’s error in tests/corpus/176-edge-refused-no-surface-edge/expected.diag.txt and exits with status 2:
input.tg:4:1: error: edge 1.1 names surface #0, a plane, which has no sides
james: 1 error, 0 warnings
A side that the kind lacks is refused the same way. The script tests/corpus/340-edge-side-missing/input.tg, which make test runs:
ld 1 lp2 1 0 1 2;;
sd 1 cr 0 0 0 0 0 1 1
block 1 3;1 3;1 2;0 1;0 1;0 1;
edge 1 1 1 2 1 1 1.3
endpart
The open curve revolved by cr has two sides, the rims, so side 3 does not exist. James prints this, as tests/corpus/340-edge-side-missing/expected.diag.txt holds, and exits with status 2:
input.tg:4:1: error: edge 1.3 names surface #0, a surface of revolution, which has 2 sides
james: 1 error, 0 warnings
See also
- cur: attaches an edge to a 3D curve.
- patch: attaches the four edges of a face to the four sides of a surface and projects the face.
- curd:
sdedgemakes a 3D curve of a side, andcursjoins sides into a composite edge. - splint: builds a spline through an edge’s vertices.
- Geometry: surfaces and their sides.
- Shaping: shaping edges.