2

I'm trying to get 3/4 of a cone by cutting it with two planes with pst solides3d, and having a lot of trouble... I've tried 4 methods, the results vary a lot.

These methods fail miserably, I can't figure out why :

  1. Cut a whole cone based on a function in half and then cut one half in a quarter. I always get an error that way, tried numerous variations, I can't get it to work.

  2. Fuse two halves of a predefined conecreux, or cut them twice like in attempt #4. Same thing.

Oh and, just in case I updated my MiKTeX install, synchronized and refreshed every package, it should be up to date. (Using XeLaTeX, by the way)

Here are my half successful attempts :

  1. Fuse two halves of a whole cone based on a function. It works reasonably well, but doesn't look too great, there's a face I can't get rid of on the lower half (why only on the lower half ? I don't have a clue), and even the superposition isn't great.

    Nearly there, but not quite

  2. Use the predefined cone solid, cut it in half, then cut a quarter and draw one half and one quarter only. Horrible solution since it has to be done for each upper and lower part of the cone, and even with rm=0 and hollow options there's always a face left (after all, it's based off of a solid cone...)

    Sigh... How can we remove those faces ?

MWE for #3 and #4 :

\documentclass{article}
\usepackage{textcomp}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\usepackage{pst-solides3d}
\begin{document}
\psset{viewpoint=50 30 20,Decran=40}
\psset{lightsrc=viewpoint}
\begin{pspicture}(-4,-4)(4,4) 
\psset{solidmemory}
\defFunction[algebraic]{G}(t)
{3*cos(t)}
{3*sin(t)}
{-3}
\psSolid[object=cone,name=entier,function=G,range=-3.46 3,ngrid=10 40, origine=0 0 0,plansepare={[1 0 0 0]},action=none]
\psSolid[object=load,load=entier1,rm=0,hollow,action=none]
\psSolid[object=cone,name=second,function=G,range=-3.46 3,ngrid=10 40, origine=0 0 0,plansepare={[0 1 0 0]},action=none]
\psSolid[object=load,load=second1,rm=0,hollow,action=none]
\psSolid[object=fusion, base=entier1 second1,linewidth=0.01,action=draw**]
\composeSolid
\end{pspicture}

\begin{pspicture}(-4,-4)(4,4) 
\psset{solidmemory}
\psSolid[object=cone,name=A,ngrid=10 40,h=4,r=3,RotY=-180,origine=0 0 0,plansepare={[0 1 0 0]},action=none]
\psSolid[object=load,load=A1,linewidth=0.01,rm=0,hollow,action=draw**]
\psSolid[object=load,load=A0,name=B,plansepare={[1 0 0 0]},action=none]
\psSolid[object=load,load=B1,linewidth=0.01,rm=0,hollow,action=draw**]
\psSolid[object=cone,name=C,ngrid=10 40,h=4,r=3,origine=0 0 0,plansepare={[0 1 0 0]},action=none]
\psSolid[object=load,load=C1,rm=0,hollow,linewidth=0.01,action=draw**](0,0,-8)
\psSolid[object=load,load=C0,name=D,plansepare={[1 0 0 0]},action=none]
\psSolid[object=load,load=D1,rm=0,hollow,linewidth=0.01,action=draw**](0,0,-8)
\end{pspicture}
\end{document}
Werner
  • 603,163
Johann
  • 165

1 Answers1

1
\documentclass{article}
\usepackage{pst-solides3d,pst-math}
\begin{document}
\psset{viewpoint=50 0 10 rtp2xyz,Decran=40,lightsrc=viewpoint,
        fillcolor=red!30,incolor=green!30,action=draw**}
\begin{pspicture}(-4,-4)(4,4) 
\defFunction{cone}(u,v){u v Cos mul}{u v Sin mul}{u}
\psSolid[object=surfaceparametree,function=cone,
    base=-3 0.1 0 1.5 pi mul,ngrid=9 30,RotZ=180]%% 0.1 -> rounding errors
\psSolid[object=surfaceparametree,function=cone,
    base=0.01 3 0 1.5 pi mul,ngrid=9 20]%% 0.001 r. e.
\end{pspicture}
\end{document}

enter image description here

  • Wow, you make it look easy ! ^^ Thanks a lot, that'll help.

    Just to educate myself, do you know what I did wrong with my plansepare ?

    – Johann Dec 07 '15 at 13:20
  • The reason I ask is because I also need to cut other surfaces, like this paraboloid :
    \psSurface[ngrid=.3 .3,algebraic](-4,-4)(4,4){-1-sqrt(y^2+x^2+1)}
    
    

    And If possible I'd like to not use a revolution paraboloid... Thanks again !

    – Johann Dec 07 '15 at 15:41