6
$\begingroup$

I'm facing a problem with Mathematica 11.1.1 on MacOS (2016 Macbook Pro). The Thickness and AbsoluteThickness options in PlotStyle do not scale consistently. There is a "jump" around the value AbsoluteThickness[3] (for Thickness the value depends on the image size).

ParametricPlot3D[{{Cos[t], Sin[t], .2}, {Cos[t], Sin[t], -.2}}, {t, 0, 10}, 
PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, 
PlotStyle -> {AbsoluteThickness[3.00001], AbsoluteThickness[3.]}]

The problem is visible in the notebook and also in files exported with the command Export, independently of the type (vector PDF, PNG,...) and or resolution (see image below).

This is a regression, because I have notebooks written in version 10 that do not have the problem, but the problem occurs if I reevaluate them with this version. I can't say if the problem was introduced in v11 or in a successive release. The problem is not there on a Ubuntu setup with Mathematica 11.1.1.

Can anyone reproduce this?

File produced with export

$\endgroup$
  • $\begingroup$ I have MMA 11.1.0.0 on Windows 8.1 and is OK. :) $\endgroup$ – Mariusz Iwaniuk Jul 31 '17 at 9:44
  • $\begingroup$ Use AbsoluteThickness[] if you want thickness that is independent of image size. (Pay special attention to the second sentence of Thickness[]'s usage message.) Also, please don't use the bugs tag until your observations have been confirmed by other users. $\endgroup$ – J. M. is away Jul 31 '17 at 9:59
  • 1
    $\begingroup$ Your code works fine on MMA 10.4 on Win10. $\endgroup$ – aardvark2012 Jul 31 '17 at 10:48
  • $\begingroup$ @J.M. the problem is the same with AbsoluteThickness around the value of 3. Now, as you correctly point out, it is independent of the image size. I edited the question. $\endgroup$ – Pincopallino Jul 31 '17 at 13:42
6
$\begingroup$

It turns out that Dashed does not suffer from this problem. A temporary fix is to use a dashed line with ridiculously large length for the dash:

ParametricPlot3D[{{Cos[t],Sin[t],.2},{Cos[t],Sin[t],-.2}},   
 {t,0,10},PlotRange->{{-1,1},{-1,1},{-1,1}},PlotStyle->
 {AbsoluteThickness[3.00001],
 {AbsoluteDashing[{1000,0}],AbsoluteThickness[3.]}}
]

enter image description here

$\endgroup$
  • $\begingroup$ (+1) Nice find! $\endgroup$ – Michael E2 Jan 12 '18 at 13:02
  • $\begingroup$ It's nice that we find workarounds for this but I believe that people at Wolfram should address this since it clearly is a bug on the Mac platform $\endgroup$ – Pincopallino Jan 12 '18 at 17:28
  • $\begingroup$ Wolfram has a link for reporting bugs: wolfram.com/support/contact/email, I suggest that you send them a note. $\endgroup$ – Themis Jan 12 '18 at 20:11
  • $\begingroup$ @Pincopallino I have an idea it's a design choice and not a bug; and if my idea is correct, it makes sense - albeit in hindsight - that dashing appears to be a workaround, since dashing would invoke a general line-drawing algorithm instead of an optimized, undashed, single-pixel-width one. I do think there should be an option to turn the threshold on or off. $\endgroup$ – Michael E2 Jan 13 '18 at 3:37
  • $\begingroup$ My view is it's a bug. Not only is it undocumented (it cost me days of trial and error), but as @Mariusz said, the problem does not show up in Windows. $\endgroup$ – Themis Jan 13 '18 at 11:08
1
$\begingroup$

I can, but to a less severe extent. Mathematica 11.0.1, on Mid 2015 Macbook Pro (15" retina display with standard resolution) with macos 10.12.6

enter image description here

And the new code with AbsoluteThickness

ParametricPlot3D[{{Cos[t], Sin[t], .2}, {Cos[t], Sin[t], -.2}}, {t, 0,   10}, 
 PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, 
 PlotStyle -> {AbsoluteThickness[3.00001], AbsoluteThickness[3.]}
]

produces

enter image description here

$\endgroup$
  • $\begingroup$ What mac do you have? What is the resolution of the screen? Also, can you try with the new code in the question, which uses AbsoluteThickness instead of Thicnkess? $\endgroup$ – Pincopallino Jul 31 '17 at 15:10
1
$\begingroup$

I get the same problem on my Mac:

$Version
(*  "11.2.0 for Mac OS X x86 (64-bit) (September 11, 2017)"  *)

It's a Graphics3D issue. The discontinuity also happens with Thickness[], but the cutoff changes with the width of the image. I think it's an optimization, and at the cutoff, rendering switches from a fast, pixel-width routine to one that calculates thickness. But that's just a guess.

There is a setting that gives a more continuous variation in thickness, but at a cost. See RenderingOptions:

{
 thickness = 2.5; 
 plot = ParametricPlot3D[{Sin[u], Cos[u], u/10}, {u, 0, 20}, 
   PlotStyle -> AbsoluteThickness[thickness], ImageSize -> 300];
 Style[plot, RenderingOptions -> {"3DRenderingEngine" -> "Mesa"}],
 thickness = 3.; 
 plot = ParametricPlot3D[{Sin[u], Cos[u], u/10}, {u, 0, 20}, 
   PlotStyle -> AbsoluteThickness[thickness], ImageSize -> 300];
 Style[plot, RenderingOptions -> {"3DRenderingEngine" -> "Mesa"}]
 }

enter image description here

I see a difference in thickness (you can adjust thickness as desired), but it also looks to me that some paint has flaked off.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.