Created class ObjectCollection to manage the list of objects in the program. Converted the program to use it. Not fully functional yet.
This commit is contained in:
26
camlib.py
26
camlib.py
@@ -2251,16 +2251,35 @@ class CNCjob(Geometry):
|
||||
self.create_geometry()
|
||||
|
||||
|
||||
def get_bounds(geometry_set):
|
||||
# def get_bounds(geometry_set):
|
||||
# xmin = Inf
|
||||
# ymin = Inf
|
||||
# xmax = -Inf
|
||||
# ymax = -Inf
|
||||
#
|
||||
# #print "Getting bounds of:", str(geometry_set)
|
||||
# for gs in geometry_set:
|
||||
# try:
|
||||
# gxmin, gymin, gxmax, gymax = geometry_set[gs].bounds()
|
||||
# xmin = min([xmin, gxmin])
|
||||
# ymin = min([ymin, gymin])
|
||||
# xmax = max([xmax, gxmax])
|
||||
# ymax = max([ymax, gymax])
|
||||
# except:
|
||||
# print "DEV WARNING: Tried to get bounds of empty geometry."
|
||||
#
|
||||
# return [xmin, ymin, xmax, ymax]
|
||||
|
||||
def get_bounds(geometry_list):
|
||||
xmin = Inf
|
||||
ymin = Inf
|
||||
xmax = -Inf
|
||||
ymax = -Inf
|
||||
|
||||
#print "Getting bounds of:", str(geometry_set)
|
||||
for gs in geometry_set:
|
||||
for gs in geometry_list:
|
||||
try:
|
||||
gxmin, gymin, gxmax, gymax = geometry_set[gs].bounds()
|
||||
gxmin, gymin, gxmax, gymax = gs.bounds()
|
||||
xmin = min([xmin, gxmin])
|
||||
ymin = min([ymin, gymin])
|
||||
xmax = max([xmax, gxmax])
|
||||
@@ -2270,7 +2289,6 @@ def get_bounds(geometry_set):
|
||||
|
||||
return [xmin, ymin, xmax, ymax]
|
||||
|
||||
|
||||
def arc(center, radius, start, stop, direction, steps_per_circ):
|
||||
"""
|
||||
Creates a list of point along the specified arc.
|
||||
|
||||
Reference in New Issue
Block a user