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

added sphere-cylinder intersection

This commit is contained in:
Martin Thoma 2013-06-30 17:24:01 +02:00
parent 86ab5dfa97
commit 4f8837d107
4 changed files with 78 additions and 0 deletions

View file

@ -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

View file

@ -0,0 +1,5 @@
This is an example from `pst-solides3d` documentation.
Compiled example
----------------
![Example](sphere-cylinder.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View file

@ -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}