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