from pycam.Geometry import *
from pycam.Cutters.SphericalCutter import *
from pycam.Cutters.CylindricalCutter import *
from pycam.Cutters.ToroidalCutter import *

from pycam.Gui.Visualization import ShowTestScene

from pycam.Importers import STLImporter

from pycam.PathGenerators.PushCutter import PushCutter
from pycam.PathProcessors import *
from pycam.Exporters.SimpleGCodeExporter import SimpleGCodeExporter

if __name__ == "__main__":

    c = SphericalCutter(0.1, Point(0, 0, 7))
    # c = CylindricalCutter(1, Point(0,0,7))
    # c = ToroidalCutter(1, 0.25, Point(0,0,7))
    print "c=", c

    # model = TestModel()
    # model = STLImporter.ImportModel("Samples/STL/Box0.stl")
    # model = STLImporter.ImportModel("Samples/STL/Box1.stl")
    model = STLImporter.ImportModel("Samples/STL/Box0+1.stl")
    # model = Model()
    # model.append(Triangle(Point(0,0,0),Point(0,5,4),Point(0,-5,4)))
    # model.append(Triangle(Point(2,0,0),Point(2,-5,4),Point(2,5,4)))

    if True:
        lines = 20
        layers = 4
"""

import sys
sys.path.insert(0,'.')

import math

from pycam.Geometry import *
from pycam.Cutters.SphericalCutter import *

from pycam.Gui.Visualization import ShowTestScene

if __name__ == "__main__":

    if False:
        cutter = SphericalCutter(1, Point(-10,0.5,0))
        edge = Line(Point(0,0,-10),Point(0,0,10))
        dir = Point(1,0,0)
        print "cutter=", cutter
        print "edge=", edge
        print "dir=", dir
        (cl,ccp,cp,d) = cutter.intersect_sphere_line(dir, edge)
        print "cp=", cp
        print "ccp=", ccp
        print "d=", d
        print "cl=", cl
        exit()

    if False:
        cutter = SphericalCutter(1, Point(-10,0,0))
        edge = Line(Point(0,-5,1),Point(3,+5,1))