% lua-tikz3dtools.sty \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesExplPackage{lua-tikz3dtools}{2025/11/22}{v2.1.0}{% Experimental LuaLaTeX package for 3D illustrations in TikZ. } \RequirePackage{tikz} \NewDocumentCommand{\luatikztdtoolsset}{o}{\tikzset{/lua-tikz3dtools/.cd, #1}} \tikzset{ /lua-tikz3dtools/.is~family % abbreviated "td" ,/lua-tikz3dtools/.cd ,/lua-tikz3dtools/parametric/.cd % appreviated "p" ,/lua-tikz3dtools/parametric/matrix/.cd % abbreviated "m" ,object/.code = {\protected@edef\luatikztdtools@p@m@transformation{#1}} ,object = {identity_matrix()} ,name/.code = {\protected@edef\luatikztdtools@p@m@name{#1}} ,name = {Change me!} ,/lua-tikz3dtools/parametric/point/.cd % abbreviated "p" ,x/.code = {\protected@edef\luatikztdtools@p@p@x{#1}} ,y/.code = {\protected@edef\luatikztdtools@p@p@y{#1}} ,z/.code = {\protected@edef\luatikztdtools@p@p@z{#1}} ,fill~options/.estore~in = \luatikztdtools@p@p@filloptions ,transformation/.code = {\protected@edef\luatikztdtools@p@p@transformation{#1}} ,x = {0} ,y = {0} ,z = {0} ,fill~options = {fill} ,transformation = {identity_matrix()} ,/lua-tikz3dtools/parametric/label/.cd % abbreviated "l" ,x/.code = {\protected@edef\luatikztdtools@p@l@x{#1}} ,y/.code = {\protected@edef\luatikztdtools@p@l@y{#1}} ,z/.code = {\protected@edef\luatikztdtools@p@l@z{#1}} ,name/.code = {\protected@edef\luatikztdtools@p@l@name{#1}} ,transformation/.code = {\protected@edef\luatikztdtools@p@l@transformation{#1}} ,x = {0} ,y = {0} ,z = {0} ,name = {George} ,transformation = {identity_matrix()} ,/lua-tikz3dtools/parametric/curve/.cd % abbreviated "c" ,ustart/.estore~in = \luatikztdtools@p@c@ustart ,ustop/.estore~in = \luatikztdtools@p@c@ustop ,usamples/.estore~in = \luatikztdtools@p@c@usamples ,x/.code = {\protected@edef\luatikztdtools@p@c@x{#1}} ,y/.code = {\protected@edef\luatikztdtools@p@c@y{#1}} ,z/.code = {\protected@edef\luatikztdtools@p@c@z{#1}} ,transformation/.code = {\protected@edef\luatikztdtools@p@c@transformation{#1}} ,draw~options/.estore~in = \luatikztdtools@p@c@drawoptions ,arrow~tip/.code = {\protected@edef\luatikztdtools@p@c@arrowtip{#1}} ,arrow~tail/.code = {\protected@edef\luatikztdtools@p@c@arrowtail{#1}} ,arrow~tip~options/.code = {\protected@edef\luatikztdtools@p@c@arrowtipoptions{#1}} ,arrow~tail~options/.code = {\protected@edef\luatikztdtools@p@c@arrowtailoptions{#1}} ,filter/.code = {\protected@edef\luatikztdtools@p@c@filter{#1}} ,ustart = {0} ,ustop = {1} ,usamples = {64} ,x = {cos(tau*u)} ,y = {sin(tau*u)} ,z = {0} ,transformation = {identity_matrix()} ,draw~options = {draw} ,arrow~tip = {false} ,arrow~tail = {false} ,arrow~tip~options = {fill = black} ,arrow~tail~options = {fill = black} ,filter = {true} ,/lua-tikz3dtools/parametric/surface/.cd % abbreviated "s" ,ustart/.estore~in = \luatikztdtools@p@s@ustart ,ustop/.estore~in = \luatikztdtools@p@s@ustop ,usamples/.estore~in = \luatikztdtools@p@s@usamples ,vstart/.estore~in = \luatikztdtools@p@s@vstart ,vstop/.estore~in = \luatikztdtools@p@s@vstop ,vsamples/.estore~in = \luatikztdtools@p@s@vsamples ,x/.code = {\protected@edef\luatikztdtools@p@s@x{#1}} ,y/.code = {\protected@edef\luatikztdtools@p@s@y{#1}} ,z/.code = {\protected@edef\luatikztdtools@p@s@z{#1}} ,transformation/.code = {\protected@edef\luatikztdtools@p@s@transformation{#1}} ,fill~options/.code = {\protected@edef\luatikztdtools@p@s@filloptions{#1}} ,filter/.code = {\protected@edef\luatikztdtools@p@s@filter{#1}} ,ustart = {0} ,ustop = {1} ,usamples = {10} ,vstart = {0} ,vstop = {1} ,vsamples = {10} ,x = {sphere(tau*u, pi*v)[1][1]} ,y = {sphere(tau*u, pi*v)[1][2]} ,z = {sphere(tau*u, pi*v)[1][3]} ,transformation = {identity_matrix()} ,fill~options = {fill, fill opacity = 0.3} ,filter = {true} ,/lua-tikz3dtools/parametric/solid/.cd % abbreviated "solid" ,ustart/.estore~in = \luatikztdtools@p@solid@ustart ,ustop/.estore~in = \luatikztdtools@p@solid@ustop ,usamples/.estore~in = \luatikztdtools@p@solid@usamples ,vstart/.estore~in = \luatikztdtools@p@solid@vstart ,vstop/.estore~in = \luatikztdtools@p@solid@vstop ,vsamples/.estore~in = \luatikztdtools@p@solid@vsamples ,wstart/.estore~in = \luatikztdtools@p@solid@wstart ,wstop/.estore~in = \luatikztdtools@p@solid@wstop ,wsamples/.estore~in = \luatikztdtools@p@solid@wsamples ,x/.code = {\protected@edef\luatikztdtools@p@solid@x{#1}} ,y/.code = {\protected@edef\luatikztdtools@p@solid@y{#1}} ,z/.code = {\protected@edef\luatikztdtools@p@solid@z{#1}} ,transformation/.code = {\protected@edef\luatikztdtools@p@solid@transformation{#1}} ,fill~options/.estore~in = \luatikztdtools@p@solid@filloptions ,filter/.code = {\protected@edef\luatikztdtools@p@solid@filter{#1}} ,ustart = {0} ,ustop = {1} ,usamples = {10} ,vstart = {0} ,vstop = {1} ,vsamples = {10} ,wstart = {0} ,wstop = {1} ,wsamples = {10} ,x = {u} ,y = {v} ,z = {w} ,transformation = {identity_matrix()} ,fill~options = {fill, fill opacity = 0.3} ,filter = {true} } \lua_load_module:n { lua-tikz3dtools-implementation } \NewDocumentCommand { \appendpoint } {o} { \group_begin: \tikzset{ /lua-tikz3dtools/parametric/point/.search~also = {/tikz} ,/lua-tikz3dtools/parametric/point/.cd ,#1 } \__lua_tikztdtools_appendpoint: \group_end: } \NewDocumentCommand { \appendlabel } {o} { \group_begin: \tikzset{ /lua-tikz3dtools/parametric/label/.search~also = {/tikz} ,/lua-tikz3dtools/parametric/label/.cd ,#1 } \__lua_tikztdtools_appendlabel: \group_end: } \NewDocumentCommand { \appendcurve } {o} { \group_begin: \tikzset{ /lua-tikz3dtools/parametric/curve/.search~also = {/tikz} ,/lua-tikz3dtools/parametric/curve/.cd ,#1 } \__lua_tikztdtools_appendcurve: \group_end: } \NewDocumentCommand { \appendsurface } {o} { \group_begin: \tikzset{ /lua-tikz3dtools/parametric/surface/.search~also = {/tikz} ,/lua-tikz3dtools/parametric/surface/.cd ,#1 } \__lua_tikztdtools_appendsurface: \group_end: } \NewDocumentCommand { \appendsolid } {o} { \group_begin: \tikzset{ /lua-tikz3dtools/parametric/solid/.search~also = {/tikz} ,/lua-tikz3dtools/parametric/solid/.cd ,#1 } \__lua_tikztdtools_appendsolid: \group_end: } \NewDocumentCommand { \displaysegments } {} { \group_begin: \__lua_tikztdtools_displaysegments: \group_end: } \NewDocumentCommand { \setobject } {o} { \group_begin: \tikzset{ /lua-tikz3dtools/parametric/matrix/.search~also = {/tikz} ,/lua-tikz3dtools/parametric/matrix/.cd ,#1 } \__lua_tikztdtools_setobject: \group_end: } \NewDocumentCommand { \luatikztdtools } {} { \texttt{lua-tikz3dtools} }