3
$\begingroup$

Bug introduced in 12.0 or earlier and persisting through 12.0.0 or later

I'm drawing some objects (lines, circles etc) in a Manipulate. I am rotating the Manipulate upon showing all the graphics. I have found for a dashed circle any rotation angle other than 0 results in the circle flickering / not being rendered. This does not happen for a solid circle.

I have made a minimal simplified demo below. If you scale the radius of the circles, with a rotation angle of 0 things are fine, dashed and solid line circles are visible. However, for other rotation angles, the dashed, but not solid, circle flickers in and out of visibility when the radius is changed. When static (radius or rotation angle not being changed with sliders), the dashed circle vanishes.

Clear["Global`*"]

Manipulate[
 (* Make a line and circle *)

 thePlaneCircle = Graphics[{Red, Dashed, Thick, Circle[{0, -5}, r]}];
 thePlaneCircleSolid = Graphics[{Red, Thick, Circle[{0, 5}, r]}];
 theLine = Graphics[Line[{{0, -50}, {0, 50}}]];

 (* Rotate and show *)
 Rotate[
  Show[thePlaneCircle, thePlaneCircleSolid, theLine]
  , rot Degree]

 , {{r, 5, "Radius"}, 1, 10, Appearance -> "Labeled"}
 , {{rot, 0, "Rotation Angle"}, 0, 360, Appearance -> "Labeled"}

 ]

I'm aware that I could avoid this if I simply did not use Rotate around Show, and exchanged my x and y coordinates, but for the purposes of my more complicated original code, this would be a pain.

However, I am puzzled as to why only the dashed circle flickers in this simplified example, regardless.

I'm reasonably new to Mathematica, so apologies if I have made a glaring silly error.

I'm using Mathematica version 12 on macOS Mojave 10.14.4.

Thanks

Update: I've submitted this a report of a possible bug. In the report pointing to this thread and showing Carls minimal example. Thanks for your help. Will report back if I get a response.

Update: Has been confirmed as a bug by Wolfram. No specific workaround available.

$\endgroup$
3
  • $\begingroup$ Looks like a bug in M12 to me. I would report it to support. A simpler example: Rotate[Graphics[{Red, Dashed, Thick, Circle[{0, -5}, 1]}], 74. Degree] $\endgroup$
    – Carl Woll
    Apr 26, 2019 at 18:41
  • $\begingroup$ Try adding TrackedSymbols :> {r, rot}. I can't test it myself because I don't have V12 $\endgroup$
    – m_goldberg
    Apr 26, 2019 at 21:19
  • $\begingroup$ Thanks @Carl Woll. I'll submit a bug report. $\endgroup$
    – flyingmind
    Apr 27, 2019 at 15:22

1 Answer 1

1
$\begingroup$

I don't know if this will be useful to you, but on V11.3, I get better behavior with this code:

Manipulate[
  thePlaneCircle = {Red, Dashed, Thick, Circle[{0, -5}, r]};
  thePlaneCircleSolid = {Red, Thick, Circle[{0, 5}, r]}; 
  theLine = Line[{{0, -50}, {0, 50}}];
  Rotate[
    Graphics[{thePlaneCircle, thePlaneCircleSolid, theLine}],
    rot Degree],
  {{r, 5, "Radius"}, 1, 10, Appearance -> "Labeled"}, 
  {{rot, 0, "Rotation Angle"}, 0, 360, 1, Appearance -> "Labeled"},
  TrackedSymbols :> {r, rot},
  Alignment -> Center,
  ContentSize -> {475, 475}]

demo

$\endgroup$
2
  • $\begingroup$ Thanks. Unfortunately this doesn't seem to work with v12. Same if I fix the rotation angle with a static variable (it is simply 90 Degrees; I added it to the manipulate to see what angles were effected). Looks like a bug in Mathematica I guess. I'll see if there are any further comments and submit a bug report if there are not. $\endgroup$
    – flyingmind
    Apr 27, 2019 at 15:19
  • $\begingroup$ Bug report submitted and post updated. I assume I don't "accept" any answers on the thread? Yours is the closest to a solution per se. Not sure of the rules / etiquette. $\endgroup$
    – flyingmind
    Apr 27, 2019 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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