0001###########################################################################
0002# PyGeo - a dynamic geometry toolkit
0003# Copyright (C) 2005 Arthur Siegel (ajsiegel@optonline.com)
0004#
0005# This library is free software; you can redistribute it and/or
0006# modify it under the terms of the GNU Lesser General Public
0007# License as published by the Free Software Foundation; either
0008# version 2.1 of the License, or (at your option) any later version.
0009#
0010# This library is distributed in the hope that it will be useful,
0011# but WITHOUT ANY WARRANTY; without even the implied warranty of
0012# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013# Lesser General Public License for more details.
0014#
0015# You should have received a copy of the GNU Lesser General Public
0016# License along with this library; if not, write to the Free Software
0017# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
0018#
0019#PyGeo homepage: http://pygeo.sourceforge.net
0020###########################################################################
0021
0022"""global options used in PyGeo"""
0023
0024
0025# range for floating number equality
0026EPS=1e-4
0027
0028# toggle for testing of constraints - e.g. are points coplanar, are lines skew
0029DO_TESTS=True
0030
0031# toggle for testing if vector postions are beyond constraints that could causue display problems
0032TEST_MAX=False
0033
0034# constraint to be imposed on drawing values of coordinates for positions  and length
0035#of 'infinite' lines in 3d space 
0036MAX=1e+3
0037
0038# constraint to be imposed on drawing values of coordinates for positions  and length
0039#of 'infinite' lines on the complex plane 
0040COMPLEX_MAX=1e+2
0041
0042#toggle for attempt to render POV-RAY scene after export
0043
0044POV_RENDER = True
0045
0046#toggle for attempt to scene POV-RAY scene after display
0047
0048POV_DISPLAY = True
0049
0050#set POV-RAY output image type from POV-RAY's platform dependant options 
0051
0052
0053
0054# defaults for POV-RAY scene defintion file "*.pov" and image files 
0055# override 
0056   # POV_FILES for default output directory for .pov files
0057   # IMAGE_FILES for default output for image files
0058
0059import os
0060import sys
0061
0062if sys.platform == "win32":
0063    import ntpath
0064    BASE_DIR = os.environ['PYTHONPATH']  + 'lib\\site-packages\\pygeo'
0065    exists=ntpath.exists
0066else:
0067    BASE_DIR = os.environ['HOME']
0068    import posixpath
0069    exists = posixpath.exists
0070
0071POV_FILES = BASE_DIR + os.sep + "povout"
0072IMAGE_FILES = BASE_DIR + os.sep + "images"
0073
0074
0075if exists(POV_FILES):
0076   pass
0077else:
0078   os.mkdir(POV_FILES)
0079
0080if exists(IMAGE_FILES):
0081   pass
0082else:
0083   os.mkdir(IMAGE_FILES)
0084
0085
0086#POV_RAY image output fle type
0087#  'S' for platform determined (bmp windows, ppm Linux,etc)
0088# 'P' = PPM
0089# 'C' = Compressed Targa
0090# 'N' = = PNG
0091# T = Uncompresssed Targa
0092
0093POV_IMAGE = "C"