- added the outname parameter for the geocutout Tcl command
This commit is contained in:
parent
45a2890850
commit
5dcddb168e
|
@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
13.04.2020
|
||||||
|
|
||||||
|
- added the outname parameter for the geocutout Tcl command
|
||||||
|
|
||||||
11.04.2020
|
11.04.2020
|
||||||
|
|
||||||
- fixed issue #394 - the saveDialog in Linux did not added the selected extension
|
- fixed issue #394 - the saveDialog in Linux did not added the selected extension
|
||||||
|
|
|
@ -35,7 +35,8 @@ class TclCommandGeoCutout(TclCommandSignaled):
|
||||||
('dia', float),
|
('dia', float),
|
||||||
('margin', float),
|
('margin', float),
|
||||||
('gapsize', float),
|
('gapsize', float),
|
||||||
('gaps', str)
|
('gaps', str),
|
||||||
|
('outname', str)
|
||||||
])
|
])
|
||||||
|
|
||||||
# array of mandatory options for current Tcl command: required = {'name','outname'}
|
# array of mandatory options for current Tcl command: required = {'name','outname'}
|
||||||
|
@ -50,7 +51,8 @@ class TclCommandGeoCutout(TclCommandSignaled):
|
||||||
('margin', 'Margin over bounds.'),
|
('margin', 'Margin over bounds.'),
|
||||||
('gapsize', 'size of gap.'),
|
('gapsize', 'size of gap.'),
|
||||||
('gaps', "type of gaps. Can be: 'tb' = top-bottom, 'lr' = left-right, '2tb' = 2top-2bottom, "
|
('gaps', "type of gaps. Can be: 'tb' = top-bottom, 'lr' = left-right, '2tb' = 2top-2bottom, "
|
||||||
"'2lr' = 2left-2right, '4' = 4 cuts, '8' = 8 cuts")
|
"'2lr' = 2left-2right, '4' = 4 cuts, '8' = 8 cuts"),
|
||||||
|
('outname', 'Name of the resulting Geometry object.'),
|
||||||
]),
|
]),
|
||||||
'examples': [" #isolate margin for example from Fritzing arduino shield or any svg etc\n" +
|
'examples': [" #isolate margin for example from Fritzing arduino shield or any svg etc\n" +
|
||||||
" isolate BCu_margin -dia 3 -overlap 1\n" +
|
" isolate BCu_margin -dia 3 -overlap 1\n" +
|
||||||
|
@ -62,7 +64,7 @@ class TclCommandGeoCutout(TclCommandSignaled):
|
||||||
" delete BCu_margin_iso\n" +
|
" delete BCu_margin_iso\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
" #finally cut holding gaps\n" +
|
" #finally cut holding gaps\n" +
|
||||||
" geocutout BCu_margin_iso_exterior -dia 3 -gapsize 0.6 -gaps 4\n"]
|
" geocutout BCu_margin_iso_exterior -dia 3 -gapsize 0.6 -gaps 4 -outname cutout_geo\n"]
|
||||||
}
|
}
|
||||||
|
|
||||||
flat_geometry = []
|
flat_geometry = []
|
||||||
|
@ -156,6 +158,11 @@ class TclCommandGeoCutout(TclCommandSignaled):
|
||||||
else:
|
else:
|
||||||
gapsize = 0.1
|
gapsize = 0.1
|
||||||
|
|
||||||
|
if 'outname' in args:
|
||||||
|
outname = args['outname']
|
||||||
|
else:
|
||||||
|
outname = str(name) + "_cutout"
|
||||||
|
|
||||||
# Get source object.
|
# Get source object.
|
||||||
try:
|
try:
|
||||||
cutout_obj = self.app.collection.get_by_name(str(name))
|
cutout_obj = self.app.collection.get_by_name(str(name))
|
||||||
|
@ -283,7 +290,6 @@ class TclCommandGeoCutout(TclCommandSignaled):
|
||||||
|
|
||||||
app_obj.inform.emit("[success] Any-form Cutout operation finished.")
|
app_obj.inform.emit("[success] Any-form Cutout operation finished.")
|
||||||
|
|
||||||
outname = cutout_obj.options["name"] + "_cutout"
|
|
||||||
self.app.new_object('geometry', outname, geo_init, plot=False)
|
self.app.new_object('geometry', outname, geo_init, plot=False)
|
||||||
|
|
||||||
# cutout_obj.plot()
|
# cutout_obj.plot()
|
||||||
|
@ -342,7 +348,6 @@ class TclCommandGeoCutout(TclCommandSignaled):
|
||||||
geo_obj.options['ymax'] = cutout_obj.options['ymax']
|
geo_obj.options['ymax'] = cutout_obj.options['ymax']
|
||||||
app_obj.inform.emit("[success] Any-form Cutout operation finished.")
|
app_obj.inform.emit("[success] Any-form Cutout operation finished.")
|
||||||
|
|
||||||
outname = cutout_obj.options["name"] + "_cutout"
|
|
||||||
self.app.new_object('geometry', outname, geo_init, plot=False)
|
self.app.new_object('geometry', outname, geo_init, plot=False)
|
||||||
|
|
||||||
cutout_obj = self.app.collection.get_by_name(outname)
|
cutout_obj = self.app.collection.get_by_name(outname)
|
||||||
|
|
Loading…
Reference in New Issue