7

Bug introduced in 11.3 or earlier and fixed in 12.1


I am running Mathematica 11.3 and would like to see if this behavior is still present in newer versions of Mathematica before submitting a bug report.


Here is my example code

triangle[txtrq_] := 
 Module[{arcs = {
     BSplineCurve[{{1, 0}, {1, Sqrt[3]/3}, {1/2, Sqrt[3]/2}},
      SplineWeights -> {1, Sqrt[3]/2, 1}], 
     BSplineCurve[{(*{1/2,Sqrt[3]/2},*){0, Sqrt[3]/3}, {0, 0}}, 
      SplineWeights -> {1, Sqrt[3]/2, 1}], 
     BSplineCurve[{(*{0,0},*){1/2, -Sqrt[3]/6}, {1, 0}}, 
      SplineWeights -> {1, Sqrt[3]/2, 1}]}, txtr}, 
  txtr = Graphics[{Thickness[1/8], RGBColor[1, 7/8, 0], 
     Line[{{{0, 1/2}, {1/2, 1}}, {{1/2, 0}, {1, 1/2}},
         {{0, 1/2}, {1/2, 0}}, {{1/2, 1}, {1, 1/2}}}]}, 
    PlotRange -> {{0, 1}, {0, 1}}]; 
  Graphics[{Sequence @@ If[txtrq, {Texture[txtr]}, {}], 
    RGBColor[1, 7/8, 0], 
    FilledCurve[arcs, 
     Sequence @@ 
      If[txtrq, {VertexTextureCoordinates -> 
         20 {{1, 0}, {1, Sqrt[3]/3}, {1/2, Sqrt[3]/2},
           (*{1/2, Sqrt[3]/2},*){0, Sqrt[3]/3}, {0, 0},
           (*{0, 0},*){1/2, -Sqrt[3]/6}, {1, 0}}}, {}]], 
    RGBColor[1/5, 1/2, 1], Thickness[1/50], 
    JoinedCurve[arcs, CurveClosed -> True]}, ImageSize -> 400]]

Note that I have commented out the first point in all but the first of the BSplineCurve structures in arcs and the corresponding points in the VertexTextureCoordinates. This is explained in the answers to this question.


Here is the output with the Texture and VertexTextureCoordinates removed:

triangle[False]

enter image description here

Here is the output with the Texture and VertexTextureCoordinates included:

triangle[True]

enter image description here

Note that the JoinedCurve is closed in the absence of the Texture in the FilledCurve. However, when the Texture is present in the FilledCurve, the JoinedCurve fails to close (the bottom right corner lacks its mitered join). It seems odd that an option to one graphics directive causes a problem in the rendering of another.

Does this behavior persist in newer versions of Mathematica?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
robjohn
  • 1,071
  • 8
  • 18

1 Answers1

7

The bug had been fixed. Here we attach the result.

$Version
(* 12.2.0 for Linux x86 (64-bit) (December 9, 2020) *)
Row[triangle /@ {True, False}]

enter image description here

cvgmt
  • 72,231
  • 4
  • 75
  • 133