summaryrefslogtreecommitdiff
path: root/doc/install_pyldraw
blob: 76642bc89b0ec8aa7b9e06639286850c2560fabc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/bash
#http://www.boddie.org.uk/david/Projects/Python/ldraw/
#http://www.boddie.org.uk/david/Projects/Python/ldraw/Software/ldraw-0.10.tar.bz2
#http://python-ldraw.alioth.debian.org/

#get povray (for rendering)
sudo apt-get install povray povray-doc povray-examples povray-includes

#get the python cmdsyntax module
easy_install cmdsyntax

mkdir -p ~/local/ldraw/pyldraw/
cd ~/local/ldraw/pyldraw/
hg clone http://hg.debian.org/hg/python-ldraw/main
cd main
sudo python setup.py install

#put it somewhere more useful
ln -s tools/ldr2pov.py ldr2pov.py

#get the "unix files"
wget http://www.ldraw.org/Downloads-req-getit-lid-32.html
mkdir unix
mv unix-complete.tgz unix/
cd unix/
tar -zxf unix-complete.tgz

#you shouldn't have to do this part.
#it regenerates "parts.lst"
cd LDRAW/
wine mklist.exe
#press N
#might not work. meh.
#now go back up to unix/
cd ../

#go back up
cd ../

#ipython
#from ldraw.parts import Parts
#parts = Parts("unix/LDRAW/parts.lst")
#cowboy_hat = parts.Hats["Hat Cowboy"]
#head = parts.Heads["Head with Solid Stud"]
#figure = Person()
#print figure.head(Yellow, 35)
#print figure.hat(Black, "3901") # Hair Male

#generate ldraw (dot ldr) file
python examples/figures.py > temp.ldr

#generate povray (dot pov) file
./ldr2pov.py unix/LDRAW/parts.lst temp.ldr temp.pov 160.0,80.0,-240.0

#convert from dot pov to dot png
povray +Itemp.pov +FN16 +Otemp.png +Q6

#view temp.png in your favorite image viewer
#have fun :-)