Can anyone help me in the factorization of the following code, where only the view settings change between the 1st and the 2nd examples?
\documentclass[varwidth, border = 3pt]{standalone}
\usepackage[svgnames]{xcolor}
\usepackage[3d]{luadraw}
\begin{document}
\section*{1st point of view}
\begin{luadraw}{name = mesh-cone-1}
local graphzone = graph3d:new{
window = {-1.5, 7, -2.5, 2.5},
viewdir = {290, 60},
size = {10, 10}
}
graphzone:Linejoin("round")
local genecurve = function(t)
return M(t, 2 - t/2, 0)
end
local cone = rotcurve(
genecurve, -0.2, 6.5,
{Origin, -vecI},
0, 360,
{grid = {25, 36}})
graphzone:Dfacet(
cone,
{color = "orange",
contrast = 0.5})
graphzone:Show()
\end{luadraw}
\section*{2nd point of view}
\begin{luadraw}{name = mesh-cone-2}
local graphzone = graph3d:new{
window = {-1.5, 7, -2.5, 3.5}, -- CHANGES MADE
viewdir = {240, 60}, -- HERE ONLY!
size = {10, 10}
}
graphzone:Linejoin("round")
local genecurve = function(t)
return M(t, 2 - t/2, 0)
end
local cone = rotcurve(
genecurve,
-0.2, 6.5,
{Origin, -vecI},
0, 360,
{grid = {25, 36}})
graphzone:Dfacet(
cone,
{color = "orange",
contrast = 0.5})
graphzone:Show()
\end{luadraw}
\end{document}
window = {-1.5, 7, -2.5, 3.5}, % CHANGES MADE viewdir = {240, 60}, % HERE ONLY!
You change towindow = {-1.5, 7, -2.5, 3.5}, -- CHANGES MADE viewdir = {240, 60}, -- HERE ONLY!
luadraw
so my suggestion was just a generic one.