3

My aim is to draw a circumscribed circle on the polygon constructed as "cone base" using pst-solides3d. By circumscription, I mean that the corners of the polygon touch the circle from within.

I try to coerce a radius measure on the cone, with r=2 option, but this does not align with the two half-axis vectors (0,1,0)(1,0,0) in the specification of \pstThreeDCircle.

Vertical cone with circle surrounding base

How do I specify measurements in \pstThreeDCircle and \psSolid[object=cone]` using aligning measurements of the two packages?

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{pst-solides3d}
\usepackage{pst-3dplot}
\begin{frame}{Keglens overflade}
    % Voss: "PSTricks  - Grafik mit PostScript für Tex und LaTeX", p. 421
    \psset{lightsrc=10 5 20,viewpoint=50 20 30 rtp2xyz,Decran=20}
    \begin{pspicture}(-2,-2)(2,3)
        \pstThreeDCircle[linecolor=red](0,0,0)(0,1,0)(1,0,0)
        \psSolid[object=cone,h=5,r=2](0,0,0)
    \end{pspicture}
\end{frame}
\end{document}

Note: I added ,h=5,r=2 to cone options for height and radius of the cone, in accordance with the pst-solides3d doc.

I tried to swap the loading sequence of PSTrick packages as suggested here with no effect.

I tried to substitute viewpoint with Aplhaand Beta as suggested here only to get the cone blown up covering the (tilted) circle.

3
  • it makes no sense to mix macros from pst-solides3d (central projection) and pst-3dplot (parallel view).
    – user187802
    Commented Aug 29, 2021 at 13:58
  • I ask because I take it my students need to focus on the circumference of the cone's circular base, when having to calculate the lateral area of the cone. I have no preferences t combine these packages, Alternative suggestions, @user187802 ? Commented Aug 30, 2021 at 3:58
  • @user187802: As to parallel view in pst-3dplot, isn't it the viewpoint you adjust with Alpha and Beta? Commented Aug 30, 2021 at 4:01

2 Answers 2

2

Run with lualatex:

\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-solides3d}
\begin{document}
    
\begin{pspicture}(-3,-2)(3,7.5)
    \psset{viewpoint=50 20 20 rtp2xyz,Decran=50, lightsrc=viewpoint} 
    \psSolid[object=cone,
    ngrid=20 24,
    r=2, h=6,
    fillcolor=yellow!25,
    intersectiontype=0,
    intersectionplan={
        [0 0 1 0]
        [0 0 1 -1]
        [0 0 1 -2]
        [0 0 1 -3]},
    intersectioncolor=(bleu) (rouge) (vert) (rose),
    intersectionlinewidth=2 2.5 2.8 3.2,
    linewidth=0.1pt,
    linecolor=black!20,
    action=draw**]
    \axesIIID(2,2,6)(3,3,7)
\end{pspicture}
    
\end{document}

enter image description here

2

I can get around the inconsequence pointed out in comment by drawing a cylinder with h=0 to impost a 3d circle:

\documentclass{beamer}
\usepackage{pstricks}
\usepackage{pst-solides3d}
\begin{document}
\begin{frame}{Keglens overflade}
  \begin{pspicture}(-2,-1)(2,3)
    \psSolid[object=cone,h=5,r=2](0,0,0)
    \psSolid[object=cylindre,linecolor=red,linewidth=2pt,mode=5,h=0,r=2](0,0,-0.5)
  \end{pspicture}
\end{frame}
\end{document}

Result: Cone with circle of base drawn as cylinder

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .