# How to pick a plane inside a cube in pst-3dplot?

I want to pick and highlight a diagonal plane of a cube. I do not want to color it but use some kind of fill-style so that I can print it on a black and white printer. The following is my solution using pst-3dplot treating the plane as a parametric surface. This cannot be the only way to do this. Is there another (better?) way? The following is the code.

    \documentclass[12pt]{report}
\usepackage{pst-3dplot}

\begin{document}
\psset{coorType=2,Alpha=90,IIIDticks}
\begin{pspicture}(-3,-2.5)(3,4.25)
\pstThreeDCoor[IIIDticks,IIIDticksize=0]
\pstThreeDBox[hiddenLine](0,0,0)(0,0,2)(2,0,0)(0,2,0)
\parametricplotThreeD[plotstyle=curve,yPlotpoints=20](0,2)(0,2){t  t  u}
\end{pspicture}
\end{document}

-

This looks like a different way. To create the plane I used the \pstThreeDSquare command. From the vector (0,0,0) the vectors (0,0,2) and (2,2,0) span the square. The fillstyle is hlines, vlines, or croshatch. Hatchwidth is the thickness of each line and hatchsep is the distance between adjacent lines.

\documentclass[12pt]{report}
\usepackage{xcolor}
\usepackage{pst-3dplot}
\begin{document}
\psset{coorType=2,Alpha=90,IIIDticks}
\begin{pspicture}(-3,-2.5)(3,4.25)
\pstThreeDCoor[coorType=2,IIIDticks,IIIDticksize=0,xMin=-2,xMax=4,yMin=-2,yMax=4,zMin=-1,zMax=3]{\psset{coorType=2,fillstyle=vlines,hatchwidth=.2mm,hatchsep=.55mm}\pstThreeDSquare(0,0,0)(0,0,2)(2,2,0)}
\pstThreeDBox[hiddenLine](0,0,0)(0,0,2)(2,0,0)(0,2,0)
\end{pspicture}
\end{document}


PS: you should be able to color it (solid) shades of gray and get it to print on a black and white printer.

-
Thank you very much. I like your solution better than mine. It gives me the option of several fill-styles. Besides, you should not expect someone to know how to parametrize surfaces to plot something simple like this. Ps. I tried to edit the 7th line of your code as it can be broken into 3 lines, but couldn't do it. –  Sony Sep 14 '11 at 10:46
Your welcome. Yes, most people couldn't come up with your parametrized solution. The fact \pstThreeDSquare is used to creates a shape that doesn't look rectangular is odd and the format of 3 vectors needed to generate it takes some getting used to. It's worth reiterating that if you use the xcolor package you can create lighter versions of solid colors like, say, black!45. You can adjust the number (0-100) until it shows up on your printer to your liking. –  DJP Sep 14 '11 at 14:33

I played with tikz and tikz-3dplot packages a little bit today. The following is a solution using those packages.

\documentclass[11pt]{report}
\usepackage{tikz}
\usepackage{tikz-3dplot}

\begin{document}
\tdplotsetmaincoords{60}{110}
\begin{tikzpicture}[scale=1.5,tdplot_main_coords]
\draw[thick,->] (0,0,0) -- (3,0,0) node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,3,0) node[anchor=north west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,3) node[anchor=south]{$z$};
\draw[fill, color=blue!30, draw=black,line width=1pt]
(2,2,2) -- (0,0,2) -- (0,0,0) -- (2,2,0) -- cycle;
\draw[line width=1pt]
(0,0,0) -- (0,0,2) -- (2,0,2) -- (2,0,0) -- (0,0,0) -- (0,2,0) -- (0,2,2) -- (0,0,2)
(2,0,2) -- (2,2,2) -- (2,2,0) -- (2,0,0)
(2,2,0) -- (0,2,0)
(2,2,2) -- (0,2,2);
\end{tikzpicture}
\end{document}

-
If you put \usetikzlibrary{patterns} in your preamble and replace color=blue!30 with pattern=north east lines, you'll get a hatched pattern, which would work well for printing. –  Jake Sep 15 '11 at 1:38
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7524993419647217, "perplexity": 818.7826479301705}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-42/segments/1414119662145.58/warc/CC-MAIN-20141024030102-00142-ip-10-16-133-185.ec2.internal.warc.gz"}