Cleaned out the tests folder. Added simple test gerber. Added simple unit test using the GUI.

This commit is contained in:
Juan Pablo Caram
2015-10-27 21:27:27 -04:00
parent 45c7f8efab
commit 95f51b2870
11 changed files with 96 additions and 20 deletions

37
tests/other/test_fcrts.py Normal file
View File

@@ -0,0 +1,37 @@
from camlib import *
from shapely.geometry import LineString, LinearRing
s = FlatCAMRTreeStorage()
geoms = [
LinearRing(((0.5699056603773586, 0.7216037735849057),
(0.9885849056603774, 0.7216037735849057),
(0.9885849056603774, 0.6689622641509434),
(0.5699056603773586, 0.6689622641509434),
(0.5699056603773586, 0.7216037735849057))),
LineString(((0.8684952830188680, 0.6952830188679245),
(0.8680655198743615, 0.6865349890935113),
(0.8667803692948564, 0.6778712076279851),
(0.8646522079829676, 0.6693751114229638),
(0.8645044888670096, 0.6689622641509434))),
LineString(((0.9874952830188680, 0.6952830188679245),
(0.9864925023483531, 0.6748709493942936),
(0.9856160316877274, 0.6689622641509434))),
]
for geo in geoms:
s.insert(geo)
current_pt = (0, 0)
pt, geo = s.nearest(current_pt)
while geo is not None:
print pt, geo
print "OBJECTS BEFORE:", s.objects
#geo.coords = list(geo.coords[::-1])
s.remove(geo)
print "OBJECTS AFTER:", s.objects
current_pt = geo.coords[-1]
pt, geo = s.nearest(current_pt)