Explore Ebooks
Categories
Explore Audiobooks
Categories
Explore Magazines
Categories
Explore Documents
Categories
OF WEST BOHEMIA
DIPLOMA THESIS
Pilsen 2007
ZPADOCESK
UNIVERZITA
DIPLOMOV PRCE
Plze
n 2007
Prohlsen
Prohlasuji, ze jsem diplomovou prci vypracoval samostatne s pouzitm odborn literatury
a pramenu uvedench v seznamu, kter je soucst tto prce.
V Plzni dne . . .
. . . . . . . . . . . . . .
Podpis
Pod
ekovn
Tmto bych chtel podekovat vedoucmu diplomov prce RNDr. M. Lvickovi, Ph.D. za
odborn veden, cetn rady a korektury tto prce.
Dekuji tak sv rodine a prtelm za trpelivost a podporu, kterou mi dvali behem mho
studia.
CONTENTS
Contents
1 Introduction
8
8
17
21
22
3 NURBS approximation
3.1 B-spline curve . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 NURBS curve . . . . . . . . . . . . . . . . . . . . . . . . . .
24
24
26
29
33
35
35
39
41
5 Conclusion
47
Introduction
make the biarc unique. The conventional approach to this biarc construction
which has been widely adopted in arc spline approximation, introduces various
constraints to uniquely determine the biarc [7]. The difference of the radii of
the two circular arcs can be minimized, with the result that the angles of the
two arcs are equal [15]. The difference of the curvatures of the two arcs can
be minimized, with the result that the joining point is on the bisector of the
line segment joining the two end points [11]. Also, the ratio of the two radii
can be made as close to one as possible, with the result that the tangent at
the joining point is parallel to the line joining the two end points.
Instead of imposing such constraints to make the biarc unique, the approach
proposed herein exploits the inherent freedom in the choice of the biarc to
achieve a better fit minimizing the distance between the polygon and the biarc.
This is called optimal single biarc fitting. A similar approach exploiting the
freedom was proposed for arc spline fitting of a B-spline curve, but it requires
much computation since it has to solve a non-linear optimization problem of
minimizing the area between the B-spline curve and the fitted curve.
The rest of the thesis is organized as follows. In section 2 we describe fundamentals of Piecewise Circular Curves, biarc formulation. Section 3 describes
the details on the biarc approximation method. In Section 4, applications of
PCCs in geometric modeling: Circular pipe connections, Blending of canal
surfaces and approximation of intersection edges of surfaces.
2.1
Biarc formulation
Definition 2.1. The two circular arcs c1 , c2 (in R3 ) are said to form a biarc
interpolating given oriented G1 data, represented by end points P1 , P2 and
unit tangent vectors T1 , T2 if the two circular arcs share one common end
point J called joint and satisfy the following properties:
1. The arc c1 has the end points P1 and J, and T1 is tangent to c1 with
orientation corresponding to a parametrization of c1 from P1 to J.
2. The arc c2 has the end points J and P2 and T2 is tangent to c2 with
orientation corresponding to a parametrization of c2 from J to P1 .
3. The two arcs have a common unit tangent vector at J, with orientation
corresponding to a parametrization of c1 from P1 to J and of c2 from J
to P2 .
y
y
C1
T1
C2
T1
T2
C1
2
C2
T2
(b)
(a)
Figure 1: Biarcs for given data (P1 , T1 ) and (P2 , T2 ): (a) C-shaped biarc, (b) S-shaped
biarc.
The shape of the biarc depends on the direction of the tangent vectors (or
the angles 1 and 2 ) as shown in Figure 1. A positive angle is defined
as counterclockwise direction from the vector P2 P1 to the corresponding
8
2.1
Biarc formulation
kP20 P10 k = | + |
(2.1)
(2.2)
2.1
Biarc formulation
10
For any exists and thus we can always obtain the point P2 satisfying
conditions P20 = P2 T2 , kP20 P10 k = | + |.
P'
c
1
J
1
c2
P'
P1 + P2 + (T1 T2 )
P10 +
P20 =
+
+
+
(2.3)
Biarcs for the given data (P1 , T1 ) and (P2 , T2 ) are many, because in the
10
2.1
Biarc formulation
11
(2.4)
(2.5)
(2.6)
Because kTk 2, D is the sum of two nonnegative terms and therefore must
be positive or null. If kTk 6= 4, we have two real solutions. Of the two roots
we chose
DVT
(2.7)
=
4 kTk2
Since D (V T)2 , is always positive. The spacial case where kTk2 = 4 is
equivalent to T1 = T2 . If V T1 6= 0 then
=
kVk2
4(V T1 )
(2.8)
2.1
Biarc formulation
12
Figure3.
T
P
1
For any we can find joint point J and unit tangent vector TJ at J as follows:
J = P1 +
(T2 T1 ) + V
(T1 T2 ) + V
= P2
,
2
2
V (T1 + T2 )
2
Algorithm 1. Procedure Biarc1 ((P1 , T1 )(P2 , T2 ))
Input: Pair of data (P1 , T1 ), (P2 , T2 )
Output: Biarc composed of two arcs c1 , c2 .
TJ =
(2.9)
(2.10)
2.1
Biarc formulation
13
5. Find the joint point J and the tangent vector TJ at J using (2.9), (2.10).
6. Find the unique arcs c1 , c2 satisfying properties (1),(2) of Definition 2.1.
Example 1. Let be given two points P1 = [0, 0], P2 = [4, 0] and two unit
tangent vectors T1 = (0, 1), T2 = (0, 1) at this points. Construct the biarc
for these given data.
a) To be constructed biarc for the given data first we will generate the vector
V = (P2 P1 ) = (4, 0). The vectors T1 , T2 , V are noncolinear. We choose
y
P'2
TJ
P'1
T1
c2
J
c1
P2
P1
T2
Figure 4: Biarc for the given data P1 = [0, 0], P2 = [4, 0], T1 = (0, 1), T2 = (0, 1) when
= 1.
P20 = P2 T2 = [4, 4]
13
2.1
Biarc formulation
14
4
1
4
8
J=
P10 +
P20 = [0, 1] + [4, 4] = ,
+
+
5
5
5 5
and the vector TJ = P20 P10 = (4, 3) we can use as tangent vector at J.
Then we will construct two arcs c1 , c2 which are satisfying first and second
conditions of biarc definition, respectively (see Figure 4).
b) If = 4 then = 1 and points P10 = [0, 4], P20 = [4, 1]. The joint point
8
J = [ 16
5 , 5 ] and tangent vector TJ = (4, 3) at J (see Figure 5.).
y
P'1
c1
TJ
c2 P'2
T1
P2
P1
T2
Figure 5: Biarc for the given data P1 = [0, 0], P2 = [4, 0], T1 = (0, 1), T2 = (0, 1) when
= 4.
c) Let be = . Using equation (2.4) for these given data we gets following
equation
2 4 = 0
and we chose = 2.
14
2.1
Biarc formulation
15
(T1 T2 ) + V
2(0, 2) + (4, 0)
= [0, 0] +
= [2, 2]
2
2
V (T1 + T2 )
= (1, 0)
2
TJ
J
c1
c2
T1
P2
P1
T2
Figure 6: Biarc for the given data P1 = [0, 0], P2 = [4, 0], T1 = (0, 1), T2 = (0, 1) when
= .
then it is easy construct two arcs c1 , c2 which are satisfying the first and the
second conditions of biarc definition, respectively (see Figure 6.).
Theorem 2.2. The two data (P1 , T1 ), (P2 , T2 ) can be connected by one arc
which passes through end points P1 , P2 and tangent to T1 , T2 at the end points
respectively, if the data (P1 , T1 ), (P2 , T2 ) lie in the same plane and they are
line symmetric.
Proof. Let be given two line symmetric data (P1 , T1 ), (P2 , T2 ) lying in the
same plane. If we choose = and we get P10 = P20 . Then can be construct
isosceles triangle P1 P10 P2 and always can be constructed arc into this triangle
15
2.1
Biarc formulation
16
T1
-T
P1
P2
T2
Figure 7: Biarc for the line symmetric data (P1 , T1 ), (P2 , T2 ) on the plane.
For the given planar data (P1 , T1 ), (P2 , T2 ) we will introduce following theorem.
Theorem 2.3. All joint points J of the family of biars are lies on the same
circle k, which is passing through P1 ,P2 and the having same oriented angles
with the vectors T1 and T2 .
Proof. For any data there is precisely one circle k passing through the points
P1 , P2 and having the same (oriented) angles with the vectors T1 , T2 . It is
obtained as the trajectory of the point P1 under the unique rotation transforming the data P1 , T1 into the data P2 , T2 . If the vectors are parallel, then
k degenerates into the straight line passing though P1 , P2 .
For any joint point J in the plane there are one arc c1 satisfying property (1)
of biarc definition and one arc c2 satisfying second property. These two arcs
have a common tangent at J if and only if J k. In fact, if J k, then
the angle between the circle k and the arc c1 at the point J is the same as
angle between the circle k and the vector T1 . Similarly the angle between k
16
2.2
17
Ji
T1
Ji+1
P2
P1
T2
k
and the arc c2 at the point J equal to the angle between the circle k and the
vector T2 . Since the circle k has the same angle with T1 and T2 , the two arcs
c1 , c2 join with G1 continuity at J. The orientations coincide also, since one
of the arcs c1 , c2 will be inside and one outside the circle k. Suppose, on the
other hand, that a G1 interpolating biarc is constructed. The circle passing
though P1 , J and P2 must have the same angle with both circular arcs c1 ,
c2 and therefore also with the vectors T1 , T2 . It is hence identical with the
in [14].
circle k and J k. This proof produced by Zbynek Sr
2.2
2.2
18
P6
P2
P4
P5
P7
P1
Figure 9: Nonsmooth piecewise circular curve
The advantage of piecewise circular curves is that one may with the appropriate choice of the points {Pi } obtain a smooth model. It is important that the
appropriate choice of the points follow simple rules that is easy to compute.
To develop these rules, we make the following observations.
For a piecewise circular curve to be smooth, we need the tangent vectors
Ti at the each of points Pi (i = 1, 2, ..., n).
It is possible to construct a piecewise circular curve consisting of two
circular arcs (biarc) by giving the two points P1 , P2 and the tangent
18
2.2
19
P2
T1
T2
Pi
Ti
P1
Pn
Tn
Figure 10: Smooth Piecewise Circular Curve for the given data (Pi , Ti )
2.2
20
T5
P5
J4
J1
P1
T1
P2
P4
T2
T4
J3
J2
P3
T3
Figure 11: Smooth Piecewise Circular Curve for the given data (Pi , Ti ) where i = i
will construct smooth PCC (where i = i i = 1, ..., 4, see Figure 11) which
is composed by four biarcs given by:
1 =
21 4,
2 =
46 6,
20
3 = 1,
4 =
1
2
2.3
21
and
"
J1 =
21 9 2 21 8
,
,
5
5
#
11 46 7 2 46
J2 =
,
,
5
5
"
9 1
J4 = ,
2 2
J3 = [3, 1],
i = 1, ..., 4
y
J1
P1
T1
T5
P5
J4
P2
P4
J2 T 2
T4
J3
P3
T3
Figure 12: Smooth Piecewise Circular Curve for the given data (Pi , Ti ) where 6= .
2.3
In spatial cases we are given only set vertices of polygon and we need to obtain
tangent vectors at these points. In this subsection we will introduce how to
compute tangent vectors for the given set vertices of polygon.
In [5], a technique was discussed to interpolate the tangent vectors to ensure
that the circular are passing through the adjacent points. In this work, we used
an interpolation method discussed in [5] to find the corresponding tangent
vectors. The tangent vector Ti at the point Pi can be approximated as a
21
2.4
22
vector:
Ti = (Pi Pi1 )
kPi+1 Pi k
kPi Pi1 k
+ (Pi+1 Pi )
kPi Pi1 k
kPi+1 Pi k
(2.11)
Equation (2.11) gives the tangent vector Ti at Pi such that the circular arc
y
y
C1
T1
C2
T1
T2
C1
O2
O2
T2
C2
O1
O1
(b)
(a)
Figure 13: (a) C-shaped biarc, (b) S-shaped biarc in the plane
will pass through the three points Pi1 , Pi , Pi+l . The angles 1 and 2 can be
found between the tangent vectors Ti at the knot points and the chord line
(see Figure 13).
2.4
(c (tp ) P ) c0 (tp ) = 0
2.4
23
c0 (t2 )
P2 = c(t2 ), T2 = 0
kc (t2 )k
(2.12)
1
i
bni = Biarc0 c(t),
,
f or i = 1, ..., n
n n
and collect them to form the biarc spline bn .
3. Evaluate the distance of the curve c(t), t [0; 1] from the spline bn . If
the distance is greater than then set n = 2n and GOTO (2). Otherwise
STOP.
23
24
NURBS approximation
3.1
B-spline curve
Definition 3.1. The B-spline [8] curve of degree k defined by control points
V1 , ..., Vn , n k and knot vector U = (u1 , ..., um ) is
c(u) =
n
X
Ni,k (u)Vi
3.1
i=1
(
Ni,1 =
1, if ui u < ui+1
0, otherwise.
for k > 1
Ni,k =
u ui
ui+k u
Ni,k1 (u) +
Ni+1,k1 (u)
ui+k1 ui
ui+k ui+1
3.2
The knot vector uniquely determines the B-splines as it is obvious from (3.2).
The relation between the number of knots m, the degree k of Ni,k and the
number of control points n is given by m = n + p + 1. The sequence of
knots in the knot vector U is assumed to be nondecreasing, i.e. ui ui+1 .
Each successive pair of knots represents an interval [ui , ui+1 ) for the parameter
values to calculate a segment of a shape.
Since the knot spacing could be nonuniform, the B-splines are no longer the
same for each interval [ui , ui+1 ) and the degree of the B-Spline can vary. Considering the whole range of parameter values represented by the knot vector,
the different B-splines build up continuous (overlapping) blending functions
Ni , p(u), as defined in (3.2), over this range. These blending functions have
the following properties:
24
3.1
B-spline curve
25
i
P
Nj,k (u) =
j=ik
n
P
i=0
25
3.2
3.2
NURBS curve
26
NURBS curve
NURBS (Non Uniform Rational B-spline [8]) are industry standard tools for
the representation and design of geometric objects . Some reasons for the use
of NURBS are:
offer one common mathematical form for both, standard analytical shapes
(e.g. conics) and free form shapes;
provide the flexibility to design a large variety of shapes;
can be evaluated reasonably fast by numerically stable and accurate algorithms;
are invariant under affine as well as perspective transformations;
are generalizations of non-rational B-splines and non-rational and rational Bezier curves and surfaces.
Let us consider the way of introducing homogeneous coordinates to a B-spline
curve and derive the NURBS definition.
Given n control points V1 , ..., Vn , n k and knot vector U = (u1 , ..., um ) of
m knots, the B-spline curve of degree k defined by these parameters is the
following:
n
X
c(u) =
Ni,k (u)Vi
i=1
3.2
NURBS curve
27
not change its position, let us multiply the coordinates of Vi with a weight wi
to obtain a new form in homogeneous coordinates:
Viw = [wi xi , wi yi , wi zi , wi ]T .
Note that Viw and Vi represent the same point in homogeneous coordinate.
Plugging this new homogeneous form into the equation of the above B-spline
curve, we obtain the following:
P
n
Ni,k (u)(wi xi )
i=1
P
wi xi
n
n
n
Ni,k (u)(wi yi )
X
X
wi yi i=1
cw (u) =
Ni,k (u)Viw =
Ni,k (u)
.
n
P
wz =
i i (u)(wi zi )
i=1
i=1
i=1
wi
n
P
Ni,k (u)wi
i=1
Therefore, point cw (u) is the original B-spline curve in homogeneous coordinate form. Now, let us convert it back to Cartesian coordinates by dividing
cw (u) with the fourth coordinate:
w
c (u) =
n
P
Ni,k (u)(wi xi )
i=1
n
P
Ni,k (u)wi
i=1
n
P
Ni,k (u)(wi yi )
i=1
n
P
Ni,k (u)wi
i=1
n
P
Ni,k (u)(wi zi )
i=1
n
P
Ni,k (u)wi
i=1
P
n
Ni,k (u)wi
i=1
= P
n
Ni,k (u)wi
i=1
1
Finally, we have a clean form as follows:
27
xi
yi
.
zi
3.2
NURBS curve
28
n
P
Ni,k (u)wi Vi
c(u) = i=1
n
P
Ni,k (u)wi
i=1
c(u) =
Ni,k (u)wi Vi
i=1
n
P
3.3
Ni,k (u)wi
i=1
where wi are weights, Vi are control points (vector) and Ni,k are normalized
B-spline basis functions of degree k.
We will present description for some of curves in terms of NURBS theory,
which are often using in Computer-Aided Design system.
1. Line segment
Open line segment can be described as NURBS with order k = 2, weights
wi = 1 and knot vector U = (0, 0, 1, ..., j 2, j 1, j 1).
For closed line segment reducing knot vector: U = (0, 1, ..., j 1, j).
V2 = (0, r, 0, 0),
V3 = (r, 0, 0, 1),
V4 = (0, r, 0, 0)
V2 = (0, b, 0, 0),
28
V3 = (a, 0, 0, 1),
V4 = (0, b, 0, 0)
3.3
29
3. Biarc
For a biarc curve let u be a parameter value computed as
u=
kP1 Jk
kP1 Jk + kJP2 k
(c (up ) P ) c0 (up ) = 0
29
(3.4)
3.3
30
3.3
31
3.3
32
32
3.4
3.4
33
3.4
34
NURBS curve
10
0.1
Tolerance
34
35
x2 + z 2 = 0.3,
y 2 + z 2 = 0.3,
y [2, 0]
x [2, 4]
We need connections of central curves of these cylinders. We will use the biarc
for connection of central curves. The central curves of these cylinders are line
35
4.1
36
Figure 20: Two given pipes (blue) and their connecting pipe (red).
36
4.1
37
segments:
y [2, 0],
x [2, 4]
First we choose two points P1 = [0, 0, 0], P2 = [2, 0, 0] lying on the central
curves respectively and which must be connected. then we will choose two
unit tangent T1 = (0, 1, 0), T2 = (1, 0, 0) vectors at P1 , P2 which have the
same direction with the central curves. Then we will compute the vector
V = (P2 P1 ) = (2, 0, 0). Using Algorithm 1 we can construct biarc with the
joint point
!
3 3 31
J=
,
2
2
and with the tangent vector
!
3 3 1 3
,
2 32 2 32
TJ =
at J (see Figure 21). Then we can construct pipe around biarc with radius
r = 0.3 and obtain pipe connection of two given cylinders (see Figure 22).
There was used the software Rhinoceros (version 3.0) in this example.
Figure 21: Two given cylinders (blue and red) and connecting their axis.
37
4.1
38
Figure 22: Two given cylinders (blue and red) and their connecting pipe (yellow).
Figure 23: Two given cylinders (blue and red) and their connecting pipe (yellow) on perspective.
38
4.2
4.2
39
To find this blending surface we will use PCCs. First we need edges
S, 0 S 0 of this surfaces which should be connected. These edges are for
39
4.2
40
canal surfaces circles. We will find a point P1 on the edge which has a
minimum distance from edge 0 and point P10 on edge 0 which has a minimum
distance from point P1 . We generate n 1 points Pi , i = 2, ..., n on , and
n 1 points Pi0 , where i = 2, ..., n on 0 as:
kP1 P2 k = kP2 P3 k = ... = kPn1 Pn k = kPn P1 k = = const
0
kP10 P20 k = kP20 P30 k = ... = kPn1
Pn0 k = kPn0 P10 k = 0 = const
...
kPn Pn1 k = kPn1 Pn2 k = ... = kPnn Pn0 k = n = const,
then for all sets of points {Pj1 }, {Pj2 }, ..., {Pjn }, where j = 1, ..., n we will
construct smooth PCCs denoted by pn . All constructed biarcs bn , Piecewise
circular curves pn and two circles , 0 generate a net of blending surface,
which blends two given canal surfaces.
Example 5. Let be given two canal surfaces, ie. cylinder S and cone S 0 .
S:
y 2 + z 2 = 1,
x [5, 1]
y2 z2
x2
+
= ,
x [1, 4]
9
9
16
Using biarcs we will find their blending surface. First of all we will choose
S0 :
one point P1 on surface S and find a point P10 on surface S 0 which has the
40
4.3
41
Figure 25: Two given surfaces and biarc joining of these surfaces.
4.3
PCC can be also used in approximation of surface intersections. Approximation intersection edges have been investigated in the past by Jaroslaw
Rossignac and A. G. Requicha [11]. We will introduce their work.
41
4.3
42
Figure 26: Two given surfaces (blue and red) and their blending surface (yellow).
Figure 27: Two given surfaces (blue and red) and their blending surface (yellow) on perspective.
42
4.3
43
Figure 28: Natural primitives: block, sphere, cylinder, cone, and tori
4.3
44
the intersection curve is derived from the cross product of the normals to both
surfaces at the intersection point.
Figure 29: Constant-parametr curves on faces of natural primitives: Lines and circles.
4.3
45
F1
P1 P2 P3 P4 P5 P6
P7
F2
Figure 30: Intersection point lying in one face only: The point P2 is out of F2 , but is
needed to specify the biarc (P2 , P3 ) with in partly lies on F2 .
F1
F2
Figure 31: Intersection allmost parallel to u-curves: Using only u-curves of F1 , we miss the
intersection edge.
Figure 32: Parametric grid: Intersection points (left) are mapped into cells of the parametric grid (right).
45
4.3
P4
46
P4
P1
P1
P3
P3
P2
P2
Figure 33: Errors of heuristic matching: Given four intersection points P1 to P4 , and the
associated tangents, most heuristic approaches would match P1 with P4 (left), and not
with P2 (right), which might be the correct solution.
matching the ending point of one biarc with the starting point of the next
biarc along the curve. Self-intersecting edges are approximated by PCCs that
do not reflect their singularities and therefore can be consistently oriented.
Singularities
Several singularities may arise:
1. Two surfaces may be coincident.
2. Two surfaces may be tangent at isolated points.
3. Two surfaces may be tangent along a curve.
4. Intersection curves may self-intersect.
46
47
Conclusion
47
48
Appendix
public void Fun()
{
double step = (ti[nt-1]-ti[0])/(w2-.9), t = ti[0];
Tmin = (int)((ti[k-1]-ti[0])/step) + 1;
Tmax = (int)((ti[n1]-ti[0])/step);
int i1 = 0;
for (int l = 0; l < w2; l++)
{
while (t >= ti[i1] ) i1++;
int i = i1-1;
col[l] = iColor[(i+8-k) % 7];
for (int j = 0; j < nt; j++) N[j][l] = 0;
N[i][l] = 1;
for (int m = 2; m <= k; m++){
int jb = i-m+1; if (jb < 0) jb = 0;
for (int j = jb; j <= i; j++){
N[j][l] = N[j][l]*(t - ti[j])/(ti[j+m-1] - ti[j]) +
N[j+1][l]*(ti[j+m] - t)/(ti[j+m] - ti[j+1]);}}
t += step;
}
}
public void drawSpline()
{
int X,Y;
buffGraphics.setColor(Color.blue);
buffGraphics.drawLine(15, h1+h1, 15, h1);
buffGraphics.drawRect(15-1, h1-tolPos, 3, 3);
buffGraphics.drawString("10", 18, h1);
buffGraphics.drawString("0.1", 18, h1+h1);
buffGraphics.drawString("Tolerance", 0, h1+h1+30);
for (int i = 0; i < n1; i++)
{
X = (int)Px[i]; Y = h1-(int)Py[i];
buffGraphics.drawRect(X-1,Y-1, 3,3);
}
if ( k > 2 )
{
48
49
buffGraphics.setColor(Color.gray);
Stroke oldStroke = buffGraphics.getStroke();
buffGraphics.setStroke(new BasicStroke(1,
BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 10,
new float[] { 3, 8 }, 0));
int Xo = (int)Px[0], Yo = h1-(int)Py[0];
for (int i = 1; i < n1; i++)
{
X = (int)Px[i]; Y = h1-(int)Py[i];
buffGraphics.drawLine(Xo,Yo, X,Y);
Xo = X; Yo = Y;
}
buffGraphics.setStroke(oldStroke);
}
double sX = 0, sY = 0, sW = 0;
for (int j = 0; j < n1; j++)
{
sX += Px[j]*wi[j]*N[j][Tmin];
sY += Py[j]*wi[j]*N[j][Tmin];
sW += wi[j]*N[j][Tmin];
}
double Xold = (sX/sW), Yold = h1-(sY/sW);
double x,y;
polygon.clear();
points.clear();
Color cl = col[Tmin+1];
for (int k = Tmin+1; k <= Tmax; k++)
{
sX = 0; sY = 0; sW = 0;
for (int j = 0; j < n1; j++)
{
sX += Px[j]*wi[j]*N[j][k];
sY += Py[j]*wi[j]*N[j][k];
49
50
sW += wi[j]*N[j][k];
}
x = (sX/sW); y = h1-(sY/sW);
points.add(new DPoint(x,y));
if(col[k] != cl)
{
subdivide();
cl = col[k];
points.clear();
}
if ( (x < w2) && (Xold < w2) )
{
buffGraphics.setColor(col[k]);
buffGraphics.drawLine((int)Xold,(int)Yold, (int)x,(int)y );
buffGraphics.setColor(Color.BLUE);
buffGraphics.drawLine((int)Xold+w2, (int)Yold+h1,
(int)x+w2,(int)y+h1);
buffGraphics.drawLine((int)Xold+w2,(int)Yold+h1+h1,
(int)x+w2,(int)y+h1+h1 );
}
Xold = x; Yold = y;
}
subdivide();
GeneralPath path = new GeneralPath();
double Xnew, Ynew;
double T1x,T1y, T2x,T2y;
double d1,d2,s,r;
double a,b,c,D,alfa;
DPoint P0 = new DPoint(0,0);
DPoint P1 = new DPoint(0,0);
DPoint P2 = new DPoint(0,0);
DPoint P3 = new DPoint(0,0);
DPoint P4 = new DPoint(0,0);
DPoint V = new DPoint(0,0);
DPoint O = new DPoint(0,0);
DPoint Ctrl1 = new DPoint(0,0);
50
51
51
52
52
53
53
54
54
55
55
REFERENCES
56
References
[1] Bolton K.M. "Biarc curves".Computer-Aided Design 1975;7(2):89-92.
[2] Carlson W. E. "An Algorithm and Data Structure for 3D Object Synthesis Using Surface Patch Intersection," Proceedings of ACM SigGraph 82, Boston, July 26-30, 1982, pp. 255-263.
[3] Fuhs W. and Stachel H., "Circular Pipe-Connections". Institute fur
Geometrie,Technische Universitat Wien, Wiedner Hauptstr. 8-10/113,
A-1040 Wien, Austria.
[4] Hoschechek J.,
1992;11:611-8.
"Circular
splines".
Computer-Aided
Design
REFERENCES
57
[11] Rossignac J.R., Requicha A.G., "Piecewise circular curves for geometric modelling". IBM J. Res. Develop. Vol. 31. No. 3 (1987)
[12] Sabin M., "Contouring-A Review of Methods for Scattered Data,"
Mathematical Methods in ComputeGr raphics and Design, K. W.
Brodlie, Ed., Academic Press, Inc.N, ew York, 1980.
[13] Sabin M., "The Use of Piecewise Forms for the Numerical Representation of Shape". Report No. 60, Computer and Automation Institute,
Hungarian Academy of Science, Budapest, 1977.
Z., Feichtinger R. and J
[14] Sr
uttler B., "Approximating Curves and
Their Offsets using Biarcs and Pythagorean Hodograph Quintics". Altenberger Str. 69, 4040 Linz, Austria.
[15] Schonherr, J., "Smooth biarc curves". Computer-Aided Design, Vol.
25, 1993, pp. 365-370.
[16] Timmer H. G., "A Solution to the Surface Intersection".
57