Example #1
0
PyCAM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PyCAM.  If not, see <http://www.gnu.org/licenses/>.
"""

from pycam.Geometry.TriangleKdtree import BuildKdtree2d, GetKdtree2dStats, ResetKdtree2dStats, \
        SearchKdtree2d
from pycam.Importers.TestModel import TestModel

print("# get model")
testmodel = TestModel()
print("# subdivide")
model = testmodel.subdivide(5)
print("# build kdtree")
kdtree = BuildKdtree2d(model.triangles(), 2, 0.1)
print("# kdtree=", kdtree)

x = 2
y = 2
r = 0.1

minx = x - r
miny = y - r
maxx = x + r
maxy = y + r
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PyCAM.  If not, see <http://www.gnu.org/licenses/>.
"""

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

from pycam.Geometry.TriangleKdtree import *
from pycam.Geometry.Model import Model
from pycam.Importers.TestModel import TestModel

print "# get model"
testmodel = TestModel()
print "# subdivide"
model = testmodel.subdivide(5)
print "# build kdtree"
kdtree = BuildKdtree2d(model.triangles(), 2, 0.1)
#print "#kdtree=",kdtree

x = 2
y = 2
r = 0.1

minx = x-r
miny = y-r
maxx = x+r
maxy = y+r
Example #3
0
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PyCAM.  If not, see <http://www.gnu.org/licenses/>.
"""

import OpenGL.GL as GL

from pycam.Gui.Visualization import Visualization
from pycam.Simulation.ZBuffer import ZBuffer
from pycam.Importers.TestModel import TestModel
from pycam.Geometry.Point import Point
from pycam.Cutters.SphericalCutter import SphericalCutter

model = TestModel()

zbuffer = ZBuffer(-5, +5, 150, -5, +5, 150, 1, 5)

# zbuffer.add_wave()

# zbuffer.add_triangle(Triangle(Point(-4, 0, 0), Point(3, 5, 2), Point(4, -3, 4)))

c = SphericalCutter(0.25)

p = Point(-5, -5, 2)
c.moveto(p)

zbuffer.add_triangles(model.triangles())

# zbuffer.add_cutter(c)
Example #4
0
This file is part of PyCAM.

PyCAM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

PyCAM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PyCAM.  If not, see <http://www.gnu.org/licenses/>.
"""

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

from pycam.Gui.Visualization import Visualization
from pycam.Importers.TestModel import TestModel

model = TestModel()


def DrawScene():
    model.to_OpenGL()


Visualization("VisualizationTest", DrawScene)
Example #5
0
along with PyCAM.  If not, see <http://www.gnu.org/licenses/>.
"""

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

from pycam.Gui.Visualization import Visualization
from pycam.Simulation.ZBuffer import ZBuffer
from pycam.Importers.TestModel import TestModel
from pycam.Geometry.Triangle import Triangle
from pycam.Geometry.Point import Point
from pycam.Cutters.SphericalCutter import SphericalCutter

from OpenGL.GL import *

model = TestModel()

zbuffer = ZBuffer(-5,+5,150, -5,+5,150, 1,5)

#zbuffer.add_wave()

#zbuffer.add_triangle(Triangle(Point(-4,0,0),Point(3,5,2),Point(4,-3,4)))

c = SphericalCutter(0.25)

p = Point(-5,-5,2)
c.moveto(p)

zbuffer.add_triangles(model.triangles())

#zbuffer.add_cutter(c)