chiark / gitweb /
Added dae support which can be exported from google sketchup.
[cura.git] / Cura / cura.py
1 #!/usr/bin/python
2 """
3 This page is in the table of contents.
4 ==Overview==
5 ===Introduction===
6 Cura is a GPL tool chain to forge a gcode skein for a model. Based on Skeinforge.
7
8 The slicing code is the same as Skeinforge. But the UI has been revamped to be... sane.
9
10 """
11 from __future__ import absolute_import
12 import __init__
13
14 import sys
15 import platform
16 from optparse import OptionParser
17
18 from util import profile
19
20 __author__ = 'Daid'
21 __credits__ = """
22 David Braam (daid303@gmail.com)
23 Enrique Perez (perez_enrique@yahoo.com)
24 Adrian Bowyer <http://forums.reprap.org/profile.php?12,13>
25 Brendan Erwin <http://forums.reprap.org/profile.php?12,217>
26 Greenarrow <http://forums.reprap.org/profile.php?12,81>
27 Ian England <http://forums.reprap.org/profile.php?12,192>
28 John Gilmore <http://forums.reprap.org/profile.php?12,364>
29 Jonwise <http://forums.reprap.org/profile.php?12,716>
30 Kyle Corbitt <http://forums.reprap.org/profile.php?12,90>
31 Michael Duffin <http://forums.reprap.org/profile.php?12,930>
32 Marius Kintel <http://reprap.soup.io/>
33 Nophead <http://www.blogger.com/profile/12801535866788103677>
34 PJR <http://forums.reprap.org/profile.php?12,757>
35 Reece.Arnott <http://forums.reprap.org/profile.php?12,152>
36 Wade <http://forums.reprap.org/profile.php?12,489>
37 Xsainnz <http://forums.reprap.org/profile.php?12,563>
38 Zach Hoeken <http://blog.zachhoeken.com/>
39
40 Organizations:
41 Ultimaker <http://www.ultimaker.com>
42 Art of Illusion <http://www.artofillusion.org/>"""
43
44 __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
45
46 def main():
47         parser = OptionParser(usage="usage: %prog [options] <filename>.stl")
48         parser.add_option("-i", "--ini", action="store", type="string", dest="profileini", help="Load settings from a profile ini file")
49         parser.add_option("-P", "--project", action="store_true", dest="openprojectplanner", help="Open the project planner")
50         parser.add_option("-F", "--flat", action="store_true", dest="openflatslicer", help="Open the 2D SVG slicer (unfinished)")
51         parser.add_option("-r", "--print", action="store", type="string", dest="printfile", help="Open the printing interface, instead of the normal cura interface.")
52         parser.add_option("-p", "--profile", action="store", type="string", dest="profile", help="Internal option, do not use!")
53         parser.add_option("-s", "--slice", action="store_true", dest="slice", help="Slice the given files instead of opening them in Cura")
54         (options, args) = parser.parse_args()
55         if options.profile != None:
56                 profile.loadGlobalProfileFromString(options.profile)
57         if options.profileini != None:
58                 profile.loadGlobalProfile(options.profileini)
59         if options.openprojectplanner != None:
60                 from gui import projectPlanner
61                 projectPlanner.main()
62                 return
63         if options.openflatslicer != None:
64                 from gui import flatSlicerWindow
65                 flatSlicerWindow.main()
66                 return
67         if options.printfile != None:
68                 from gui import printWindow
69                 printWindow.startPrintInterface(options.printfile)
70                 return
71
72         if options.slice != None:
73                 from util import sliceRun
74                 sliceRun.runSlice(args)
75         else:
76                 if len(args) > 0:
77                         profile.putPreference('lastFile', ';'.join(args))
78                 from gui import splashScreen
79                 splashScreen.showSplash(mainWindowRunCallback)
80
81 def mainWindowRunCallback():
82         from gui import mainWindow
83         mainWindow.main()
84
85 if __name__ == '__main__':
86         main()
87