Python script that reads 3d file and writes a javascript file

Michael Lake mikel at speleonics.com.au
Thu May 22 05:19:20 BST 2014


Hi all

I wrote a while ago ...

> Thanks Wookey. Everything is now working ace :-)
> I just had to add --enable-testprogs to the configure script and then 
> dump3d was built. Have now a 3d file being rendered and able to be 
> rotated. Its really neat :-) I think the js functions are the tricky bits. 
> The python is pretty understandable. 

Not everything is working OK though. 
1. labels are not appearing 
   The 3d ASCII has labels at the end of NODE lines but the python code 
   in ltconv.py does not read those lines only MOVE and LINE statements. 
2. east and west are swapped. It shows OK in Aven but swapped in Squiggle. The
js is too complex for me. 
Also a true east leg does not show, you need to set it to 90.1  

Below is a test file that shows the problem.

;     N
;    /|\
;   / | \
;  1  |  2
;     |
;     |
;     |
;     |
;     start----east = East leg
;      \
;       \top = leg heading up

*fix test.start 0, 0, 0 
*begin test
;             dist   bear    elev
start  north  100.0     0.0   0.0   ; main leg heading north
north  1      20.0    120.0   0.0
north  2      20.0    240.0   0.0
start  east   50.0     90.1   0.0   ; east leg only shows if not exactly 90.0
start  top    50.0        -    up   ; vertical up leg
*end test


Mike Lake




More information about the Survex mailing list