pub unsafe extern "C" fn edge(
in1: *const c_int,
in2: *const c_int,
x: *const c_double,
y: *const c_double,
z: *const c_double,
lwk: *mut c_int,
iwk: *mut c_int,
list: *mut c_int,
lptr: *mut c_int,
lend: *mut c_int,
ier: *mut c_int,
)Expand description
Swaps arcs to force two nodes to be adjacent.
Given a triangulation of n nodes and a pair of nodal indexes in1 and in2, this routine
swaps arcs as necessary to force in1 and in2 to be adjacent. Only arcs which intersect in1 -in2 are swapped out. If a Delaunay triangulation is input, the resulting triangulation is as
close as possible to a Delaunay triangulation in the sense that all arcs other than in1-in2
are locally optimal.
A sequence of calls to edge may be used to force the presence of a set of edges defining the boundary of a non-convex and/or multiply connected region, or to introduce barriers into the triangulation. Note that getnp will not necessarily return closest nodes if the triangulation has been constrained by a call to edge. However, this is appropriate in some applications, such as triangle-based interpolation on a nonconvex domain.
ยงArguments
in1,in2- Input. The indexes (ofx,y, andz) in the range1tondefining a pair of nodes to be connected by an arc.x[n],y[n],z[n]- Input. The coordinates of the nodes.lwk- Input/output. On input, the number of columns reserved foriwk. This must be at leastni, the number of arcs that intersectin1-in2. (niis bounded byn - 3.) On output, the number of arcs which intersectin1-in2(but not more than the input value oflwk) unlessier = 1orier = 3.lwk = 0if and only ifin1andin2were adjacent (orlwk = 0) on input.iwk[2 * lwk]- Output. The indexes of the endpoints of the new arcs other thanin1-in2unless0 < ierorlwk = 0. New arcs to the left ofin1->in2are stored in the firstk-1columns (left portion ofiwk), columnkcontains zeros, and new arcs to the right ofin1->in2occupy columnsk + 1, ..., lwk. (kcan be determined by searchingiwkfor the zeros.)list[6 * (n - 2)],lptr[6 * (n - 2)],lend[n]- Input/output. The data structure defining the triangulation, created by trmesh. On output, updated if necessary to refelct the presence of an arc connectingin1andin2unless0 < ier. The data structure has been altered if4 <= ier.ier- Output. Error indicator:0, if no errors were encountered1, ifin1 < 1,in2 < 1,in1 = in2, orlwk < 0on input.2, if more space is required iniwk. Refer tolwk.3, ifin1andin2could not be connected due to either an invalid data structure or collinear nodes (and floating point error).4, if an error flag other thanier = 1was returned by optim5, if error flag1was returned by optim. This is not necessarily an error, but the arcs other thanin1-in2may not be optimal