[3D] Added option to enable the colored R cache
This commit is contained in:
parent
92b7206eff
commit
786c94a80c
|
|
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- `colored_tht_resistors` to disable the 3D colored resistors.
|
- `colored_tht_resistors` to disable the 3D colored resistors.
|
||||||
- `field_tolerance` field/s to look for resistor tolerance.
|
- `field_tolerance` field/s to look for resistor tolerance.
|
||||||
- `default_resistor_tolerance` which tolerance to use when none found.
|
- `default_resistor_tolerance` which tolerance to use when none found.
|
||||||
|
- `cache_3d_resistors` to avoid generating them all the time.
|
||||||
- 3D: colored 3D models for THT resistors
|
- 3D: colored 3D models for THT resistors
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
||||||
|
|
@ -274,6 +274,9 @@ class Globals(FiltersOptions):
|
||||||
""" When no tolerance is specified we use this value.
|
""" When no tolerance is specified we use this value.
|
||||||
Note that I know 5% is a common default, but technically speaking 20% is the default.
|
Note that I know 5% is a common default, but technically speaking 20% is the default.
|
||||||
Used while creating colored resistors """
|
Used while creating colored resistors """
|
||||||
|
self.cache_3d_resistors = False
|
||||||
|
""" Use a cache for the generated 3D models of colored resistors.
|
||||||
|
Will save time, but you could need to remove the cache if you need to regenerate them """
|
||||||
self.set_doc('filters', " [list(dict)] KiBot warnings to be ignored ")
|
self.set_doc('filters', " [list(dict)] KiBot warnings to be ignored ")
|
||||||
self._filter_what = 'KiBot warnings'
|
self._filter_what = 'KiBot warnings'
|
||||||
self.filters = FilterOptionsKiBot
|
self.filters = FilterOptionsKiBot
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ class GS(object):
|
||||||
def_global_output = '%f-%i%I%v.%x'
|
def_global_output = '%f-%i%I%v.%x'
|
||||||
# The class that controls the global options
|
# The class that controls the global options
|
||||||
class_for_global_opts = None
|
class_for_global_opts = None
|
||||||
|
global_cache_3d_resistors = None
|
||||||
global_castellated_pads = None
|
global_castellated_pads = None
|
||||||
global_colored_tht_resistors = None
|
global_colored_tht_resistors = None
|
||||||
global_copper_thickness = None
|
global_copper_thickness = None
|
||||||
|
|
|
||||||
|
|
@ -405,7 +405,7 @@ class Base3DOptions(VariantOptions):
|
||||||
self.widths = self.widths[:-2]
|
self.widths = self.widths[:-2]
|
||||||
# Create the name in the cache
|
# Create the name in the cache
|
||||||
cache_name = self.colored_tht_resistor_name(name, bars)
|
cache_name = self.colored_tht_resistor_name(name, bars)
|
||||||
if os.path.isfile(cache_name):
|
if os.path.isfile(cache_name) and GS.global_cache_3d_resistors:
|
||||||
status = 'cached'
|
status = 'cached'
|
||||||
else:
|
else:
|
||||||
status = 'created'
|
status = 'created'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue