# Extracting tube style from KnotData

How do I extract the tube style (including lighting, viewpoint, ...) from KnotData["Trefoil"]

and apply it to a space curve, such as

ParametricPlot3D[{Cos[θ], Sin[θ], Cos[2 θ]}, {θ, 0, 2 π}] ?

Options@KnotData["Trefoil"]
(* {Boxed -> False, PlotRange -> {All, All, All},
ViewPoint -> {0, 0.01, 5}} *)


You can see the ViewPoint above. Since the lighting is not mentioned, it has the default value.

Generally, for any Graphics3D, just paste it in the middle of an Options[...] or Options[..., ViewPoint].

thickness = 0.1;
ParametricPlot3D[{Cos[\[Theta]], Sin[\[Theta]],
Cos[2 \[Theta]]}, {\[Theta], 0, 2 \[Pi]},
PlotPoints -> 360,
PlotStyle -> White,
PlotRangePadding -> 2 thickness] /. Line[x__] :> Tube[x, thickness]


The tubes are white, actually. The colors result from the defaults for the graphics option Lighting.

• Great. But HOW did you extract the data? Just guess and check? – David G. Stork Nov 27 '17 at 23:00
• Graphics3D objects can be inspected. The one created by KnotData["Trefoil"] just contains a GraphicsComplex and the standard color for a GraphicsComplex is White. That's about the color. ParametricPlot3D creates Graphics3D objects containing Line primitives (if you plot curves) and these can be changed into Tube primitives just as above. The thickness was a pure guess. – Henrik Schumacher Nov 27 '17 at 23:04
• Note that PlotStyle -> {White, Tube[thickness]} may be used instead of post-processing the Line objects. – Michael E2 Nov 27 '17 at 23:31
• @MichaelE2 Good to know! And it is rendered with VertexNormals! However, do you also see that the ends of the curve are visible this way? – Henrik Schumacher Nov 27 '17 at 23:38
• @MichaelE2 I mean: Can something to be done about that? I wrote my own tubification function long time ago, but it would be nice to know if there is a built-in alternative. – Henrik Schumacher Nov 27 '17 at 23:45