diff options
author | Norbert Preining <norbert@preining.info> | 2020-08-07 03:02:55 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-08-07 03:02:55 +0000 |
commit | 3710c23789342d9d88783cbe9ad23eb5263a7c33 (patch) | |
tree | 1c40b2bfb9f6b652f7877ad0991f5d6b44391154 /graphics/asymptote/beziercurve.cc | |
parent | d99fea72e367e8d4d2809b43b3b0206b1bb526b8 (diff) |
CTAN sync 202008070302
Diffstat (limited to 'graphics/asymptote/beziercurve.cc')
-rw-r--r-- | graphics/asymptote/beziercurve.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/graphics/asymptote/beziercurve.cc b/graphics/asymptote/beziercurve.cc index 9a5eee79f2..f3a675ce9c 100644 --- a/graphics/asymptote/beziercurve.cc +++ b/graphics/asymptote/beziercurve.cc @@ -16,7 +16,7 @@ void BezierCurve::init(double res) { this->res=res; res2=res*res; - + MaterialIndex=materialIndex; } @@ -25,7 +25,7 @@ inline triple normal(triple bP, triple bPP) return dot(bP,bP)*bPP-dot(bP,bPP)*bP; } -void BezierCurve::render(const triple *p, bool straight) +void BezierCurve::render(const triple *p, bool straight) { triple p0=p[0]; triple p3=p[3]; @@ -52,7 +52,7 @@ void BezierCurve::render(const triple *p, bool straight) render(p,i0,i3); append(); } - + // Use a uniform partition to draw a Bezier curve. // p is an array of 4 triples representing the control points. // Ii are the vertex indices. @@ -77,13 +77,13 @@ void BezierCurve::render(const triple *p, GLuint I0, GLuint I1) triple m3=0.5*(m0+m1); triple m4=0.5*(m1+m2); triple m5=0.5*(m3+m4); - + triple s0[]={p0,m0,m3,m5}; triple s1[]={m5,m4,m2,p3}; - + triple n0=normal(bezierPh(p0,p1,p2,p3),bezierPPh(p0,p1,p2,p3)); GLuint i0=data.vertex(m5,n0); - + render(s0,I0,i0); render(s1,i0,I1); } |