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

Michael Lake mikel at speleonics.com.au
Fri May 23 10:30:35 BST 2014


Hi all

My modified version of David Molnar's and Wookies python script that turns the
3d into json is at: http://www.speleonics.com.au/mikes/software/3dtojson.py
This prints lablels fine but still has the E-W swapped. It might be a simple
matter of changing sign of some of the variables in that python script. 

Quoting Michael Lake <mikel at speleonics.com.au>:
> Hi Olly and all
> 
> Okies I have fixed the python script that does the labels. That is now
> working
> fine. Looks like my only error now is the js that swaps E-W. As you noticed
> Olly
> it's correct in the 3d as ASCII and looking at the 3dtopos output. 
> 
> I think I'll have to wait for other who have lconv.py to check if they get
> E-W
> reversed. 
> 
> Quoting Olly Betts <olly at survex.com>:
> > On Thu, May 22, 2014 at 02:19:20PM +1000, Michael Lake wrote:
> > > 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.
> > 
> > As of Survex 1.2.7, dump3d is built as standard, and --enable-testprogs
> > no longer does anything.
> > 
> > > > 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.
> 
> > 
> > I don't seem to have a copy of ltconv.py, but I suspect it needs
> > updating - in recent versions, dump3d outputs additional information at
> > the end of some lines, and it sounds like this script is rejecting such
> > lines.
> > 
> > > 2. east and west are swapped. It shows OK in Aven but swapped in
> > > Squiggle. The js is too complex for me. 
> > 
> > Looks OK in the dump3d output to me - test.east is at (50,0,0), so
> > positive X is East.
> > 
> > > Also a true east leg does not show, you need to set it to 90.1  
> > 
> > Again, looks OK in the dump3d output.
> > 
> > Cheers,
> >     Olly
> > 
> 
> 
> Mike Lake
> 
> 
> -- 
> Survex http://lists.survex.com/mailman/listinfo/survex
> 


Mike Lake




More information about the Survex mailing list