<< Click to Display Table of Contents >> Boundary Paths |
A two dimensional boundary path has the general form
START(a,b) segment TO (c,d) ...
where (a,b) and (c,d) are the physical coordinates of the ends of the segment, and segment is either LINE, SPLINE or ARC.
The path continues with a connected series of segments, each of which moves the segment to a new point. The end point of one segment becomes the start point of the next segment.
A path ends whenever the next input item cannot be construed as a segment, or when it is closed by returning to the start point. The closing segment may simply end at the start point, or it can explicitly reference CLOSE, which will cause the current path to be continued to meet the starting point:
... segment TO CLOSE.
or
... segment CLOSE.
Line Segments
Line segments take the form
LINE TO (x,y)
When successive LINE segments are used, the reserved word LINE does not have to be repeated, as in the following:
LINE TO (x1,y1) TO (x2,y2) TO (x3,y3) TO ...
Spline Segments
Spline segments are syntactically similar to Line segments
SPLINE TO (x,y) TO (x2,y2) TO (x3,y3) TO ...
A cubic spline will be fit to the listed points. The first point of the spline will be either the START point or the ending point of the previous segment. The last point of the spline will be the last point stated in the chain of TO(,) points.
The fitted spline will have zero curvature at the end points, so it is a good idea to begin and end with closely spaced points to establish the proper endpoint directions.
Arc Segments
Arc segments create either circular or elliptical arcs, and take one of the following the forms:
ARC TO (x1,y1) to (x2,y2)
ARC ( RADIUS = R ) to (x,y)
ARC ( CENTER = x1,y1 ) to (x2,y2)
ARC ( CENTER = x1,y1 ) ANGLE=angle
Here angle is an angle measured in degrees, and follows the convention that positive angles rotate counter-clockwise and negative angles rotate clockwise. The coordinate point at the end of the arc is determined by the radius swept out by the angle. To specify the angle in radians, follow the radian value by the qualifier RADIANS.
When the form ARC ( CENTER = x1,y1) to (x2,y2) is used and the center (x1,y1) is not equidistant from the start and end points, an elliptical arc segment is generated with major and minor axes along the X and Y coordinate directions.
The orientation of the major and minor axes can be rotated with the ROTATE qualifier.
ARC ( CENTER = x1,y1 ROTATE = 30 ) TO (x2,y2)
The rotation angle is defined in degrees unless followed by the qualifier RADIANS.
The end point is not rotated by this command, and must be stated correctly to intercept the rotated ellipse.
Examples:
Samples | Usage | Misc | Rotated_Ellipse.pde
Implicit curve segments can take two forms :
CURVE (equation) BY (direction) TO (x,y)
ADAPT CURVE (expression) BY (direction) TO (x,y)
In the first form, equation defines a relation between the X and Y coordinates that lie on the curve, such as x2+y2=R2. The boundary will follow the given equation exactly, and the start and end points must lie on the path or an error will be issued.
In the second form, expression is the left side of an equation, like x2+y2. The expression will be equated to a value computed using the starting point. Then this calculated equation will be used as in the first form. The end point must lie on the computed equation or an error will be issued.
In both forms, direction will dictate which way to start tracing the path, and must be +X, -X, +Y, or -Y. The +X means move in the positive X direction, -X means move in the negative X direction, and so on.
Note : Avoid using CURVE with the start and end points at the same position, even if the expression is unambiguous.
Examples:
Samples | Usage | Implicit_Curves | Implicit_Curve_Boundary.pde
Samples | Usage | Implicit_Curves | Implicit_Curve_Surface.pde
Samples | Usage | Implicit_Curves | Sine_Boundary.pde
Samples | Usage | Implicit_Curves | Sine_Boundary_3D.pde
Names can be assigned to paths. When names are assigned to paths they take the form of a quoted string and must be placed immediately after the reserved word START:
START "pathname" ( <x> , <y> )
Assigned path names are useful when boundary or line-related integrals are desired or for establishing paths over which ELEVATION plots are desired.
Names can be assigned to portions of a path by entering a new START clause, or by overlaying a portion of the boundary path by an independently declared FEATURE, or by applying labels as described below.
Examples:
Samples | Applications | Electricity | plate_capacitor.pde
Samples | Applications | Heatflow | heat_boundary.pde
Samples | Usage | Functions | vector_functions.pde
Samples | Usage | Misc | repeat.pde
A name can also be applied to a segment by using LABEL and ENDLABEL. The label form does not require the use of a new START clause and can be placed directly into the normal flow of a standard boundary path declaration. This usage also allows for named segments to overlap :
START (0,0)
LABEL "pathA" LINE TO (0,1)
LABEL "pathB" LINE TO (1,1)
ENDLABEL "pathA"
LINE TO (1,0)
ENDLABEL "pathB"
...
This would place the name/label "pathA" on the segment from (0,0) to (1,1), and "pathB" from (0,1) to (1,0).
Examples:
Samples | Applications | Electricity | fieldmap.pde
Samples | Usage | Eigenvalues | vibar.pde
Paths Defined by ARRAYS and MATRICES
Paths may be defined by ARRAYS or MATRICES.
In the case of ARRAYS, two arrays of equal dimension are used to specify the coordinates in a LIST boundary:
LINE LIST(Ax,Ay)
SPLINE LIST(Ax,Ay)
Here Ax and Ay are ARRAYS listing the X- and Y- coordinates of the path.
A 2-by-N MATRIX may also be used to specify a LINE or SPLINE LIST, with the syntax:
LINE LIST(Mxy)
SPLINE LIST(Mxy)
Examples:
Samples | Usage | Arrays+Matrices | Array_Boundary.pde
Samples | Usage | Arrays+Matrices | Matrix_Boundary.pde