I use GeoGebra to draw a cube. The code in GeoGebra is

\psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dimen=middle,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\psline[linewidth=1.2pt,linestyle=dashed,dash=1pt 1pt](1,2)(1,6)
\psline[linewidth=1.2pt,linestyle=dashed,dash=1pt 1pt](1,2)(0,0)
\psline[linewidth=1.2pt,linestyle=dashed,dash=1pt 1pt](1,2)(5,2)

I want style of the the segments BD, C_1D, AD and D_1D is dashed. I tried


but the lines are not dashed. How can I get that?


  • 1
    Why not use dashed line directly on Geogebra? – Sigur Feb 8 '14 at 14:11
  • You have to discover what are the coordinates of those points and use linestyle=dashed as option. – Sigur Feb 8 '14 at 14:13
  • I used dashed. But, I filled polygons ADD1A1 and BDC1. – minthao_2011 Feb 8 '14 at 14:15

enter image description here


If everything behind the surface should be dashed then the angle mark should be too.


enter image description here

  • @ Code Mocker. BD, C1D are dashed. Now I want to draw CA1 and A1D are also dashed. – minthao_2011 Feb 8 '14 at 14:43
  • ED shouldn't be dashed. – Svend Tveskæg Feb 8 '14 at 14:55
  • 1
    @SvendTveskæg: It should be dashed because it is behind the front surfaces. – kiss my armpit Feb 8 '14 at 14:59
\documentclass{article}% Herbert 20110907



enter image description here

  • @ Herbert The segments AD, BD, CD, C_1D, DD_1 are dashed. Now I want to CA1 and A1D are also dashed. – minthao_2011 Feb 8 '14 at 14:50

Just another way of doing things...

\begin{tikzpicture}[x=(0:2cm), y=(90:2cm*sqrt 2), z=(210:2cm/sqrt 3)]
\foreach \s in {0,1}
  \foreach \l [count=\i from 3, 
    evaluate={\t=-\i*90+45; \n=(\s==0) ? "" : "1";}] in {A,B,C,D}
       \coordinate (\l\n) at (cos \t, \s, sin \t);
\path (B) -- (C1) coordinate [midway] (E);
\fill [gray!25] (A) -- (D) -- (D1) -- (A1) -- cycle (D) -- (B) -- (C1) -- cycle;
\foreach \p in {A,...,E,A1,B1,C1,D1} \fill (\p) circle [radius=2pt];
\foreach \p/\a in {A/below left,B/below,C/right,D/above left,E/right} \node [\a] at (\p) {$\p$};
\foreach \p/\a in {A/left,B/above left,C/above,D/above left} \node [\a] at (\p1) {$\p_1$};
\draw [dashed] (A) -- (D) -- (D1) (D) -- (C) (D) -- (C1) (D) -- (B) (D) -- (E);
\draw (A) -- (A1) -- (B1) -- (B)  -- (A) (B) -- (C)  -- (C1) -- (D1) -- (A1) (B) -- (C1) -- (B1) (E) -- (C);
\clip (D) -- (E) -- (C);
\draw [dashed] (E) circle [radius=10pt];

enter image description here


Here is a possible solution.




  linewidth = 0.8pt,
  linejoin = 2,
  dotstyle = *,
  dotsize = 3pt 0
  linestyle = none,
  fillstyle = solid,
  fillcolor = black!15
   linewidth = 1.2pt
   linestyle = dashed,
   dash = 2pt 2pt
  MarkAngleRadius = 0.2




1) With Fuite =30 et coeff =.5


\tikzset{point/.style = {fill=gray,circle,inner sep=2pt}}



\pgfmathsinandcos\sint\cost{\angFuite} %  

  \draw    (0,0) coordinate (A)  -- (\clen,0)     coordinate (B) 
                                 -- (\clen,\clen) coordinate (B1) 
                                 -- (0,\clen)     coordinate (A1) 
                                 -- (A);

  \draw          (B) -- (\clen,\clen) coordinate (C);
  \draw[dashed]  (A) -- (0,\clen)     coordinate (D) 
                     -- (C) ;

  \draw[dashed] (D)       -- (0,\clen)     coordinate (D1);
  \draw         (\clen,0) -- (\clen,\clen) coordinate (C1) 
                          -- (D1) -- (A1);

   \draw (B1) -- (C1) -- coordinate (E)(B);
   \draw[dashed] (B) -- (D) -- (E);
   \draw[dashed] (D) -- (E);
   \draw (C) -- (E);
   \fill[gray!10,fill opacity=0.5] (A) -- (D) --(D1) -- (A1) -- cycle;
   \fill[gray!10,fill opacity=0.5] (B) -- (D) --(C1) --  cycle;
   \foreach \pt in {A,...,E}  \node[point] at (\pt) {};
   \foreach \pt in {A,...,D}  \node[point,label={above=6pt:$\pt_1$}] at (\pt1) {};
   \foreach \pt in {A,...,D} \node[below=6pt] at (\pt) {\pt};
    \node[point,label={right=6pt:$E$}] at (E) {};
    \draw[opacity=.5,gray,dashed] ($(D)!0.8!(E)$) edge[out=-50,in=-140] ($(C)!0.8!(E)$);

enter image description here

2) with fuite = 15 and coeff = .7

enter image description here


Another tikz solution:

\tikzset{point/.style = {fill=black,circle,inner sep=0.7pt}}
    \coordinate (a) at (0,0);
    \coordinate (b) at (2,0);
    \coordinate (c) at (2,2);
    \coordinate (d) at (0,2);
    \coordinate (a1) at (0.65,0.45);
    \coordinate (b1) at (2.65,0.45);
    \coordinate (c1) at (2.65,2.45);
    \coordinate (d1) at (0.65,2.45);

    \foreach \x in {a,b,c,d,a1,b1,c1,d1}{
    \node[point] at (\x) {};
    \foreach \x/\y in {c/B_1,d/A_1,c1/C_1,d1/D_1}{
    \node[] at ($(\x)+(0,0.2)$) {$\y$};
    \foreach \x/\y in {a/A,b/B,b1/C,a1/D}{
    \node[] at ($(\x)+(0,-0.2)$) {$\y$};

    \draw (a) -- (b) -- (c) -- (d) --cycle;
    \draw (d1) -- (c1) -- (b1) edge[densely dashed] (a1) ;
    \draw[densely dashed] (a) -- (a1) -- (d1) edge[solid] (d);
    \draw (b) -- (b1)  (c) -- (c1) ;
    \draw[densely dashed] (b) -- (a1) -- (c1) edge[solid]node[point,outer sep=0pt] (c1b){}  (b);
    \draw[densely dashed] (a1) -- coordinate[pos=0.95] (arc1) (c1b); 
    \draw (c1b) -- coordinate[pos=0.1] (arc2)(b1);
    \draw (arc1) edge[in=210,out=290] (arc2);
    \node[] at ($(c1b)+(0.15,0)$) {$E$};
    \begin{scope}[on background layer]
    \path[fill=gray!20] (a) -- (a1) -- (d1) -- (d) -- cycle;
    \path[fill=gray!20] (a1) -- (c1) -- (b) -- cycle;


enter image description here

  • How about label E? – minthao_2011 Feb 8 '14 at 15:54
  • @minthao_2011 Sorry I forgot :). Added now. – user11232 Feb 8 '14 at 15:57
  • @minthao_2011 Thank you, you are welcome. – user11232 Feb 8 '14 at 16:16

A tikz solution, providing a different approach.

enter image description here



\begin{tikzpicture}[scale=1,inner sep=0pt, outer sep=0pt]
\coordinate[label=right:$A$] (A) at (-1.2,-1.8);
\coordinate[label=right:$B$] (B) at (2.8,-1.8);
\coordinate[label=right:$C$] (C) at (4,0);
\coordinate[label=right:$D$] (D) at (0,0);
\coordinate[label=$A_1$]    (A1) at (-1.2,1.2);
\coordinate[label=$B_1$]    (B1) at (2.8,1.2);
\coordinate[label=$C_1$]    (C1) at (4,3);
\coordinate[label=$D_1$]    (D1) at (0,3);

\draw [thick] (B) --(A);
\draw [thick] (D1)--(A1)--(B1)--(C1);
\draw [thick] (A1)--(A) (B1)--(B);
\draw [thick] (B) --(C)--(C1)--(D1);
\draw [thick] (C1)--(B);
\draw [dashed]  (C)--(D) --(A)  (D)--(D1);
\filldraw [gray,opacity=0.5,thick] (A1)--(D1)--(D)--(A);
\filldraw [gray,opacity=0.5,thick, dashed] (B)--(C1)--(D)--cycle;
\draw [dotted]   ($(B)!0.5!(C1)$) node[](E){$E$}--(D)  ($(B)!0.5!(C1)$)--(4,0);
\draw [thick,dashed]($(E)!0.2!(D)$) to[bend right=30] ($(E)!0.5!(C)$);   % arc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.