Skip to main content
added 369 characters in body
Source Link
george2079
  • 39.1k
  • 1
  • 44
  • 111

The plot is sped up substantially if you use Evaluate:

  ParametricPlot[
      Evaluate[ Total@MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts]] ,
           {u, a, b}, opts]

(I only looked a trial 1 , but I think your other try have the same issue )

It helps a little more if you remove the Simplify from NBSpline and simplify the whole thing:

 ParametricPlot[
       Evaluate[Total@
             MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts] // 
                  Simplify], {u, a, b}, opts]

Your original form is a sum of piecewise expressions. The outer Simplify condenses the whole thing into a single piecewise.

The gaps go awayseem to relate the nature of the discontinuity in derivatives of the bspline w/ respect to its parameter at the knots, which evidently fools Parametric Plot into thinking there is an actual discontinuity.

The gaps close with PlotPoints -> 1000 ( this slows it down a bit but no too bad, though if you look at the graphics produced you'll see you still have separate Lines for each portion. I don't think there is anything to do about that except not use )ParametricPlot.

You might also try doing away with ParametricPlot and doing Graphics@Line@Table .. , which may speed it up as well.

The plot is sped up substantially if you use Evaluate:

  ParametricPlot[
      Evaluate[ Total@MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts]] ,
           {u, a, b}, opts]

(I only looked a trial 1 , but I think your other try have the same issue )

It helps a little more if you remove the Simplify from NBSpline and simplify the whole thing:

 ParametricPlot[
       Evaluate[Total@
             MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts] // 
                  Simplify], {u, a, b}, opts]

Your original form is a sum of piecewise expressions. The outer Simplify condenses the whole thing into a single piecewise.

The gaps go away with PlotPoints -> 1000 ( this slows it down a bit but no too bad. )

You might also try doing away with ParametricPlot and doing Graphics@Line@Table .. .

The plot is sped up substantially if you use Evaluate:

  ParametricPlot[
      Evaluate[ Total@MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts]] ,
           {u, a, b}, opts]

(I only looked a trial 1 , but I think your other try have the same issue )

It helps a little more if you remove the Simplify from NBSpline and simplify the whole thing:

 ParametricPlot[
       Evaluate[Total@
             MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts] // 
                  Simplify], {u, a, b}, opts]

Your original form is a sum of piecewise expressions. The outer Simplify condenses the whole thing into a single piecewise.

The gaps seem to relate the nature of the discontinuity in derivatives of the bspline w/ respect to its parameter at the knots, which evidently fools Parametric Plot into thinking there is an actual discontinuity.

The gaps close with PlotPoints -> 1000 , though if you look at the graphics produced you'll see you still have separate Lines for each portion. I don't think there is anything to do about that except not use ParametricPlot.

You might try doing away with ParametricPlot and doing Graphics@Line@Table .. , which may speed it up as well.

added 180 characters in body
Source Link
george2079
  • 39.1k
  • 1
  • 44
  • 111

The plot is sped up substantially if you use Evaluate:

  ParametricPlot[
      Evaluate[ Total@MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts]] ,
           {u, a, b}, opts]

(I only looked a trial 1 , but I think your other try have the same issue )

It helps a little more if you remove the Simplify from NBSpline and simplify the whole thing:

 ParametricPlot[
       Evaluate[Total@
             MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts] // 
                  Simplify], {u, a, b}, opts]

Your original form is a sum of piecewise expressions. The outer Simplify condenses the whole thing into a single piecewise.

The gaps go away with PlotPoints -> 1000 ( this slows it down a bit but no too bad. )

You might also try doing away with ParametricPlot and doing Graphics@Line@Table .. .

The plot is sped up substantially if you use Evaluate:

  ParametricPlot[
      Evaluate[ Total@MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts]] ,
           {u, a, b}, opts]

(I only looked a trial 1 , but I think your other try have the same issue )

It helps a little more if you remove the Simplify from NBSpline and simplify the whole thing:

 ParametricPlot[
       Evaluate[Total@
             MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts] // 
                  Simplify], {u, a, b}, opts]

Your original form is a sum of piecewise expressions. The outer Simplify condenses the whole thing into a single piecewise.

The plot is sped up substantially if you use Evaluate:

  ParametricPlot[
      Evaluate[ Total@MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts]] ,
           {u, a, b}, opts]

(I only looked a trial 1 , but I think your other try have the same issue )

It helps a little more if you remove the Simplify from NBSpline and simplify the whole thing:

 ParametricPlot[
       Evaluate[Total@
             MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts] // 
                  Simplify], {u, a, b}, opts]

Your original form is a sum of piecewise expressions. The outer Simplify condenses the whole thing into a single piecewise.

The gaps go away with PlotPoints -> 1000 ( this slows it down a bit but no too bad. )

You might also try doing away with ParametricPlot and doing Graphics@Line@Table .. .

added 57 characters in body
Source Link
george2079
  • 39.1k
  • 1
  • 44
  • 111

The plot is sped up substantially if you use Evaluate:

ParametricPlot[Evaluate[ Total@MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts]]

  ParametricPlot[
      Evaluate[ Total@MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts]] ,
           {u, a, b}, opts]

(I only looked a trial 1 , but I think your other try have the same issue )

It helps a little more if you remove the Simplify from NBSpline and simplify the whole thing:

 ParametricPlot[
       Evaluate[Total@
             MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts] // 
                  Simplify], {u, a, b}, opts]

Your original form is a sum of piecewise expressions. The outer Simplify condenses the whole thing into a single piecewise.

The plot is sped up substantially if you use Evaluate:

ParametricPlot[Evaluate[ Total@MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts]]

(I only looked a trial 1 )

The plot is sped up substantially if you use Evaluate:

  ParametricPlot[
      Evaluate[ Total@MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts]] ,
           {u, a, b}, opts]

(I only looked a trial 1 , but I think your other try have the same issue )

It helps a little more if you remove the Simplify from NBSpline and simplify the whole thing:

 ParametricPlot[
       Evaluate[Total@
             MapIndexed[NBSpline[First@#2 - 1, p, knots, u] #1 &, pts] // 
                  Simplify], {u, a, b}, opts]

Your original form is a sum of piecewise expressions. The outer Simplify condenses the whole thing into a single piecewise.

Source Link
george2079
  • 39.1k
  • 1
  • 44
  • 111
Loading