3

Suppose we are working in the three-dimensional real vector space V. A cone is a subset C of V such that if an element v of V lies in C, then all of its nonnegative multiples also lie in C. I would like to draw, using TikZ, a cone that simulates infinitely many extremal rays, all accumulating toward a fixed one. A section of the cone should therefore look like a “polygon with infinitely many sides”.

For example, the cone here Tikz: cones with a wide base is a circular one. I would like mine to be "polyhedral" away from the accumulation ray.

How would you do that?

7
  • Do you have a reference picture? I’m having a little trouble visualizing this. Commented 11 hours ago
  • The best approximation I have is here (picture on page 78): math.ens.psl.eu/~debarre/M2.pdf Commented 11 hours ago
  • So you want a more lightly tessellated cone, so that you can see the polygonal shape? Commented 11 hours ago
  • What do you mean by "more lightly tessellated"? Sorry, I don't think I've got it... Commented 11 hours ago
  • 1
    Ahh, you want a sampling which is not an arithmetic sequence. Commented 11 hours ago

1 Answer 1

2

I did it using powers of 0.5, with help from copilot.

I had to fiddle with it a bit, so the code is a bit clunky, but this should be it.

\documentclass[tikz,border=1cm]{standalone}
\usepackage{lua-tikz3dtools} % https://github.com/Pseudonym321/TikZ-Animations/tree/master1/TikZ/lua-tikz3dtools
\begin{document}
\begin{luatikztdtoolspicture}[
    C1 = { {{-10,-10,-10,1}} }
    ,C2 = { {{10,10,10,1}} }
    ,light = { {{0,0,1,1}} }
]
    % Parameters
    \def\N{6} % number of faces
    \def\decay{0.5} % shrink factor

    \pgfmathsetmacro{\uA}{0}
    \pgfmathsetmacro{\uB}{pi}
    \pgfmathsetmacro{\udiff}{\uB-\uA}
    \pgfmathsetmacro{\ustart}{\uA}

    \foreach \p in {-1,1} {
    \foreach \k in {0,...,\N} {
        \pgfmathsetmacro{\udelta}{\udiff*pow(\decay,\k)}
        \pgfmathsetmacro{\uend}{\ustart+\udelta}
        \pgfmathparse{\k!=0 && \k!=1}
        \ifnum\pgfmathresult=1
        \appendsurface[
            ustart = {\ustart}
            ,ustop = {\uend}
            ,usamples = {2}
            ,vstart = {0}
            ,vstop = {tau}
            ,vsamples = {2}
            ,x = {-v}
            ,y = {v*cos(u)/5}
            ,z = {\p*v*sin(u)/5}
            ,transformation = {euler(pi/2,pi/3,pi/6)}
            ,fill options = {
                preaction = {fill = white, fill opacity = 1}
                ,postaction = {
                    draw = black
                    ,ultra thin
                    ,line join = round
                }
            }
        ]
        \fi
        \pgfmathparse{\k==1}
        \ifnum\pgfmathresult=1
        \appendsurface[
            ustart = {pi}
            ,ustop = {\uend}
            ,usamples = {2}
            ,vstart = {0}
            ,vstop = {tau}
            ,vsamples = {2}
            ,x = {-v}
            ,y = {v*cos(u)/5}
            ,z = {\p*v*sin(u)/5}
            ,transformation = {euler(pi/2,pi/3,pi/6)}
            ,fill options = {
                preaction = {fill = white, fill opacity = 1}
                ,postaction = {
                    draw = black
                    ,ultra thin
                    ,line join = round
                }
            }
        ]
        \fi
        \global\let\ustart\uend
    }
    }
\end{luatikztdtoolspicture}
\end{document}

output

6
  • Dear Jasper, that’s already amazing, thanks a lot. If you could draw a single cone that is symmetric with respect to the plane on which the current one "sits on", it would be perfect. I’m not sure if I explained that properly. Commented 10 hours ago
  • 1
    @Fradns It was an interesting diagram. If you want it to approach closer, just increase N. Commented 10 hours ago
  • Dear Jasper, thanks a lot, and thanks for your help. I'd have one last request: could you please make the two accumulation sides coincide (now they are on opposite sides) and delete the horizontal line in the interior of the cone? Commented 10 hours ago
  • @Fradns Sure! Let me just change a few parameters. Commented 10 hours ago
  • 1
    Thank you very much Jasper! Commented 9 hours ago

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.