Changed default name for step files (adds -3D)
This commit is contained in:
parent
031c69e27c
commit
9d10c991da
|
|
@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- drill maps: uses drill instead of drl
|
- drill maps: uses drill instead of drl
|
||||||
- dril: uses drill instead of drl, used in gbr and drl.
|
- dril: uses drill instead of drl, used in gbr and drl.
|
||||||
- position: no -pos in CSVs
|
- position: no -pos in CSVs
|
||||||
|
- step: adds -3D
|
||||||
|
|
||||||
## [0.5.0] - 2020-07-11
|
## [0.5.0] - 2020-07-11
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ class STEPOptions(BaseOptions):
|
||||||
""" used to exclude 3D models for components with 'virtual' attribute """
|
""" used to exclude 3D models for components with 'virtual' attribute """
|
||||||
self.min_distance = -1
|
self.min_distance = -1
|
||||||
""" the minimum distance between points to treat them as separate ones (-1 is KiCad default: 0.01 mm) """
|
""" the minimum distance between points to treat them as separate ones (-1 is KiCad default: 0.01 mm) """
|
||||||
self.output = ''
|
self.output = '%f-%i.%x'
|
||||||
""" name for the generated STEP file (the name of the PCB if empty) """ # pragma: no cover
|
""" name for the generated STEP file (%i='3D' %x='step') """ # pragma: no cover
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def origin(self):
|
def origin(self):
|
||||||
|
|
@ -40,10 +40,7 @@ class STEPOptions(BaseOptions):
|
||||||
|
|
||||||
def run(self, output_dir, board):
|
def run(self, output_dir, board):
|
||||||
# Output file name
|
# Output file name
|
||||||
output = self.output
|
output = self.expand_filename(output_dir, self.output, '3D', 'step')
|
||||||
if not output:
|
|
||||||
output = os.path.splitext(os.path.basename(GS.pcb_file))[0]+'.step'
|
|
||||||
output = os.path.abspath(os.path.join(output_dir, output))
|
|
||||||
# Make units explicit
|
# Make units explicit
|
||||||
if self.metric_units:
|
if self.metric_units:
|
||||||
units = 'mm'
|
units = 'mm'
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ def test_step_1():
|
||||||
ctx = context.TestContext('STEP_1', prj, 'step_simple', STEP_DIR)
|
ctx = context.TestContext('STEP_1', prj, 'step_simple', STEP_DIR)
|
||||||
ctx.run()
|
ctx.run()
|
||||||
# Check all outputs are there
|
# Check all outputs are there
|
||||||
ctx.expect_out_file(os.path.join(STEP_DIR, prj+'.step'))
|
ctx.expect_out_file(os.path.join(STEP_DIR, prj+'-3D.step'))
|
||||||
ctx.clean_up()
|
ctx.clean_up()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -36,7 +36,7 @@ def test_step_2():
|
||||||
ctx = context.TestContext('STEP_2', prj, 'step_simple_2', STEP_DIR)
|
ctx = context.TestContext('STEP_2', prj, 'step_simple_2', STEP_DIR)
|
||||||
ctx.run()
|
ctx.run()
|
||||||
# Check all outputs are there
|
# Check all outputs are there
|
||||||
ctx.expect_out_file(os.path.join(STEP_DIR, prj+'.step'))
|
ctx.expect_out_file(os.path.join(STEP_DIR, prj+'-3D.step'))
|
||||||
ctx.clean_up()
|
ctx.clean_up()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,4 +11,4 @@ outputs:
|
||||||
origin: grid # "grid" or "drill" o "X,Y" i.e. 3.2,-10
|
origin: grid # "grid" or "drill" o "X,Y" i.e. 3.2,-10
|
||||||
no_virtual: true # exclude 3D models for components with 'virtual' attribute
|
no_virtual: true # exclude 3D models for components with 'virtual' attribute
|
||||||
min_distance: 0.0004 # Minimum distance between points to treat them as separate ones (default 0.01 mm)
|
min_distance: 0.0004 # Minimum distance between points to treat them as separate ones (default 0.01 mm)
|
||||||
#output: project.step
|
output: '%f.%x'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue