diff --git a/pstricks/sphere-cylinder/Makefile b/pstricks/sphere-cylinder/Makefile new file mode 100644 index 0000000..68ac41f --- /dev/null +++ b/pstricks/sphere-cylinder/Makefile @@ -0,0 +1,37 @@ +SOURCE = sphere-cylinder +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 diff --git a/pstricks/sphere-cylinder/Readme.md b/pstricks/sphere-cylinder/Readme.md new file mode 100644 index 0000000..b4b58bd --- /dev/null +++ b/pstricks/sphere-cylinder/Readme.md @@ -0,0 +1,5 @@ +This is an example from `pst-solides3d` documentation. + +Compiled example +---------------- +![Example](sphere-cylinder.png) diff --git a/pstricks/sphere-cylinder/sphere-cylinder.png b/pstricks/sphere-cylinder/sphere-cylinder.png new file mode 100644 index 0000000..e2b9845 Binary files /dev/null and b/pstricks/sphere-cylinder/sphere-cylinder.png differ diff --git a/pstricks/sphere-cylinder/sphere-cylinder.tex b/pstricks/sphere-cylinder/sphere-cylinder.tex new file mode 100644 index 0000000..0e3e1b6 --- /dev/null +++ b/pstricks/sphere-cylinder/sphere-cylinder.tex @@ -0,0 +1,36 @@ +\documentclass[pstricks,border=2pt]{standalone} +\usepackage{pst-solides3d} +\begin{document} +\psset{ + unit=0.5, + lightsrc=50 -50 50, + viewpoint=100 0 0 rtp2xyz, + Decran=110, + linewidth=0.5\pslinewidth +} +\begin{pspicture}(-7,-6)(6,6) +\defFunction{F}(t){ + t cos dup mul 5 mul +}{t cos t sin mul 5 mul}{t sin 5 mul} + +\codejps{% + /cylindre1 { + -5 2.5 5 [36 36] newcylindre + {2.5 0 0 translatepoint3d} solidtransform + dup (White) outputcolors + } def + /sphere1 { + 5 [36 72] newsphere + dup (White) outputcolors + } def + /CS {cylindre1 sphere1 solidfuz} def + CS drawsolid** +} +\psPoint(0,0,0){O} +\psSolid[object=courbe,r=0, + function=F, + range=0 360, + linecolor=red, + linewidth=4\pslinewidth] +\end{pspicture} +\end{document}