From 2e1eccfb15c73d5fc486b2ae8f0f252891589898 Mon Sep 17 00:00:00 2001 From: Stefen Guzik <guzik2@llnl.gov> Date: Mon, 15 Sep 2008 07:44:35 +0000 Subject: [PATCH] Bug fix - parameter not getting through --- Geo/GeoInterpolation.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Geo/GeoInterpolation.cpp b/Geo/GeoInterpolation.cpp index 64d46d7b8d..00f59bfc77 100644 --- a/Geo/GeoInterpolation.cpp +++ b/Geo/GeoInterpolation.cpp @@ -218,7 +218,6 @@ Vertex InterpolateCurve(Curve *c, double u, int derivee) } Vertex V; - V.u = u; if(derivee) { double eps1 = (u == 0) ? 0 : 1.e-5; @@ -229,6 +228,7 @@ Vertex InterpolateCurve(Curve *c, double u, int derivee) V.Pos.X = (D[1].Pos.X - D[0].Pos.X) / (eps1 + eps2); V.Pos.Y = (D[1].Pos.Y - D[0].Pos.Y) / (eps1 + eps2); V.Pos.Z = (D[1].Pos.Z - D[0].Pos.Z) / (eps1 + eps2); + V.u = u; return V; } @@ -265,7 +265,7 @@ Vertex InterpolateCurve(Curve *c, double u, int derivee) V.Pos.Y = pp.y(); V.Pos.Z = pp.z(); } - return V; + break; case MSH_SEGM_PARAMETRIC: V.Pos.X = evaluate_scalarfunction("t", u, c->functu); @@ -273,7 +273,7 @@ Vertex InterpolateCurve(Curve *c, double u, int derivee) V.Pos.Z = evaluate_scalarfunction("t", u, c->functw); V.w = (1. - u) * c->beg->w + u * c->end->w; V.lc = (1. - u) * c->beg->lc + u * c->end->lc; - return V; + break; case MSH_SEGM_CIRC: case MSH_SEGM_CIRC_INV: @@ -298,14 +298,16 @@ Vertex InterpolateCurve(Curve *c, double u, int derivee) V.Pos.Z += c->Circle.v[1]->Pos.Z; V.w = (1. - u) * c->beg->w + u * c->end->w; V.lc = (1. - u) * c->beg->lc + u * c->end->lc; - return V; + break; case MSH_SEGM_BSPLN: case MSH_SEGM_BEZIER: - return InterpolateUBS(c, u, 0); + V = InterpolateUBS(c, u, 0); + break; case MSH_SEGM_NURBS: - return InterpolateNurbs(c, u, 0); + V = InterpolateNurbs(c, u, 0); + break; case MSH_SEGM_SPLN: N = List_Nbr(c->Control_Points); @@ -355,23 +357,25 @@ Vertex InterpolateCurve(Curve *c, double u, int derivee) V.Pos.X = pt.x(); V.Pos.Y = pt.y(); V.Pos.Z = pt.z(); - return V; } else - return InterpolateCubicSpline(v, t, c->mat, 0, t1, t2); + V = InterpolateCubicSpline(v, t, c->mat, 0, t1, t2); + break; case MSH_SEGM_BND_LAYER: Msg::Error("Cannot interpolate boundary layer curve"); - return V; + break; case MSH_SEGM_DISCRETE: Msg::Error("Cannot interpolate discrete curve"); - return V; + break; default: Msg::Error("Unknown curve type in interpolation"); - return V; + break; } + V.u = u; + return V; } -- GitLab