Problem with ParametricPlot3D in Mathematica

  • Context: Mathematica 
  • Thread starter Thread starter Barnak
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around issues with output quality when using ParametricPlot3D in Mathematica 7, particularly in relation to rendering a complicated curve derived from numerical integration. Participants explore options for achieving a smoother curve without excessively increasing the file size of the exported PDF.

Discussion Character

  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant reports that increasing PlotPoints to 5000 improves smoothness but results in a large PDF file size, which is undesirable.
  • Another participant suggests using MaxRecursion instead of PlotPoints to manage detail in convoluted parts of the curve, noting that the default setting may not provide sufficient detail.
  • A later reply indicates that while MaxRecursion has been tried, it does not consistently resolve the issue.
  • Further suggestions include experimenting with the interaction between PlotPoints and MaxRecursion, and monitoring messages about smoothness to find an acceptable configuration.
  • One participant recalls a potential solution involving a PDF optimizer that could reduce file size without significant loss of quality, though they express uncertainty about its effectiveness.
  • Another participant proposes the idea of writing custom code to generate the desired curve directly, based on their understanding of the curve's characteristics.

Areas of Agreement / Disagreement

Participants do not reach a consensus on a single solution, as multiple approaches are suggested and some methods have varying effectiveness depending on the specific curve being plotted.

Contextual Notes

Participants note limitations in the effectiveness of the options discussed, indicating that the interaction between PlotPoints and MaxRecursion may vary based on the complexity of the curve. There is also mention of potential issues with the default settings in Mathematica 7 compared to earlier versions.

Barnak
Messages
62
Reaction score
0
I'm having an output quality problem with ParametricPlot3D in Mathematica 7.

I need to show a complicated curve found by numerical integration of a differential equation (using NDSolve), and export the curve's graphic (from ParametricPlot3D) to PDF, so I can use it in another application. I know how to do it, and it's working, but the curve is having a very crude aspect (straight lines, instead of a smooth curve, or some parts of the curve aren't right).

Of course, I could add the option PlotPoints-> 5000 to smooth the curve (4000 or less isn't enough, apparently), but this gives a huge PDF file (about 10 MB for a simple vectorial graphic), and it's useless for what I need to do with it.

The exact same code in Mathematica 4 (which I don't have access anymore) didn't gave me the problem at all : I got a nicely looking curve which could be exported into a small PDF file. So I don't understand what is happening here with Mathematica 7.

Do I need to add some special directives to the ParametricPlot3D, to get an optimised smooth curve, without having to add something like PlotPoints -> 5000 ?
 
Physics news on Phys.org
Instead of PlotPoints-> 5000 try MaxRecursion->somenumber, and without your curve I can't even guess where you might start. The default for MaxRecursion is Automatic and it appears that some part of your curve is sufficiently convoluted that it bails out before getting the detail you want.

MaxRecursion should enable it to spend more work on the convoluted parts without needing to have vast numbers of points on the smooth parts. Look up MaxRecursion in the help system and in ParametricPlot3D to get limited information on how this works. Start slowly and see how it behaves as you increment it.

You can also turn on informative messages about it not being able to achieve sufficient smoothness with On[ParametricPlot3d:accbend]. This can give you some idea when it cannot accomplish what it thinks you are asking for.
 
Thanks, this may help.

I already used the MaxRecursion option however. It helps in some cases, but not always.
 
Barnak said:
I already used the MaxRecursion option however. It helps in some cases, but not always.

Fiddle with the interaction between PlotPoints and MaxRecursion, with the message turned on to see when it believes it cannot find a smooth enough curve and see if you can find an acceptable setting. Choose small specific complicated parts of your curve and watch how those two options interact. PlotPoints should give fixed spacing between the points, no matter how smooth or complicated the curve is at some position. MaxRecursion should enable more or less subdivision between points, more near positions where the curve is complicated.

A completely different approach, I vaguely recall a pdf-optimizer that would eat a large inefficient pdf and emit a very similar appearing but far smaller pdf, but that was many many years ago and I may be incorrect.

Or I suppose you could consider writing code that would generate exactly the curve you desire, based on your knowledge of the curve and the demands you have.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 0 ·
Replies
0
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K