- fixed the Tcl Command Delete to have an argument -f that will force deletion evading the popup (if the popup is enabled). The sme command without a name now will delete all objects

- fixed the Tcl Command JoinExcellons
- fixed the Tcl Command JoinGeometry
- fixed the Tcl Command Mirror
- updated the Tcl Command Mirror to use a (X,Y) origin parameter. Works if the -box parameter is not used.
- updated the Tcl Command Offset. Now it can use only -x or -y parameter no longer is mandatory to have both. The one that is not present will be assumed 0.0
- updated the Tcl Command Panelize. The -rows and -columns parameters are no longer both required. If one is not present then it is assumed to be zero.
- updated the Tcl Command Scale. THe -origin parameter can now be a tuple of (x,y) coordinates.
- updated the Tcl Command Skew. Now it can use only -x or -y parameter no longer is mandatory to have both. The one that is not present will be assumed 0.0
- updated the help for all the Tcl Commands
This commit is contained in:
Marius Stanciu
2020-04-09 04:13:04 +03:00
committed by Marius
parent ecba1a9232
commit 42949021b1
53 changed files with 322 additions and 178 deletions

View File

@@ -17,28 +17,27 @@ class TclCommandSkew(TclCommand):
# Dictionary of types from Tcl command, needs to be ordered
arg_names = collections.OrderedDict([
('name', str),
('angle_x', float),
('angle_y', float)
])
# Dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
option_types = collections.OrderedDict([
('x', float),
('y', float)
])
# array of mandatory options for current Tcl command: required = {'name','outname'}
required = ['name', 'angle_x', 'angle_y']
required = ['name']
# structured help for current command, args needs to be ordered
help = {
'main': "Shear/Skew an object by angles along x and y dimensions. The reference point is the left corner of "
"the bounding box of the object.",
'args': collections.OrderedDict([
('name', 'Name of the object to skew.'),
('angle_x', 'Angle in degrees by which to skew on the X axis.'),
('angle_y', 'Angle in degrees by which to skew on the Y axis.')
('name', 'Name of the object (Gerber, Geometry or Excellon) to be deformed (skewed). Required.'),
('x', 'Angle in degrees by which to skew on the X axis. If it is not used it will be assumed to be 0.0'),
('y', 'Angle in degrees by which to skew on the Y axis. If it is not used it will be assumed to be 0.0')
]),
'examples': ['skew my_geometry 10.2 3.5']
'examples': ['skew my_geometry -x 10.2 -y 3.5', 'skew my_geo -x 3.0']
}
def execute(self, args, unnamed_args):
@@ -50,8 +49,20 @@ class TclCommandSkew(TclCommand):
"""
name = args['name']
angle_x = float(args['angle_x'])
angle_y = float(args['angle_y'])
if 'x' in args:
angle_x = float(args['x'])
else:
angle_x = 0.0
if 'y' in args:
angle_y = float(args['y'])
else:
angle_y = 0.0
if angle_x == 0.0 and angle_y == 0.0:
# nothing to be done
return
obj_to_skew = self.app.collection.get_by_name(name)
xmin, ymin, xmax, ymax = obj_to_skew.bounds()