5

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 yesterday
  • The best approximation I have is here (picture on page 78): math.ens.psl.eu/~debarre/M2.pdf Commented yesterday
  • So you want a more lightly tessellated cone, so that you can see the polygonal shape? Commented yesterday
  • What do you mean by "more lightly tessellated"? Sorry, I don't think I've got it... Commented yesterday
  • 1
    Ahh, you want a sampling which is not an arithmetic sequence. Commented yesterday

3 Answers 3

3

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 yesterday
  • 1
    @Fradns It was an interesting diagram. If you want it to approach closer, just increase N. Commented yesterday
  • 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 yesterday
  • 1
    Thank you very much Jasper! Commented yesterday
  • 1
    @Fradns A word of caution: This package is Experimental, so it's syntax will change in the future. Commented 23 hours ago
4

We can construct a pyramid whose base is a polygon with an accumulation point; here is an example using luaDraw.

\documentclass[border=5pt]{standalone}% compile with lualatex only
\usepackage[svgnames]{xcolor}
\usepackage[3d]{luadraw}%https://github.com/pfradin/luadraw
\usepackage{fourier-otf}
%https://tex.stackexchange.com/questions/755843/how-to-draw-cone-with-infinitely-many-extremal-rays
\begin{document}
\begin{luadraw}{name=quasi-cone}
local pi = math.pi
local g = graph3d:new{adjust2d=true, bbox=false, bg="lightgray"}
local S, A = -4*vecJ, M(-4,5,-1) -- apex of the pyramid and a point on the base
local nbdot, base = 25, {A}
local angle, ratio, theta = 180, 1/3, 0
for k = 1, nbdot do
    theta = theta + ratio*angle
    table.insert(base, rotate3d(A,theta,{Origin,-vecJ}) )
    table.insert(base,1, rotate3d(A,theta,{Origin,vecJ}) )
    angle = (1-ratio)*angle
end
local P = pyramid(base,S,true)
table.remove(P.facets) -- remove the last facet
g:Dpoly(P, {color="Crimson", opacity=0.7,edgecolor="Gold",edgewidth=6})
g:Show()
\end{luadraw}
\end{document}

enter image description here

3

I tried with luadraw

\documentclass[12pt]{standalone}
\usepackage[svgnames]{xcolor}
\usepackage[3d]{luadraw}
\begin{document}
%https://tex.stackexchange.com/questions/755843/how-to-draw-cone-with-infinitely-many-extremal-rays
\begin{luadraw}{name=regular_pyramid_07_12_2025}
local g = graph3d:new{window={-10,10,-5,11},viewdir={30,70},size={12,12}}
g:Linejoin("round"); g:Linewidth(6); Hiddenlines = true; Hiddenlinestyle = "dashed"
local a, n, h = 3, 20, 10
local O = Origin
local P = regular_pyramid(n,a,h,O)
g:Dpoly(regular_pyramid(n,a,h,O), {mode=4,color="Crimson"})
g:Show()
\end{luadraw}
\end{document}

enter image description here

you can use the function cvx_hull3d(L) to make a section.

\documentclass[12pt]{standalone}
\usepackage[svgnames]{xcolor}
\usepackage[3d]{luadraw}
\begin{document}
\begin{luadraw}{name=section_cone}
local g = graph3d:new{window={-10,10,-5,21},viewdir={50,70},size={12,12}}
 Hiddenlines = true; Hiddenlinestyle = "dashed"
local a, n, h = 5, 10, 18
local O = Origin
local P = regular_pyramid(n,a,h,O)
local A,B,C,D,E,F,G,H,K,L,S = table.unpack(P.vertices)
local L = {A,B,C,D,E,F,G,H,S}
g:Dscene3d(
g:addFacet(cvx_hull3d(L), {color="Orange",edge=true})
)
g:Show()
\end{luadraw}
\end{document}

enter image description here

2
  • Thank you for your contribution! I think the author specifically wanted a quasi-"cone", in which the triangular faces are not evenly sized. In particular, they should decrease in size sequentially, approaching some finite limit. Commented 14 hours ago
  • Thank you very much. Commented 14 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.