2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

added sphere sphere solution

This commit is contained in:
Martin Thoma 2013-07-02 15:39:25 +02:00
parent 167c963317
commit 5279c340d6
4 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,37 @@
SOURCE = sphere-sphere
DELAY = 80
DENSITY = 300
WIDTH = 512
make:
latex $(SOURCE).tex -output-format=pdf
dvips -D600 $(SOURCE).dvi -o $(SOURCE).ps
ps2pdf $(SOURCE).ps $(SOURCE).pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot *.dvi *.ps
gif:
pdfcrop $(SOURCE).pdf
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
make clean
png:
make
make svg
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
transparentGif:
convert $(SOURCE).pdf -transparent white result.gif
make clean
svg:
make
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
pdf2svg $(SOURCE).pdf $(SOURCE).svg
# Necessary, as pdf2svg does not always create valid svgs:
inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg
inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg
rm $(SOURCE)2.svg

View file

@ -0,0 +1,9 @@
This is an example from `pst-solides3d` documentation.
Compiled example
----------------
![Example](sphere-sphere.png)
Credits
-------
Thanks to [Herbert](http://tex.stackexchange.com/users/2478/herbert) ([answer](http://tex.stackexchange.com/a/121906/5645))

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

View file

@ -0,0 +1,15 @@
\documentclass[pstricks,border=2pt]{standalone}
\usepackage{pst-solides3d}
\begin{document}
\begin{pspicture}(-4.5,-4)(5.5,2)
\psset{solidmemory,unit=0.55,
lightsrc=viewpoint,viewpoint=20 20 20 rtp2xyz,Decran=40}
\psSolid[object=sphere,r=2,ngrid=36 36,fillcolor=lightgray,
incolor=lightgray,hollow,name=sph1,action=none](3,0,0)
\psSolid[object=sphere,r=2,ngrid=36 36,fillcolor=lightgray,
incolor=lightgray,hollow,name=sph2,action=none](1,3,0)
\psSolid[object=fusion,base=sph1 sph2,opacity=0.5,action=draw**](0,0,0)
\end{pspicture}
\end{document}