# Image artifacts while using BSplineCurve

Mathematica provides an example of visualizing a Hilbert curve using splines as a Graphics object in this entry in its documentation system.

However, when one attempts to change the thickness, some graphical artifacts are generated (notice the seemingly arbitrarily placed sharp nubs on the main curve). The generating code and image are included below—notice the only difference between this line of code and the code in the documentation center is the argument for the thickness.

Is there a quick way to avoid/get rid of these?

Graphics[{Thickness[50/1500], HilbertCurve[4] /. Line -> BSplineCurve}]


• See CapForm - either CapForm[None] or CapForm["Round"] fixes the issue – Lukas Lang Feb 5 at 16:03
• My Mathematica 12 for Linux draws the curve without artifacts. I suggest tagging the post as a bug. – aooiiii Feb 5 at 16:07
• @aooiiii. I don't think there is any bug; just the usual bad behavior that results from not having specified the best end cap form. – m_goldberg Feb 6 at 2:00
• @m_goldberg, shouldn't Mathematica's output be invariant to the operating system it's running on? – aooiiii Feb 6 at 10:43
• @aooiiii. That would be ideal but I suspect the cost in time and money to achieve that goal is prohibitive. – m_goldberg Feb 8 at 2:44

I evaluated the OP's code with V12.0 running on MacOS 10.13.4. It reproduced his image as I thought it would. Some of the corners of the default "Square" end caps extend beyond the curve boundary causing the artifacts the OP observed. On the other hand, setting the end caps to None or "Butt" produced voids. So the only form I recommend is:
Graphics[{Thickness[50/1500], CapForm["Round"], HilbertCurve[4] /. Line -> BSplineCurve}]