3 This page is in the table of contents.
6 Cura is a AGPL tool chain to generate a GCode path for 3D printing. Older versions of Cura where based on Skeinforge.
7 Versions up from 13.05 are based on a C++ engine called CuraEngine.
9 from __future__ import absolute_import
10 __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
12 from optparse import OptionParser
14 from Cura.util import profile
17 parser = OptionParser(usage="usage: %prog [options] <filename>.stl")
18 parser.add_option("-i", "--ini", action="store", type="string", dest="profileini",
19 help="Load settings from a profile ini file")
20 parser.add_option("-r", "--print", action="store", type="string", dest="printfile",
21 help="Open the printing interface, instead of the normal cura interface.")
22 parser.add_option("-p", "--profile", action="store", type="string", dest="profile",
23 help="Internal option, do not use!")
24 parser.add_option("-s", "--slice", action="store_true", dest="slice",
25 help="Slice the given files instead of opening them in Cura")
26 (options, args) = parser.parse_args()
28 profile.loadPreferences(profile.getPreferencePath())
29 if options.profile is not None:
30 profile.loadProfileFromString(options.profile)
31 elif options.profileini is not None:
32 profile.loadProfile(options.profileini)
34 profile.loadProfile(profile.getDefaultProfilePath())
36 if options.printfile is not None:
37 from Cura.gui import printWindow
38 printWindow.startPrintInterface(options.printfile)
39 elif options.slice is not None:
40 from Cura.util import sliceEngine
41 from Cura.util import objectScene
42 from Cura.util import meshLoader
44 scene = objectScene.Scene()
45 slicer = sliceEngine.Slicer()
46 for m in meshLoader.loadMeshes(args[0]):
48 slicer.runSlicer(scene)
50 from Cura.gui import app
51 app.CuraApp(args).MainLoop()
53 if __name__ == '__main__':