How can I make a cone from a cube and view the cube with different angles? The 2019 Stack Overflow Developer Survey Results Are InDifferent sibling angles at the same level when using mindmapLabeling the lengths and angles in a diagram with measurementshow to achieve and draw the final rotation of a frame with Euler angles.how I can select view in 3d tikz? and how I can change view?How can I make a 3D representation of a potential wellHow Can I draw a cube of cubes efficiently?How can I draw this cone exactly?How to make a 2D sphere with decreasing radial gradientCone in Latex with right angles and LabelHow can I draw this cylinder with 3D?

What does "fetching by region is not available for SAM files" means?

How to notate time signature switching consistently every measure

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?

How can I autofill dates in Excel excluding Sunday?

How to manage monthly salary

What does ひと匙 mean in this manga and has it been used colloquially?

Aging parents with no investments

Falsification in Math vs Science

Can you compress metal and what would be the consequences?

Worn-tile Scrabble

Can someone be penalized for an "unlawful" act if no penalty is specified?

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?

Is a "Democratic" Oligarchy-Style System Possible?

Loose spokes after only a few rides

Is flight data recorder erased after every flight?

How technical should a Scrum Master be to effectively remove impediments?

Why do UK politicians seemingly ignore opinion polls on Brexit?

Protecting Dualbooting Windows from dangerous code (like rm -rf)

What is the meaning of Triage in Cybersec world?

Geography at the pixel level

Write faster on AT24C32

Did 3000BC Egyptians use meteoric iron weapons?

What is the closest word meaning "respect for time / mindful"

Does a dangling wire really electrocute me if I'm standing in water?



How can I make a cone from a cube and view the cube with different angles?



The 2019 Stack Overflow Developer Survey Results Are InDifferent sibling angles at the same level when using mindmapLabeling the lengths and angles in a diagram with measurementshow to achieve and draw the final rotation of a frame with Euler angles.how I can select view in 3d tikz? and how I can change view?How can I make a 3D representation of a potential wellHow Can I draw a cube of cubes efficiently?How can I draw this cone exactly?How to make a 2D sphere with decreasing radial gradientCone in Latex with right angles and LabelHow can I draw this cylinder with 3D?










7















I am trying to draw a cone with vertex C and base is circle BDG and want to view the cube with different angles like some following pictures.
enter image description here



I tried



documentclass[border=2mm,12pt,tikz]standalone 
usepackagetikz,tikz-3dplot
usepackagefouriernc
usepackagetkz-euclide
usetkzobjall
makeatletter
newcountersmuggle
DeclareRobustCommandsmuggleone[1]%
stepcountersmuggle%
expandafterglobalexpandafterletcsname smuggle@arabicsmuggleendcsname#1%
aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabicsmuggleendcsname

DeclareRobustCommandsmuggle[2][1]%
smuggleone#2%
ifnum#1>1
aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
fi

makeatother
% based on tex.stackexchange.com/a/12033/…
tikzsetreverseclip/.style=insert path=(current bounding box.south west)rectangle
(current bounding box.north east)

defparsecoord(#1,#2,#3)>(#4,#5,#6)%
def#4#1%
def#5#2%
def#6#3%
smuggle#4%
smuggle#5%
smuggle#6%

defSPTD(#1,#2,#3).(#4,#5,#6)((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))
defVPTD(#1,#2,#3)x(#4,#5,#6)((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))
defVecMinus(#1,#2,#3)-(#4,#5,#6)(#1-1*(#4),#2-1*(#5),#3-1*(#6))
defVecAdd(#1,#2,#3)+(#4,#5,#6)(#1+1*(#4),#2+1*(#5),#3+1*(#6))
newcommandRotationAnglesForPlaneWithNormal[5]%typeoutN=(#1,#2,#3)
foreach XS in 1,-1
foreach YS in 1,-1
pgfmathsetmacromybetaXS*acos(#3)
pgfmathsetmacromyalphaYS*acos(#1/sin(mybeta))
pgfmathsetmacrontestabs(cos(myalpha)*sin(mybeta)-#1)%
+abs(sin(myalpha)*sin(mybeta)-#2)+abs(cos(mybeta)-#3)
ifdimntest pt<0.1pt
xdef#4myalpha
xdef#5mybeta
fi


tikzsetcircle in plane with normal/.style args=#1 with radius #2 around #3
/utils/exec=edeftempnoexpandparsecoord#1>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
temp
pgfmathsetmacromyNxmyNx
pgfmathsetmacromyNymyNy
pgfmathsetmacromyNzmyNz
pgfmathsetmacromyNormalizationsqrt(pow(myNx,2)+pow(myNy,2)+pow(myNz,2))
pgfmathsetmacromyNxmyNx/myNormalization
pgfmathsetmacromyNymyNy/myNormalization
pgfmathsetmacromyNzmyNz/myNormalization
% compute the rotation angles that transform us in the corresponding plabe
RotationAnglesForPlaneWithNormalmyNxmyNymyNztmpalphatmpbeta
%typeoutN=(myNx,myNy,myNz),alpha=tmpalpha,beta=tmpbeta,r=#2,#3
tdplotsetrotatedcoordstmpalphatmpbeta0,
insert path=[tdplot_rotated_coords,canvas is xy plane at z=0,transform shape]
#3 circle[radius=#2]



begindocument
tdplotsetmaincoords70195
begintikzpicture[tdplot_main_coords,scale=1,line join = round, line cap = round]

pgfmathsetmacroa3
pgfmathsetmacror2/3*sqrt(6)*a
path
coordinate (A) at (a,-a,-a)
coordinate (B) at (a,a,-a)
coordinate (C) at (-a,a,-a)
coordinate (D) at (-a,-a,-a)
coordinate (E) at ($(A)+ (0,0,2*a)$)
coordinate (F) at ($(B)+ (0,0,2*a)$)
coordinate (G) at ($(C)+ (0,0,2*a)$)
coordinate (H) at ($(D)+ (0,0,2*a)$)
coordinate (O) at (0,0,0)
coordinate (I) at (-1/3*a, 1/3*a, -1/3*a)
;
parsecoord(a,a,-a)>(myBx,myBy,myBz)
parsecoord(-a,a,a)>(myGx,myGy,myGz)
parsecoord(-a,-a,-a)>(myDx,myDy,myDz)
defmynormalVPTD(myDx-myBx,myDy-myBy,myDz-myBz)x(myDx-myGx,myDy-myGy,myDz-myGz)
edeftempnoexpandparsecoordmynormal>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
beginscope
draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
clip (B) -- (C) -- (D) -- (G) -- cycle [reverseclip];
draw[red,ultra thick,circle in plane with normal=mynormal with radius r around (I)];
endscope
foreach point/position in A/below,B/below,C/below,D/right,E/above,F/left,G/above,H/above,O/above,I/below
fill (point) circle (2.0pt);
node[position=2pt] at (point) $point$;


beginscope[tdplot_screen_coords]
fill[ball color=gray, opacity=0.1] (I) circle (r); % 3D lighting effect
endscope

draw[very thick] (E) -- (F) -- (B)
(B) --(C)--(G)--(F)
(E) --(F) --(G)-- (H) --cycle
(C)--(D) --(H)--(G)--cycle
;

draw[very thick, blue] (G) -- (D) (G) -- (B);
draw[dashed, thick]
(B) -- (A) -- (E) (D) --(A) (D) --(C) (D) --(H) (E) --(C) (I) -- (B) (I) -- (G) (I) --(D)
;
draw[dashed, blue] (B) -- (D);
endtikzpicture
enddocument


I got



enter image description here



My questions are:



  1. How can I draw some generators (not CB, CG, CD) of the cone?

  2. How can I view the cube with different angles?

enter image description here



enter image description here










share|improve this question




























    7















    I am trying to draw a cone with vertex C and base is circle BDG and want to view the cube with different angles like some following pictures.
    enter image description here



    I tried



    documentclass[border=2mm,12pt,tikz]standalone 
    usepackagetikz,tikz-3dplot
    usepackagefouriernc
    usepackagetkz-euclide
    usetkzobjall
    makeatletter
    newcountersmuggle
    DeclareRobustCommandsmuggleone[1]%
    stepcountersmuggle%
    expandafterglobalexpandafterletcsname smuggle@arabicsmuggleendcsname#1%
    aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabicsmuggleendcsname

    DeclareRobustCommandsmuggle[2][1]%
    smuggleone#2%
    ifnum#1>1
    aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
    fi

    makeatother
    % based on tex.stackexchange.com/a/12033/…
    tikzsetreverseclip/.style=insert path=(current bounding box.south west)rectangle
    (current bounding box.north east)

    defparsecoord(#1,#2,#3)>(#4,#5,#6)%
    def#4#1%
    def#5#2%
    def#6#3%
    smuggle#4%
    smuggle#5%
    smuggle#6%

    defSPTD(#1,#2,#3).(#4,#5,#6)((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))
    defVPTD(#1,#2,#3)x(#4,#5,#6)((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))
    defVecMinus(#1,#2,#3)-(#4,#5,#6)(#1-1*(#4),#2-1*(#5),#3-1*(#6))
    defVecAdd(#1,#2,#3)+(#4,#5,#6)(#1+1*(#4),#2+1*(#5),#3+1*(#6))
    newcommandRotationAnglesForPlaneWithNormal[5]%typeoutN=(#1,#2,#3)
    foreach XS in 1,-1
    foreach YS in 1,-1
    pgfmathsetmacromybetaXS*acos(#3)
    pgfmathsetmacromyalphaYS*acos(#1/sin(mybeta))
    pgfmathsetmacrontestabs(cos(myalpha)*sin(mybeta)-#1)%
    +abs(sin(myalpha)*sin(mybeta)-#2)+abs(cos(mybeta)-#3)
    ifdimntest pt<0.1pt
    xdef#4myalpha
    xdef#5mybeta
    fi


    tikzsetcircle in plane with normal/.style args=#1 with radius #2 around #3
    /utils/exec=edeftempnoexpandparsecoord#1>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
    temp
    pgfmathsetmacromyNxmyNx
    pgfmathsetmacromyNymyNy
    pgfmathsetmacromyNzmyNz
    pgfmathsetmacromyNormalizationsqrt(pow(myNx,2)+pow(myNy,2)+pow(myNz,2))
    pgfmathsetmacromyNxmyNx/myNormalization
    pgfmathsetmacromyNymyNy/myNormalization
    pgfmathsetmacromyNzmyNz/myNormalization
    % compute the rotation angles that transform us in the corresponding plabe
    RotationAnglesForPlaneWithNormalmyNxmyNymyNztmpalphatmpbeta
    %typeoutN=(myNx,myNy,myNz),alpha=tmpalpha,beta=tmpbeta,r=#2,#3
    tdplotsetrotatedcoordstmpalphatmpbeta0,
    insert path=[tdplot_rotated_coords,canvas is xy plane at z=0,transform shape]
    #3 circle[radius=#2]



    begindocument
    tdplotsetmaincoords70195
    begintikzpicture[tdplot_main_coords,scale=1,line join = round, line cap = round]

    pgfmathsetmacroa3
    pgfmathsetmacror2/3*sqrt(6)*a
    path
    coordinate (A) at (a,-a,-a)
    coordinate (B) at (a,a,-a)
    coordinate (C) at (-a,a,-a)
    coordinate (D) at (-a,-a,-a)
    coordinate (E) at ($(A)+ (0,0,2*a)$)
    coordinate (F) at ($(B)+ (0,0,2*a)$)
    coordinate (G) at ($(C)+ (0,0,2*a)$)
    coordinate (H) at ($(D)+ (0,0,2*a)$)
    coordinate (O) at (0,0,0)
    coordinate (I) at (-1/3*a, 1/3*a, -1/3*a)
    ;
    parsecoord(a,a,-a)>(myBx,myBy,myBz)
    parsecoord(-a,a,a)>(myGx,myGy,myGz)
    parsecoord(-a,-a,-a)>(myDx,myDy,myDz)
    defmynormalVPTD(myDx-myBx,myDy-myBy,myDz-myBz)x(myDx-myGx,myDy-myGy,myDz-myGz)
    edeftempnoexpandparsecoordmynormal>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
    beginscope
    draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
    clip (B) -- (C) -- (D) -- (G) -- cycle [reverseclip];
    draw[red,ultra thick,circle in plane with normal=mynormal with radius r around (I)];
    endscope
    foreach point/position in A/below,B/below,C/below,D/right,E/above,F/left,G/above,H/above,O/above,I/below
    fill (point) circle (2.0pt);
    node[position=2pt] at (point) $point$;


    beginscope[tdplot_screen_coords]
    fill[ball color=gray, opacity=0.1] (I) circle (r); % 3D lighting effect
    endscope

    draw[very thick] (E) -- (F) -- (B)
    (B) --(C)--(G)--(F)
    (E) --(F) --(G)-- (H) --cycle
    (C)--(D) --(H)--(G)--cycle
    ;

    draw[very thick, blue] (G) -- (D) (G) -- (B);
    draw[dashed, thick]
    (B) -- (A) -- (E) (D) --(A) (D) --(C) (D) --(H) (E) --(C) (I) -- (B) (I) -- (G) (I) --(D)
    ;
    draw[dashed, blue] (B) -- (D);
    endtikzpicture
    enddocument


    I got



    enter image description here



    My questions are:



    1. How can I draw some generators (not CB, CG, CD) of the cone?

    2. How can I view the cube with different angles?

    enter image description here



    enter image description here










    share|improve this question


























      7












      7








      7








      I am trying to draw a cone with vertex C and base is circle BDG and want to view the cube with different angles like some following pictures.
      enter image description here



      I tried



      documentclass[border=2mm,12pt,tikz]standalone 
      usepackagetikz,tikz-3dplot
      usepackagefouriernc
      usepackagetkz-euclide
      usetkzobjall
      makeatletter
      newcountersmuggle
      DeclareRobustCommandsmuggleone[1]%
      stepcountersmuggle%
      expandafterglobalexpandafterletcsname smuggle@arabicsmuggleendcsname#1%
      aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabicsmuggleendcsname

      DeclareRobustCommandsmuggle[2][1]%
      smuggleone#2%
      ifnum#1>1
      aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
      fi

      makeatother
      % based on tex.stackexchange.com/a/12033/…
      tikzsetreverseclip/.style=insert path=(current bounding box.south west)rectangle
      (current bounding box.north east)

      defparsecoord(#1,#2,#3)>(#4,#5,#6)%
      def#4#1%
      def#5#2%
      def#6#3%
      smuggle#4%
      smuggle#5%
      smuggle#6%

      defSPTD(#1,#2,#3).(#4,#5,#6)((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))
      defVPTD(#1,#2,#3)x(#4,#5,#6)((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))
      defVecMinus(#1,#2,#3)-(#4,#5,#6)(#1-1*(#4),#2-1*(#5),#3-1*(#6))
      defVecAdd(#1,#2,#3)+(#4,#5,#6)(#1+1*(#4),#2+1*(#5),#3+1*(#6))
      newcommandRotationAnglesForPlaneWithNormal[5]%typeoutN=(#1,#2,#3)
      foreach XS in 1,-1
      foreach YS in 1,-1
      pgfmathsetmacromybetaXS*acos(#3)
      pgfmathsetmacromyalphaYS*acos(#1/sin(mybeta))
      pgfmathsetmacrontestabs(cos(myalpha)*sin(mybeta)-#1)%
      +abs(sin(myalpha)*sin(mybeta)-#2)+abs(cos(mybeta)-#3)
      ifdimntest pt<0.1pt
      xdef#4myalpha
      xdef#5mybeta
      fi


      tikzsetcircle in plane with normal/.style args=#1 with radius #2 around #3
      /utils/exec=edeftempnoexpandparsecoord#1>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
      temp
      pgfmathsetmacromyNxmyNx
      pgfmathsetmacromyNymyNy
      pgfmathsetmacromyNzmyNz
      pgfmathsetmacromyNormalizationsqrt(pow(myNx,2)+pow(myNy,2)+pow(myNz,2))
      pgfmathsetmacromyNxmyNx/myNormalization
      pgfmathsetmacromyNymyNy/myNormalization
      pgfmathsetmacromyNzmyNz/myNormalization
      % compute the rotation angles that transform us in the corresponding plabe
      RotationAnglesForPlaneWithNormalmyNxmyNymyNztmpalphatmpbeta
      %typeoutN=(myNx,myNy,myNz),alpha=tmpalpha,beta=tmpbeta,r=#2,#3
      tdplotsetrotatedcoordstmpalphatmpbeta0,
      insert path=[tdplot_rotated_coords,canvas is xy plane at z=0,transform shape]
      #3 circle[radius=#2]



      begindocument
      tdplotsetmaincoords70195
      begintikzpicture[tdplot_main_coords,scale=1,line join = round, line cap = round]

      pgfmathsetmacroa3
      pgfmathsetmacror2/3*sqrt(6)*a
      path
      coordinate (A) at (a,-a,-a)
      coordinate (B) at (a,a,-a)
      coordinate (C) at (-a,a,-a)
      coordinate (D) at (-a,-a,-a)
      coordinate (E) at ($(A)+ (0,0,2*a)$)
      coordinate (F) at ($(B)+ (0,0,2*a)$)
      coordinate (G) at ($(C)+ (0,0,2*a)$)
      coordinate (H) at ($(D)+ (0,0,2*a)$)
      coordinate (O) at (0,0,0)
      coordinate (I) at (-1/3*a, 1/3*a, -1/3*a)
      ;
      parsecoord(a,a,-a)>(myBx,myBy,myBz)
      parsecoord(-a,a,a)>(myGx,myGy,myGz)
      parsecoord(-a,-a,-a)>(myDx,myDy,myDz)
      defmynormalVPTD(myDx-myBx,myDy-myBy,myDz-myBz)x(myDx-myGx,myDy-myGy,myDz-myGz)
      edeftempnoexpandparsecoordmynormal>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
      beginscope
      draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
      clip (B) -- (C) -- (D) -- (G) -- cycle [reverseclip];
      draw[red,ultra thick,circle in plane with normal=mynormal with radius r around (I)];
      endscope
      foreach point/position in A/below,B/below,C/below,D/right,E/above,F/left,G/above,H/above,O/above,I/below
      fill (point) circle (2.0pt);
      node[position=2pt] at (point) $point$;


      beginscope[tdplot_screen_coords]
      fill[ball color=gray, opacity=0.1] (I) circle (r); % 3D lighting effect
      endscope

      draw[very thick] (E) -- (F) -- (B)
      (B) --(C)--(G)--(F)
      (E) --(F) --(G)-- (H) --cycle
      (C)--(D) --(H)--(G)--cycle
      ;

      draw[very thick, blue] (G) -- (D) (G) -- (B);
      draw[dashed, thick]
      (B) -- (A) -- (E) (D) --(A) (D) --(C) (D) --(H) (E) --(C) (I) -- (B) (I) -- (G) (I) --(D)
      ;
      draw[dashed, blue] (B) -- (D);
      endtikzpicture
      enddocument


      I got



      enter image description here



      My questions are:



      1. How can I draw some generators (not CB, CG, CD) of the cone?

      2. How can I view the cube with different angles?

      enter image description here



      enter image description here










      share|improve this question
















      I am trying to draw a cone with vertex C and base is circle BDG and want to view the cube with different angles like some following pictures.
      enter image description here



      I tried



      documentclass[border=2mm,12pt,tikz]standalone 
      usepackagetikz,tikz-3dplot
      usepackagefouriernc
      usepackagetkz-euclide
      usetkzobjall
      makeatletter
      newcountersmuggle
      DeclareRobustCommandsmuggleone[1]%
      stepcountersmuggle%
      expandafterglobalexpandafterletcsname smuggle@arabicsmuggleendcsname#1%
      aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabicsmuggleendcsname

      DeclareRobustCommandsmuggle[2][1]%
      smuggleone#2%
      ifnum#1>1
      aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
      fi

      makeatother
      % based on tex.stackexchange.com/a/12033/…
      tikzsetreverseclip/.style=insert path=(current bounding box.south west)rectangle
      (current bounding box.north east)

      defparsecoord(#1,#2,#3)>(#4,#5,#6)%
      def#4#1%
      def#5#2%
      def#6#3%
      smuggle#4%
      smuggle#5%
      smuggle#6%

      defSPTD(#1,#2,#3).(#4,#5,#6)((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))
      defVPTD(#1,#2,#3)x(#4,#5,#6)((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))
      defVecMinus(#1,#2,#3)-(#4,#5,#6)(#1-1*(#4),#2-1*(#5),#3-1*(#6))
      defVecAdd(#1,#2,#3)+(#4,#5,#6)(#1+1*(#4),#2+1*(#5),#3+1*(#6))
      newcommandRotationAnglesForPlaneWithNormal[5]%typeoutN=(#1,#2,#3)
      foreach XS in 1,-1
      foreach YS in 1,-1
      pgfmathsetmacromybetaXS*acos(#3)
      pgfmathsetmacromyalphaYS*acos(#1/sin(mybeta))
      pgfmathsetmacrontestabs(cos(myalpha)*sin(mybeta)-#1)%
      +abs(sin(myalpha)*sin(mybeta)-#2)+abs(cos(mybeta)-#3)
      ifdimntest pt<0.1pt
      xdef#4myalpha
      xdef#5mybeta
      fi


      tikzsetcircle in plane with normal/.style args=#1 with radius #2 around #3
      /utils/exec=edeftempnoexpandparsecoord#1>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
      temp
      pgfmathsetmacromyNxmyNx
      pgfmathsetmacromyNymyNy
      pgfmathsetmacromyNzmyNz
      pgfmathsetmacromyNormalizationsqrt(pow(myNx,2)+pow(myNy,2)+pow(myNz,2))
      pgfmathsetmacromyNxmyNx/myNormalization
      pgfmathsetmacromyNymyNy/myNormalization
      pgfmathsetmacromyNzmyNz/myNormalization
      % compute the rotation angles that transform us in the corresponding plabe
      RotationAnglesForPlaneWithNormalmyNxmyNymyNztmpalphatmpbeta
      %typeoutN=(myNx,myNy,myNz),alpha=tmpalpha,beta=tmpbeta,r=#2,#3
      tdplotsetrotatedcoordstmpalphatmpbeta0,
      insert path=[tdplot_rotated_coords,canvas is xy plane at z=0,transform shape]
      #3 circle[radius=#2]



      begindocument
      tdplotsetmaincoords70195
      begintikzpicture[tdplot_main_coords,scale=1,line join = round, line cap = round]

      pgfmathsetmacroa3
      pgfmathsetmacror2/3*sqrt(6)*a
      path
      coordinate (A) at (a,-a,-a)
      coordinate (B) at (a,a,-a)
      coordinate (C) at (-a,a,-a)
      coordinate (D) at (-a,-a,-a)
      coordinate (E) at ($(A)+ (0,0,2*a)$)
      coordinate (F) at ($(B)+ (0,0,2*a)$)
      coordinate (G) at ($(C)+ (0,0,2*a)$)
      coordinate (H) at ($(D)+ (0,0,2*a)$)
      coordinate (O) at (0,0,0)
      coordinate (I) at (-1/3*a, 1/3*a, -1/3*a)
      ;
      parsecoord(a,a,-a)>(myBx,myBy,myBz)
      parsecoord(-a,a,a)>(myGx,myGy,myGz)
      parsecoord(-a,-a,-a)>(myDx,myDy,myDz)
      defmynormalVPTD(myDx-myBx,myDy-myBy,myDz-myBz)x(myDx-myGx,myDy-myGy,myDz-myGz)
      edeftempnoexpandparsecoordmynormal>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
      beginscope
      draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
      clip (B) -- (C) -- (D) -- (G) -- cycle [reverseclip];
      draw[red,ultra thick,circle in plane with normal=mynormal with radius r around (I)];
      endscope
      foreach point/position in A/below,B/below,C/below,D/right,E/above,F/left,G/above,H/above,O/above,I/below
      fill (point) circle (2.0pt);
      node[position=2pt] at (point) $point$;


      beginscope[tdplot_screen_coords]
      fill[ball color=gray, opacity=0.1] (I) circle (r); % 3D lighting effect
      endscope

      draw[very thick] (E) -- (F) -- (B)
      (B) --(C)--(G)--(F)
      (E) --(F) --(G)-- (H) --cycle
      (C)--(D) --(H)--(G)--cycle
      ;

      draw[very thick, blue] (G) -- (D) (G) -- (B);
      draw[dashed, thick]
      (B) -- (A) -- (E) (D) --(A) (D) --(C) (D) --(H) (E) --(C) (I) -- (B) (I) -- (G) (I) --(D)
      ;
      draw[dashed, blue] (B) -- (D);
      endtikzpicture
      enddocument


      I got



      enter image description here



      My questions are:



      1. How can I draw some generators (not CB, CG, CD) of the cone?

      2. How can I view the cube with different angles?

      enter image description here



      enter image description here







      tikz-pgf tikz-3dplot






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 6 at 12:39









      TeXnician

      25.9k63491




      25.9k63491










      asked Apr 6 at 11:47









      minhthien_2016minhthien_2016

      1,4741917




      1,4741917




















          1 Answer
          1






          active

          oldest

          votes


















          5














          TikZ does not have a 3d engine, so one has to distinguish many cases. I hope this does not contain too many bugs. (There is also something that keeps track of the bounding boxes, meaning you have to compile the file twice.)



          documentclass[border=2mm,12pt,tikz]standalone 
          usepackagetikz-3dplot
          makeatletter
          newcountersmuggle
          DeclareRobustCommandsmuggleone[1]%
          stepcountersmuggle%
          expandafterglobalexpandafterletcsname smuggle@arabicsmuggleendcsname#1%
          aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabicsmuggleendcsname

          DeclareRobustCommandsmuggle[2][1]%
          smuggleone#2%
          ifnum#1>1
          aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
          fi

          defSaveBBox%
          immediatewrite@mainauxxdefstringxminxminrelax
          immediatewrite@mainauxxdefstringxmaxxmaxrelax
          immediatewrite@mainauxxdefstringyminyminrelax
          immediatewrite@mainauxxdefstringymaxymaxrelax
          makeatother
          % based on tex.stackexchange.com/a/12033/AAA
          tikzsetreverseclip/.style=insert path=(current bounding box.south west)rectangle
          (current bounding box.north east)

          defparsecoord(#1,#2,#3)>(#4,#5,#6)%
          def#4#1%
          def#5#2%
          def#6#3%
          smuggle#4%
          smuggle#5%
          smuggle#6%

          defSPTD(#1,#2,#3).(#4,#5,#6)((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))
          defVPTD(#1,#2,#3)x(#4,#5,#6)((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))
          defVecMinus(#1,#2,#3)-(#4,#5,#6)(#1-1*(#4),#2-1*(#5),#3-1*(#6))
          defVecAdd(#1,#2,#3)+(#4,#5,#6)(#1+1*(#4),#2+1*(#5),#3+1*(#6))
          newcommandRotationAnglesForPlaneWithNormal[5]%typeoutN=(#1,#2,#3)
          foreach XS in 1,-1
          foreach YS in 1,-1
          pgfmathsetmacromybetaXS*acos(#3)
          pgfmathsetmacromyalphaYS*acos(#1/sin(mybeta))
          pgfmathsetmacrontestabs(cos(myalpha)*sin(mybeta)-#1)%
          +abs(sin(myalpha)*sin(mybeta)-#2)+abs(cos(mybeta)-#3)
          ifdimntest pt<0.1pt
          xdef#4myalpha
          xdef#5mybeta
          fi


          tikzsetcircle in plane with normal/.style args=#1 with radius #2 around #3
          /utils/exec=edeftempnoexpandparsecoord#1>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
          temp
          pgfmathsetmacromyNxmyNx
          pgfmathsetmacromyNymyNy
          pgfmathsetmacromyNzmyNz
          pgfmathsetmacromyNormalizationsqrt(pow(myNx,2)+pow(myNy,2)+pow(myNz,2))
          pgfmathsetmacromyNxmyNx/myNormalization
          pgfmathsetmacromyNymyNy/myNormalization
          pgfmathsetmacromyNzmyNz/myNormalization
          % compute the rotation angles that transform us in the corresponding plabe
          RotationAnglesForPlaneWithNormalmyNxmyNymyNztmpalphatmpbeta
          %typeoutN=(myNx,myNy,myNz),alpha=tmpalpha,beta=tmpbeta,r=#2,#3
          tdplotsetrotatedcoordstmpalphatmpbeta0,
          insert path=[tdplot_rotated_coords,canvas is xy plane at z=0,transform shape]
          #3 circle[radius=#2]



          begindocument
          tdplotsetmaincoords70195
          foreach Angle in 5,15,...,355 % 5

          tdplotsetmaincoords70Angle
          begintikzpicture[tdplot_main_coords,scale=1,line join = round, line cap = round]
          ifdefinedxmin
          else
          defxmin0
          fi
          ifdefinedxmax
          else
          defxmax0
          fi
          ifdefinedymin
          else
          defymin0
          fi
          ifdefinedymax
          else
          defymax0
          fi
          path[tdplot_screen_coords] (xmin pt,ymin pt) rectangle (xmax pt,ymax pt);
          pgfmathsetmacroa3
          pgfmathsetmacror2/3*sqrt(6)*a
          path
          coordinate (A) at (a,-a,-a)
          coordinate (B) at (a,a,-a)
          coordinate (C) at (-a,a,-a)
          coordinate (D) at (-a,-a,-a)
          coordinate (E) at ($(A)+ (0,0,2*a)$)
          coordinate (F) at ($(B)+ (0,0,2*a)$)
          coordinate (G) at ($(C)+ (0,0,2*a)$)
          coordinate (H) at ($(D)+ (0,0,2*a)$)
          coordinate (O) at (0,0,0)
          coordinate (I) at (-1/3*a, 1/3*a, -1/3*a)
          ;
          parsecoord(a,a,-a)>(myBx,myBy,myBz)
          parsecoord(-a,a,a)>(myGx,myGy,myGz)
          parsecoord(-a,-a,-a)>(myDx,myDy,myDz)
          defmynormalVPTD(myDx-myBx,myDy-myBy,myDz-myBz)x(myDx-myGx,myDy-myGy,myDz-myGz)
          edeftempnoexpandparsecoordmynormal>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
          draw[very thick, blue] (G) -- (D) (G) -- (B);
          draw[very thick] (E) --(F) --(G)-- (H) --cycle;
          ifnumAngle<90
          draw[very thick] (D) --(A) --(B) (D) -- (H) (A)--(E) (B) -- (F);
          draw[dashed, thick] (D) -- (C) -- (B) (C) -- (G);
          beginscope
          draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
          clip (F) -- (G) -- (H) -- (D) -- (A) -- (B) -- cycle [reverseclip];
          draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
          endscope
          else
          ifnumAngle<180
          draw[very thick] (E) --(A) --(B) -- (C) -- (G) (B) -- (F);
          draw[dashed, thick] (A) -- (D) -- (C) (D) -- (H);
          beginscope
          draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
          ifnumAngle<150
          clip (G) -- (H) -- (E) -- (A) -- (B) -- cycle [reverseclip];
          else
          clip (B) -- (C) -- (G) -- cycle [reverseclip];
          fi
          draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
          endscope
          else
          ifnumAngle<180
          draw[very thick] (E) -- (F) -- (B)
          (B) --(C)--(G)--(F)
          (C)--(D) --(H)--(G)--cycle ;
          draw[dashed, thick]
          (B) -- (A) -- (E) (D) --(A) (D) --(C) (D) --(H) (E) --(C) (I) -- (B) (I) -- (G) (I) --(D);
          beginscope
          draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
          clip (B) -- (C) -- (D) -- (G) -- cycle [reverseclip];
          draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
          endscope
          else
          ifnumAngle<270
          draw[very thick] (F) -- (B) -- (C) -- (D) -- (H) (C) -- (G);
          draw[dashed, thick] (B) -- (A) -- (D) (A) -- (E);
          beginscope
          draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
          ifnumAngle<230
          clip (G) -- (C) -- (D) -- cycle [reverseclip];
          draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
          else
          clip (G) -- (B) -- (C) -- (D) -- cycle [reverseclip];
          draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
          fi
          endscope
          else
          draw[very thick] (G) -- (C) -- (D) -- (A) -- (E) (D) -- (H);
          draw[dashed, thick] (A) -- (B) -- (C) (B) -- (F);
          beginscope
          draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
          ifnumAngle<300
          clip (C) -- (D) -- (G) -- cycle [reverseclip];
          draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
          else
          clip (G) -- (D) -- (A) -- (E) -- (H) -- cycle [reverseclip];
          draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
          fi
          endscope
          fi
          fi
          fi
          fi

          foreach point/position in A/below,B/below,C/below,D/right,E/above,F/left,G/above,H/above,O/above,I/below
          fill (point) circle (2.0pt);
          node[position=2pt] at (point) $point$;


          draw[dashed, blue] (B) -- (D);
          path[tdplot_screen_coords] let p1=(current bounding box.south west),
          p2=(current bounding box.north east)
          in [/utils/exec=pgfmathsetmacroxminmin(xmin pt,x1)
          pgfmathsetmacroxmaxmax(xmax pt,x2)
          pgfmathsetmacroyminmin(ymin pt,y1)
          pgfmathsetmacroymaxmax(ymax pt,y2)
          xdefxminxminxdefxmaxxmaxxdefyminyminxdefymaxymax];
          %node[tdplot_screen_coords] at (current bounding box.center) angle=Angle;
          SaveBBox
          endtikzpicture

          enddocument


          enter image description here






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "85"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483509%2fhow-can-i-make-a-cone-from-a-cube-and-view-the-cube-with-different-angles%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            5














            TikZ does not have a 3d engine, so one has to distinguish many cases. I hope this does not contain too many bugs. (There is also something that keeps track of the bounding boxes, meaning you have to compile the file twice.)



            documentclass[border=2mm,12pt,tikz]standalone 
            usepackagetikz-3dplot
            makeatletter
            newcountersmuggle
            DeclareRobustCommandsmuggleone[1]%
            stepcountersmuggle%
            expandafterglobalexpandafterletcsname smuggle@arabicsmuggleendcsname#1%
            aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabicsmuggleendcsname

            DeclareRobustCommandsmuggle[2][1]%
            smuggleone#2%
            ifnum#1>1
            aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
            fi

            defSaveBBox%
            immediatewrite@mainauxxdefstringxminxminrelax
            immediatewrite@mainauxxdefstringxmaxxmaxrelax
            immediatewrite@mainauxxdefstringyminyminrelax
            immediatewrite@mainauxxdefstringymaxymaxrelax
            makeatother
            % based on tex.stackexchange.com/a/12033/AAA
            tikzsetreverseclip/.style=insert path=(current bounding box.south west)rectangle
            (current bounding box.north east)

            defparsecoord(#1,#2,#3)>(#4,#5,#6)%
            def#4#1%
            def#5#2%
            def#6#3%
            smuggle#4%
            smuggle#5%
            smuggle#6%

            defSPTD(#1,#2,#3).(#4,#5,#6)((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))
            defVPTD(#1,#2,#3)x(#4,#5,#6)((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))
            defVecMinus(#1,#2,#3)-(#4,#5,#6)(#1-1*(#4),#2-1*(#5),#3-1*(#6))
            defVecAdd(#1,#2,#3)+(#4,#5,#6)(#1+1*(#4),#2+1*(#5),#3+1*(#6))
            newcommandRotationAnglesForPlaneWithNormal[5]%typeoutN=(#1,#2,#3)
            foreach XS in 1,-1
            foreach YS in 1,-1
            pgfmathsetmacromybetaXS*acos(#3)
            pgfmathsetmacromyalphaYS*acos(#1/sin(mybeta))
            pgfmathsetmacrontestabs(cos(myalpha)*sin(mybeta)-#1)%
            +abs(sin(myalpha)*sin(mybeta)-#2)+abs(cos(mybeta)-#3)
            ifdimntest pt<0.1pt
            xdef#4myalpha
            xdef#5mybeta
            fi


            tikzsetcircle in plane with normal/.style args=#1 with radius #2 around #3
            /utils/exec=edeftempnoexpandparsecoord#1>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
            temp
            pgfmathsetmacromyNxmyNx
            pgfmathsetmacromyNymyNy
            pgfmathsetmacromyNzmyNz
            pgfmathsetmacromyNormalizationsqrt(pow(myNx,2)+pow(myNy,2)+pow(myNz,2))
            pgfmathsetmacromyNxmyNx/myNormalization
            pgfmathsetmacromyNymyNy/myNormalization
            pgfmathsetmacromyNzmyNz/myNormalization
            % compute the rotation angles that transform us in the corresponding plabe
            RotationAnglesForPlaneWithNormalmyNxmyNymyNztmpalphatmpbeta
            %typeoutN=(myNx,myNy,myNz),alpha=tmpalpha,beta=tmpbeta,r=#2,#3
            tdplotsetrotatedcoordstmpalphatmpbeta0,
            insert path=[tdplot_rotated_coords,canvas is xy plane at z=0,transform shape]
            #3 circle[radius=#2]



            begindocument
            tdplotsetmaincoords70195
            foreach Angle in 5,15,...,355 % 5

            tdplotsetmaincoords70Angle
            begintikzpicture[tdplot_main_coords,scale=1,line join = round, line cap = round]
            ifdefinedxmin
            else
            defxmin0
            fi
            ifdefinedxmax
            else
            defxmax0
            fi
            ifdefinedymin
            else
            defymin0
            fi
            ifdefinedymax
            else
            defymax0
            fi
            path[tdplot_screen_coords] (xmin pt,ymin pt) rectangle (xmax pt,ymax pt);
            pgfmathsetmacroa3
            pgfmathsetmacror2/3*sqrt(6)*a
            path
            coordinate (A) at (a,-a,-a)
            coordinate (B) at (a,a,-a)
            coordinate (C) at (-a,a,-a)
            coordinate (D) at (-a,-a,-a)
            coordinate (E) at ($(A)+ (0,0,2*a)$)
            coordinate (F) at ($(B)+ (0,0,2*a)$)
            coordinate (G) at ($(C)+ (0,0,2*a)$)
            coordinate (H) at ($(D)+ (0,0,2*a)$)
            coordinate (O) at (0,0,0)
            coordinate (I) at (-1/3*a, 1/3*a, -1/3*a)
            ;
            parsecoord(a,a,-a)>(myBx,myBy,myBz)
            parsecoord(-a,a,a)>(myGx,myGy,myGz)
            parsecoord(-a,-a,-a)>(myDx,myDy,myDz)
            defmynormalVPTD(myDx-myBx,myDy-myBy,myDz-myBz)x(myDx-myGx,myDy-myGy,myDz-myGz)
            edeftempnoexpandparsecoordmynormal>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
            draw[very thick, blue] (G) -- (D) (G) -- (B);
            draw[very thick] (E) --(F) --(G)-- (H) --cycle;
            ifnumAngle<90
            draw[very thick] (D) --(A) --(B) (D) -- (H) (A)--(E) (B) -- (F);
            draw[dashed, thick] (D) -- (C) -- (B) (C) -- (G);
            beginscope
            draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
            clip (F) -- (G) -- (H) -- (D) -- (A) -- (B) -- cycle [reverseclip];
            draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
            endscope
            else
            ifnumAngle<180
            draw[very thick] (E) --(A) --(B) -- (C) -- (G) (B) -- (F);
            draw[dashed, thick] (A) -- (D) -- (C) (D) -- (H);
            beginscope
            draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
            ifnumAngle<150
            clip (G) -- (H) -- (E) -- (A) -- (B) -- cycle [reverseclip];
            else
            clip (B) -- (C) -- (G) -- cycle [reverseclip];
            fi
            draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
            endscope
            else
            ifnumAngle<180
            draw[very thick] (E) -- (F) -- (B)
            (B) --(C)--(G)--(F)
            (C)--(D) --(H)--(G)--cycle ;
            draw[dashed, thick]
            (B) -- (A) -- (E) (D) --(A) (D) --(C) (D) --(H) (E) --(C) (I) -- (B) (I) -- (G) (I) --(D);
            beginscope
            draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
            clip (B) -- (C) -- (D) -- (G) -- cycle [reverseclip];
            draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
            endscope
            else
            ifnumAngle<270
            draw[very thick] (F) -- (B) -- (C) -- (D) -- (H) (C) -- (G);
            draw[dashed, thick] (B) -- (A) -- (D) (A) -- (E);
            beginscope
            draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
            ifnumAngle<230
            clip (G) -- (C) -- (D) -- cycle [reverseclip];
            draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
            else
            clip (G) -- (B) -- (C) -- (D) -- cycle [reverseclip];
            draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
            fi
            endscope
            else
            draw[very thick] (G) -- (C) -- (D) -- (A) -- (E) (D) -- (H);
            draw[dashed, thick] (A) -- (B) -- (C) (B) -- (F);
            beginscope
            draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
            ifnumAngle<300
            clip (C) -- (D) -- (G) -- cycle [reverseclip];
            draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
            else
            clip (G) -- (D) -- (A) -- (E) -- (H) -- cycle [reverseclip];
            draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
            fi
            endscope
            fi
            fi
            fi
            fi

            foreach point/position in A/below,B/below,C/below,D/right,E/above,F/left,G/above,H/above,O/above,I/below
            fill (point) circle (2.0pt);
            node[position=2pt] at (point) $point$;


            draw[dashed, blue] (B) -- (D);
            path[tdplot_screen_coords] let p1=(current bounding box.south west),
            p2=(current bounding box.north east)
            in [/utils/exec=pgfmathsetmacroxminmin(xmin pt,x1)
            pgfmathsetmacroxmaxmax(xmax pt,x2)
            pgfmathsetmacroyminmin(ymin pt,y1)
            pgfmathsetmacroymaxmax(ymax pt,y2)
            xdefxminxminxdefxmaxxmaxxdefyminyminxdefymaxymax];
            %node[tdplot_screen_coords] at (current bounding box.center) angle=Angle;
            SaveBBox
            endtikzpicture

            enddocument


            enter image description here






            share|improve this answer



























              5














              TikZ does not have a 3d engine, so one has to distinguish many cases. I hope this does not contain too many bugs. (There is also something that keeps track of the bounding boxes, meaning you have to compile the file twice.)



              documentclass[border=2mm,12pt,tikz]standalone 
              usepackagetikz-3dplot
              makeatletter
              newcountersmuggle
              DeclareRobustCommandsmuggleone[1]%
              stepcountersmuggle%
              expandafterglobalexpandafterletcsname smuggle@arabicsmuggleendcsname#1%
              aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabicsmuggleendcsname

              DeclareRobustCommandsmuggle[2][1]%
              smuggleone#2%
              ifnum#1>1
              aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
              fi

              defSaveBBox%
              immediatewrite@mainauxxdefstringxminxminrelax
              immediatewrite@mainauxxdefstringxmaxxmaxrelax
              immediatewrite@mainauxxdefstringyminyminrelax
              immediatewrite@mainauxxdefstringymaxymaxrelax
              makeatother
              % based on tex.stackexchange.com/a/12033/AAA
              tikzsetreverseclip/.style=insert path=(current bounding box.south west)rectangle
              (current bounding box.north east)

              defparsecoord(#1,#2,#3)>(#4,#5,#6)%
              def#4#1%
              def#5#2%
              def#6#3%
              smuggle#4%
              smuggle#5%
              smuggle#6%

              defSPTD(#1,#2,#3).(#4,#5,#6)((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))
              defVPTD(#1,#2,#3)x(#4,#5,#6)((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))
              defVecMinus(#1,#2,#3)-(#4,#5,#6)(#1-1*(#4),#2-1*(#5),#3-1*(#6))
              defVecAdd(#1,#2,#3)+(#4,#5,#6)(#1+1*(#4),#2+1*(#5),#3+1*(#6))
              newcommandRotationAnglesForPlaneWithNormal[5]%typeoutN=(#1,#2,#3)
              foreach XS in 1,-1
              foreach YS in 1,-1
              pgfmathsetmacromybetaXS*acos(#3)
              pgfmathsetmacromyalphaYS*acos(#1/sin(mybeta))
              pgfmathsetmacrontestabs(cos(myalpha)*sin(mybeta)-#1)%
              +abs(sin(myalpha)*sin(mybeta)-#2)+abs(cos(mybeta)-#3)
              ifdimntest pt<0.1pt
              xdef#4myalpha
              xdef#5mybeta
              fi


              tikzsetcircle in plane with normal/.style args=#1 with radius #2 around #3
              /utils/exec=edeftempnoexpandparsecoord#1>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
              temp
              pgfmathsetmacromyNxmyNx
              pgfmathsetmacromyNymyNy
              pgfmathsetmacromyNzmyNz
              pgfmathsetmacromyNormalizationsqrt(pow(myNx,2)+pow(myNy,2)+pow(myNz,2))
              pgfmathsetmacromyNxmyNx/myNormalization
              pgfmathsetmacromyNymyNy/myNormalization
              pgfmathsetmacromyNzmyNz/myNormalization
              % compute the rotation angles that transform us in the corresponding plabe
              RotationAnglesForPlaneWithNormalmyNxmyNymyNztmpalphatmpbeta
              %typeoutN=(myNx,myNy,myNz),alpha=tmpalpha,beta=tmpbeta,r=#2,#3
              tdplotsetrotatedcoordstmpalphatmpbeta0,
              insert path=[tdplot_rotated_coords,canvas is xy plane at z=0,transform shape]
              #3 circle[radius=#2]



              begindocument
              tdplotsetmaincoords70195
              foreach Angle in 5,15,...,355 % 5

              tdplotsetmaincoords70Angle
              begintikzpicture[tdplot_main_coords,scale=1,line join = round, line cap = round]
              ifdefinedxmin
              else
              defxmin0
              fi
              ifdefinedxmax
              else
              defxmax0
              fi
              ifdefinedymin
              else
              defymin0
              fi
              ifdefinedymax
              else
              defymax0
              fi
              path[tdplot_screen_coords] (xmin pt,ymin pt) rectangle (xmax pt,ymax pt);
              pgfmathsetmacroa3
              pgfmathsetmacror2/3*sqrt(6)*a
              path
              coordinate (A) at (a,-a,-a)
              coordinate (B) at (a,a,-a)
              coordinate (C) at (-a,a,-a)
              coordinate (D) at (-a,-a,-a)
              coordinate (E) at ($(A)+ (0,0,2*a)$)
              coordinate (F) at ($(B)+ (0,0,2*a)$)
              coordinate (G) at ($(C)+ (0,0,2*a)$)
              coordinate (H) at ($(D)+ (0,0,2*a)$)
              coordinate (O) at (0,0,0)
              coordinate (I) at (-1/3*a, 1/3*a, -1/3*a)
              ;
              parsecoord(a,a,-a)>(myBx,myBy,myBz)
              parsecoord(-a,a,a)>(myGx,myGy,myGz)
              parsecoord(-a,-a,-a)>(myDx,myDy,myDz)
              defmynormalVPTD(myDx-myBx,myDy-myBy,myDz-myBz)x(myDx-myGx,myDy-myGy,myDz-myGz)
              edeftempnoexpandparsecoordmynormal>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
              draw[very thick, blue] (G) -- (D) (G) -- (B);
              draw[very thick] (E) --(F) --(G)-- (H) --cycle;
              ifnumAngle<90
              draw[very thick] (D) --(A) --(B) (D) -- (H) (A)--(E) (B) -- (F);
              draw[dashed, thick] (D) -- (C) -- (B) (C) -- (G);
              beginscope
              draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
              clip (F) -- (G) -- (H) -- (D) -- (A) -- (B) -- cycle [reverseclip];
              draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
              endscope
              else
              ifnumAngle<180
              draw[very thick] (E) --(A) --(B) -- (C) -- (G) (B) -- (F);
              draw[dashed, thick] (A) -- (D) -- (C) (D) -- (H);
              beginscope
              draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
              ifnumAngle<150
              clip (G) -- (H) -- (E) -- (A) -- (B) -- cycle [reverseclip];
              else
              clip (B) -- (C) -- (G) -- cycle [reverseclip];
              fi
              draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
              endscope
              else
              ifnumAngle<180
              draw[very thick] (E) -- (F) -- (B)
              (B) --(C)--(G)--(F)
              (C)--(D) --(H)--(G)--cycle ;
              draw[dashed, thick]
              (B) -- (A) -- (E) (D) --(A) (D) --(C) (D) --(H) (E) --(C) (I) -- (B) (I) -- (G) (I) --(D);
              beginscope
              draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
              clip (B) -- (C) -- (D) -- (G) -- cycle [reverseclip];
              draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
              endscope
              else
              ifnumAngle<270
              draw[very thick] (F) -- (B) -- (C) -- (D) -- (H) (C) -- (G);
              draw[dashed, thick] (B) -- (A) -- (D) (A) -- (E);
              beginscope
              draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
              ifnumAngle<230
              clip (G) -- (C) -- (D) -- cycle [reverseclip];
              draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
              else
              clip (G) -- (B) -- (C) -- (D) -- cycle [reverseclip];
              draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
              fi
              endscope
              else
              draw[very thick] (G) -- (C) -- (D) -- (A) -- (E) (D) -- (H);
              draw[dashed, thick] (A) -- (B) -- (C) (B) -- (F);
              beginscope
              draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
              ifnumAngle<300
              clip (C) -- (D) -- (G) -- cycle [reverseclip];
              draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
              else
              clip (G) -- (D) -- (A) -- (E) -- (H) -- cycle [reverseclip];
              draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
              fi
              endscope
              fi
              fi
              fi
              fi

              foreach point/position in A/below,B/below,C/below,D/right,E/above,F/left,G/above,H/above,O/above,I/below
              fill (point) circle (2.0pt);
              node[position=2pt] at (point) $point$;


              draw[dashed, blue] (B) -- (D);
              path[tdplot_screen_coords] let p1=(current bounding box.south west),
              p2=(current bounding box.north east)
              in [/utils/exec=pgfmathsetmacroxminmin(xmin pt,x1)
              pgfmathsetmacroxmaxmax(xmax pt,x2)
              pgfmathsetmacroyminmin(ymin pt,y1)
              pgfmathsetmacroymaxmax(ymax pt,y2)
              xdefxminxminxdefxmaxxmaxxdefyminyminxdefymaxymax];
              %node[tdplot_screen_coords] at (current bounding box.center) angle=Angle;
              SaveBBox
              endtikzpicture

              enddocument


              enter image description here






              share|improve this answer

























                5












                5








                5







                TikZ does not have a 3d engine, so one has to distinguish many cases. I hope this does not contain too many bugs. (There is also something that keeps track of the bounding boxes, meaning you have to compile the file twice.)



                documentclass[border=2mm,12pt,tikz]standalone 
                usepackagetikz-3dplot
                makeatletter
                newcountersmuggle
                DeclareRobustCommandsmuggleone[1]%
                stepcountersmuggle%
                expandafterglobalexpandafterletcsname smuggle@arabicsmuggleendcsname#1%
                aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabicsmuggleendcsname

                DeclareRobustCommandsmuggle[2][1]%
                smuggleone#2%
                ifnum#1>1
                aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
                fi

                defSaveBBox%
                immediatewrite@mainauxxdefstringxminxminrelax
                immediatewrite@mainauxxdefstringxmaxxmaxrelax
                immediatewrite@mainauxxdefstringyminyminrelax
                immediatewrite@mainauxxdefstringymaxymaxrelax
                makeatother
                % based on tex.stackexchange.com/a/12033/AAA
                tikzsetreverseclip/.style=insert path=(current bounding box.south west)rectangle
                (current bounding box.north east)

                defparsecoord(#1,#2,#3)>(#4,#5,#6)%
                def#4#1%
                def#5#2%
                def#6#3%
                smuggle#4%
                smuggle#5%
                smuggle#6%

                defSPTD(#1,#2,#3).(#4,#5,#6)((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))
                defVPTD(#1,#2,#3)x(#4,#5,#6)((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))
                defVecMinus(#1,#2,#3)-(#4,#5,#6)(#1-1*(#4),#2-1*(#5),#3-1*(#6))
                defVecAdd(#1,#2,#3)+(#4,#5,#6)(#1+1*(#4),#2+1*(#5),#3+1*(#6))
                newcommandRotationAnglesForPlaneWithNormal[5]%typeoutN=(#1,#2,#3)
                foreach XS in 1,-1
                foreach YS in 1,-1
                pgfmathsetmacromybetaXS*acos(#3)
                pgfmathsetmacromyalphaYS*acos(#1/sin(mybeta))
                pgfmathsetmacrontestabs(cos(myalpha)*sin(mybeta)-#1)%
                +abs(sin(myalpha)*sin(mybeta)-#2)+abs(cos(mybeta)-#3)
                ifdimntest pt<0.1pt
                xdef#4myalpha
                xdef#5mybeta
                fi


                tikzsetcircle in plane with normal/.style args=#1 with radius #2 around #3
                /utils/exec=edeftempnoexpandparsecoord#1>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
                temp
                pgfmathsetmacromyNxmyNx
                pgfmathsetmacromyNymyNy
                pgfmathsetmacromyNzmyNz
                pgfmathsetmacromyNormalizationsqrt(pow(myNx,2)+pow(myNy,2)+pow(myNz,2))
                pgfmathsetmacromyNxmyNx/myNormalization
                pgfmathsetmacromyNymyNy/myNormalization
                pgfmathsetmacromyNzmyNz/myNormalization
                % compute the rotation angles that transform us in the corresponding plabe
                RotationAnglesForPlaneWithNormalmyNxmyNymyNztmpalphatmpbeta
                %typeoutN=(myNx,myNy,myNz),alpha=tmpalpha,beta=tmpbeta,r=#2,#3
                tdplotsetrotatedcoordstmpalphatmpbeta0,
                insert path=[tdplot_rotated_coords,canvas is xy plane at z=0,transform shape]
                #3 circle[radius=#2]



                begindocument
                tdplotsetmaincoords70195
                foreach Angle in 5,15,...,355 % 5

                tdplotsetmaincoords70Angle
                begintikzpicture[tdplot_main_coords,scale=1,line join = round, line cap = round]
                ifdefinedxmin
                else
                defxmin0
                fi
                ifdefinedxmax
                else
                defxmax0
                fi
                ifdefinedymin
                else
                defymin0
                fi
                ifdefinedymax
                else
                defymax0
                fi
                path[tdplot_screen_coords] (xmin pt,ymin pt) rectangle (xmax pt,ymax pt);
                pgfmathsetmacroa3
                pgfmathsetmacror2/3*sqrt(6)*a
                path
                coordinate (A) at (a,-a,-a)
                coordinate (B) at (a,a,-a)
                coordinate (C) at (-a,a,-a)
                coordinate (D) at (-a,-a,-a)
                coordinate (E) at ($(A)+ (0,0,2*a)$)
                coordinate (F) at ($(B)+ (0,0,2*a)$)
                coordinate (G) at ($(C)+ (0,0,2*a)$)
                coordinate (H) at ($(D)+ (0,0,2*a)$)
                coordinate (O) at (0,0,0)
                coordinate (I) at (-1/3*a, 1/3*a, -1/3*a)
                ;
                parsecoord(a,a,-a)>(myBx,myBy,myBz)
                parsecoord(-a,a,a)>(myGx,myGy,myGz)
                parsecoord(-a,-a,-a)>(myDx,myDy,myDz)
                defmynormalVPTD(myDx-myBx,myDy-myBy,myDz-myBz)x(myDx-myGx,myDy-myGy,myDz-myGz)
                edeftempnoexpandparsecoordmynormal>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
                draw[very thick, blue] (G) -- (D) (G) -- (B);
                draw[very thick] (E) --(F) --(G)-- (H) --cycle;
                ifnumAngle<90
                draw[very thick] (D) --(A) --(B) (D) -- (H) (A)--(E) (B) -- (F);
                draw[dashed, thick] (D) -- (C) -- (B) (C) -- (G);
                beginscope
                draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
                clip (F) -- (G) -- (H) -- (D) -- (A) -- (B) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                endscope
                else
                ifnumAngle<180
                draw[very thick] (E) --(A) --(B) -- (C) -- (G) (B) -- (F);
                draw[dashed, thick] (A) -- (D) -- (C) (D) -- (H);
                beginscope
                draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
                ifnumAngle<150
                clip (G) -- (H) -- (E) -- (A) -- (B) -- cycle [reverseclip];
                else
                clip (B) -- (C) -- (G) -- cycle [reverseclip];
                fi
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                endscope
                else
                ifnumAngle<180
                draw[very thick] (E) -- (F) -- (B)
                (B) --(C)--(G)--(F)
                (C)--(D) --(H)--(G)--cycle ;
                draw[dashed, thick]
                (B) -- (A) -- (E) (D) --(A) (D) --(C) (D) --(H) (E) --(C) (I) -- (B) (I) -- (G) (I) --(D);
                beginscope
                draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
                clip (B) -- (C) -- (D) -- (G) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                endscope
                else
                ifnumAngle<270
                draw[very thick] (F) -- (B) -- (C) -- (D) -- (H) (C) -- (G);
                draw[dashed, thick] (B) -- (A) -- (D) (A) -- (E);
                beginscope
                draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
                ifnumAngle<230
                clip (G) -- (C) -- (D) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                else
                clip (G) -- (B) -- (C) -- (D) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                fi
                endscope
                else
                draw[very thick] (G) -- (C) -- (D) -- (A) -- (E) (D) -- (H);
                draw[dashed, thick] (A) -- (B) -- (C) (B) -- (F);
                beginscope
                draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
                ifnumAngle<300
                clip (C) -- (D) -- (G) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                else
                clip (G) -- (D) -- (A) -- (E) -- (H) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                fi
                endscope
                fi
                fi
                fi
                fi

                foreach point/position in A/below,B/below,C/below,D/right,E/above,F/left,G/above,H/above,O/above,I/below
                fill (point) circle (2.0pt);
                node[position=2pt] at (point) $point$;


                draw[dashed, blue] (B) -- (D);
                path[tdplot_screen_coords] let p1=(current bounding box.south west),
                p2=(current bounding box.north east)
                in [/utils/exec=pgfmathsetmacroxminmin(xmin pt,x1)
                pgfmathsetmacroxmaxmax(xmax pt,x2)
                pgfmathsetmacroyminmin(ymin pt,y1)
                pgfmathsetmacroymaxmax(ymax pt,y2)
                xdefxminxminxdefxmaxxmaxxdefyminyminxdefymaxymax];
                %node[tdplot_screen_coords] at (current bounding box.center) angle=Angle;
                SaveBBox
                endtikzpicture

                enddocument


                enter image description here






                share|improve this answer













                TikZ does not have a 3d engine, so one has to distinguish many cases. I hope this does not contain too many bugs. (There is also something that keeps track of the bounding boxes, meaning you have to compile the file twice.)



                documentclass[border=2mm,12pt,tikz]standalone 
                usepackagetikz-3dplot
                makeatletter
                newcountersmuggle
                DeclareRobustCommandsmuggleone[1]%
                stepcountersmuggle%
                expandafterglobalexpandafterletcsname smuggle@arabicsmuggleendcsname#1%
                aftergroupletaftergroup#1expandafteraftergroupcsname smuggle@arabicsmuggleendcsname

                DeclareRobustCommandsmuggle[2][1]%
                smuggleone#2%
                ifnum#1>1
                aftergroupsmuggleaftergroup[expandafteraftergroupthenumexpr#1-1aftergroup]aftergroup#2%
                fi

                defSaveBBox%
                immediatewrite@mainauxxdefstringxminxminrelax
                immediatewrite@mainauxxdefstringxmaxxmaxrelax
                immediatewrite@mainauxxdefstringyminyminrelax
                immediatewrite@mainauxxdefstringymaxymaxrelax
                makeatother
                % based on tex.stackexchange.com/a/12033/AAA
                tikzsetreverseclip/.style=insert path=(current bounding box.south west)rectangle
                (current bounding box.north east)

                defparsecoord(#1,#2,#3)>(#4,#5,#6)%
                def#4#1%
                def#5#2%
                def#6#3%
                smuggle#4%
                smuggle#5%
                smuggle#6%

                defSPTD(#1,#2,#3).(#4,#5,#6)((#1)*(#4)+1*(#2)*(#5)+1*(#3)*(#6))
                defVPTD(#1,#2,#3)x(#4,#5,#6)((#2)*(#6)-1*(#3)*(#5),(#3)*(#4)-1*(#1)*(#6),(#1)*(#5)-1*(#2)*(#4))
                defVecMinus(#1,#2,#3)-(#4,#5,#6)(#1-1*(#4),#2-1*(#5),#3-1*(#6))
                defVecAdd(#1,#2,#3)+(#4,#5,#6)(#1+1*(#4),#2+1*(#5),#3+1*(#6))
                newcommandRotationAnglesForPlaneWithNormal[5]%typeoutN=(#1,#2,#3)
                foreach XS in 1,-1
                foreach YS in 1,-1
                pgfmathsetmacromybetaXS*acos(#3)
                pgfmathsetmacromyalphaYS*acos(#1/sin(mybeta))
                pgfmathsetmacrontestabs(cos(myalpha)*sin(mybeta)-#1)%
                +abs(sin(myalpha)*sin(mybeta)-#2)+abs(cos(mybeta)-#3)
                ifdimntest pt<0.1pt
                xdef#4myalpha
                xdef#5mybeta
                fi


                tikzsetcircle in plane with normal/.style args=#1 with radius #2 around #3
                /utils/exec=edeftempnoexpandparsecoord#1>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
                temp
                pgfmathsetmacromyNxmyNx
                pgfmathsetmacromyNymyNy
                pgfmathsetmacromyNzmyNz
                pgfmathsetmacromyNormalizationsqrt(pow(myNx,2)+pow(myNy,2)+pow(myNz,2))
                pgfmathsetmacromyNxmyNx/myNormalization
                pgfmathsetmacromyNymyNy/myNormalization
                pgfmathsetmacromyNzmyNz/myNormalization
                % compute the rotation angles that transform us in the corresponding plabe
                RotationAnglesForPlaneWithNormalmyNxmyNymyNztmpalphatmpbeta
                %typeoutN=(myNx,myNy,myNz),alpha=tmpalpha,beta=tmpbeta,r=#2,#3
                tdplotsetrotatedcoordstmpalphatmpbeta0,
                insert path=[tdplot_rotated_coords,canvas is xy plane at z=0,transform shape]
                #3 circle[radius=#2]



                begindocument
                tdplotsetmaincoords70195
                foreach Angle in 5,15,...,355 % 5

                tdplotsetmaincoords70Angle
                begintikzpicture[tdplot_main_coords,scale=1,line join = round, line cap = round]
                ifdefinedxmin
                else
                defxmin0
                fi
                ifdefinedxmax
                else
                defxmax0
                fi
                ifdefinedymin
                else
                defymin0
                fi
                ifdefinedymax
                else
                defymax0
                fi
                path[tdplot_screen_coords] (xmin pt,ymin pt) rectangle (xmax pt,ymax pt);
                pgfmathsetmacroa3
                pgfmathsetmacror2/3*sqrt(6)*a
                path
                coordinate (A) at (a,-a,-a)
                coordinate (B) at (a,a,-a)
                coordinate (C) at (-a,a,-a)
                coordinate (D) at (-a,-a,-a)
                coordinate (E) at ($(A)+ (0,0,2*a)$)
                coordinate (F) at ($(B)+ (0,0,2*a)$)
                coordinate (G) at ($(C)+ (0,0,2*a)$)
                coordinate (H) at ($(D)+ (0,0,2*a)$)
                coordinate (O) at (0,0,0)
                coordinate (I) at (-1/3*a, 1/3*a, -1/3*a)
                ;
                parsecoord(a,a,-a)>(myBx,myBy,myBz)
                parsecoord(-a,a,a)>(myGx,myGy,myGz)
                parsecoord(-a,-a,-a)>(myDx,myDy,myDz)
                defmynormalVPTD(myDx-myBx,myDy-myBy,myDz-myBz)x(myDx-myGx,myDy-myGy,myDz-myGz)
                edeftempnoexpandparsecoordmynormal>(noexpandmyNx,noexpandmyNy,noexpandmyNz)
                draw[very thick, blue] (G) -- (D) (G) -- (B);
                draw[very thick] (E) --(F) --(G)-- (H) --cycle;
                ifnumAngle<90
                draw[very thick] (D) --(A) --(B) (D) -- (H) (A)--(E) (B) -- (F);
                draw[dashed, thick] (D) -- (C) -- (B) (C) -- (G);
                beginscope
                draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
                clip (F) -- (G) -- (H) -- (D) -- (A) -- (B) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                endscope
                else
                ifnumAngle<180
                draw[very thick] (E) --(A) --(B) -- (C) -- (G) (B) -- (F);
                draw[dashed, thick] (A) -- (D) -- (C) (D) -- (H);
                beginscope
                draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
                ifnumAngle<150
                clip (G) -- (H) -- (E) -- (A) -- (B) -- cycle [reverseclip];
                else
                clip (B) -- (C) -- (G) -- cycle [reverseclip];
                fi
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                endscope
                else
                ifnumAngle<180
                draw[very thick] (E) -- (F) -- (B)
                (B) --(C)--(G)--(F)
                (C)--(D) --(H)--(G)--cycle ;
                draw[dashed, thick]
                (B) -- (A) -- (E) (D) --(A) (D) --(C) (D) --(H) (E) --(C) (I) -- (B) (I) -- (G) (I) --(D);
                beginscope
                draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
                clip (B) -- (C) -- (D) -- (G) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                endscope
                else
                ifnumAngle<270
                draw[very thick] (F) -- (B) -- (C) -- (D) -- (H) (C) -- (G);
                draw[dashed, thick] (B) -- (A) -- (D) (A) -- (E);
                beginscope
                draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
                ifnumAngle<230
                clip (G) -- (C) -- (D) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                else
                clip (G) -- (B) -- (C) -- (D) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                fi
                endscope
                else
                draw[very thick] (G) -- (C) -- (D) -- (A) -- (E) (D) -- (H);
                draw[dashed, thick] (A) -- (B) -- (C) (B) -- (F);
                beginscope
                draw[red,dashed,circle in plane with normal=mynormal with radius r around (I)];
                ifnumAngle<300
                clip (C) -- (D) -- (G) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                else
                clip (G) -- (D) -- (A) -- (E) -- (H) -- cycle [reverseclip];
                draw[red,thick,circle in plane with normal=mynormal with radius r around (I)];
                fi
                endscope
                fi
                fi
                fi
                fi

                foreach point/position in A/below,B/below,C/below,D/right,E/above,F/left,G/above,H/above,O/above,I/below
                fill (point) circle (2.0pt);
                node[position=2pt] at (point) $point$;


                draw[dashed, blue] (B) -- (D);
                path[tdplot_screen_coords] let p1=(current bounding box.south west),
                p2=(current bounding box.north east)
                in [/utils/exec=pgfmathsetmacroxminmin(xmin pt,x1)
                pgfmathsetmacroxmaxmax(xmax pt,x2)
                pgfmathsetmacroyminmin(ymin pt,y1)
                pgfmathsetmacroymaxmax(ymax pt,y2)
                xdefxminxminxdefxmaxxmaxxdefyminyminxdefymaxymax];
                %node[tdplot_screen_coords] at (current bounding box.center) angle=Angle;
                SaveBBox
                endtikzpicture

                enddocument


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 6 at 14:01









                marmotmarmot

                116k5150282




                116k5150282



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483509%2fhow-can-i-make-a-cone-from-a-cube-and-view-the-cube-with-different-angles%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                    Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                    Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020