I think I've identified a bug in how VertexColors
are treated when rendering a Tube
object where the underlying data is a BSplineCurve
(it also affects BezierCurve
), it appears that the colors of the tube are "snapping" to the nearest primitive colors for some reason. Here's a minimum working example that should produce an Orange Tube
object, but the object is definitively Red in color:
Graphics3D[{Tube[BSplineCurve[{{0, 0, 0}, {0, 0, 1}}], 0.05,
VertexColors -> {Orange, Orange}]},
PlotRange -> {{-0.1, 0.1}, {-0.1, 0.1}, Automatic},
Boxed -> False, Lighting -> "Neutral"]
Some testing has shown that which color is snapped to is very sensitive to the particular vertex colors chosen, for instance setting the VertexColors
argument to {Hue[0.166],Hue[0.167]}
renders a tube with one end green and one end red:
Get rid of the BSplineCurve
within the Tube
call and the object has the proper color:
This is in Mathematica 9 on Mac OS X 10.10.2, but I have verification that this behavior persists in the latest version of Mathematica 10 (10.0.2) for Windows (thanks Mr. Wizard!).
If this is indeed a bug, is there a work-around aside from abandoning BSplineCurve
? It would be preferable for me to be able to render Tube
objects smoothly.
Graphics3D[{Orange, Tube[BSplineCurve[{{0., 0., 0.}, {0., 0., 1.}}], 0.05]}, PlotRange -> {{-0.1, 0.1}, {-0.1, 0.1}, Automatic}, Boxed -> False, Lighting -> "Neutral"]
but it might be probably too basic for more complex plots ? $\endgroup$