case updates
This commit is contained in:
@@ -44,10 +44,15 @@ module FeatherCaseWizard
|
||||
"battery_radial_clearance" => 0.6,
|
||||
"battery_end_clearance" => 1.0,
|
||||
"battery_partition_thickness" => 1.8,
|
||||
"battery_board_clearance" => 3.0,
|
||||
"rocker_cutout_size" => [12.9, 19.4],
|
||||
"rocker_corner_radius" => 0.8,
|
||||
"rocker_body_size" => [15.0, 21.0, 21.0],
|
||||
"rocker_artwork_gap" => 2.0,
|
||||
"rocker_partition_offset" => 2.0,
|
||||
"rocker_tab_panel_thickness" => 2.0,
|
||||
"rocker_tab_land" => 2.0,
|
||||
"rocker_tab_taper_length" => 0.6,
|
||||
"tripod_insert_enabled" => false,
|
||||
"tripod_insert_length" => 5.0,
|
||||
"tripod_insert_hole_diameter" => 7.2,
|
||||
@@ -89,10 +94,10 @@ module FeatherCaseWizard
|
||||
"lid_label_size" => 5.0,
|
||||
"lid_label_logo_gap" => 2.0,
|
||||
"lid_art_margin" => 8.5,
|
||||
"usb_opening_width" => 12.5,
|
||||
"usb_opening_height" => 7.0,
|
||||
"usb_opening_width" => 13.5,
|
||||
"usb_opening_height" => 8.0,
|
||||
"usb_opening_radius" => 1.5,
|
||||
"usb_vertical_offset" => 0.0
|
||||
"usb_vertical_offset" => 0.5
|
||||
}.freeze
|
||||
|
||||
ADVANCED_FIELDS = {
|
||||
@@ -115,8 +120,12 @@ module FeatherCaseWizard
|
||||
tripod_thread_clearance_diameter tripod_boss_diameter],
|
||||
"Battery and switch" => %w[battery_length battery_diameter battery_radial_clearance
|
||||
battery_end_clearance battery_partition_thickness
|
||||
battery_board_clearance
|
||||
rocker_cutout_size rocker_corner_radius
|
||||
rocker_body_size rocker_artwork_gap],
|
||||
rocker_body_size rocker_artwork_gap
|
||||
rocker_partition_offset
|
||||
rocker_tab_panel_thickness rocker_tab_land
|
||||
rocker_tab_taper_length],
|
||||
"USB-C opening" => %w[usb_opening_width usb_opening_height
|
||||
usb_opening_radius usb_vertical_offset usb_connector_overhang
|
||||
usb_guide_wall_thickness usb_guide_end_gap],
|
||||
@@ -223,7 +232,7 @@ module FeatherCaseWizard
|
||||
plain_width = board_origin_y + 22.86 + p["board_side_clearance"] +
|
||||
p["wall_thickness"]
|
||||
if p["battery_enabled"]
|
||||
partition_y = board_origin_y + 22.86 + 1
|
||||
partition_y = board_origin_y + 22.86 + p["battery_board_clearance"]
|
||||
battery_y = partition_y + p["battery_partition_thickness"] +
|
||||
p["battery_radial_clearance"] + p["battery_diameter"] / 2
|
||||
lid_boss_wall_overlap = 0.6
|
||||
@@ -325,6 +334,11 @@ module FeatherCaseWizard
|
||||
parameters["wall_thickness"] < 1.2
|
||||
raise ConfigError, "battery_partition_thickness must be at least 1.2 mm" if
|
||||
parameters["battery_partition_thickness"] < 1.2
|
||||
raise ConfigError, "rocker_tab_panel_thickness must be at least 1.2 mm" if
|
||||
parameters["rocker_tab_panel_thickness"] < 1.2
|
||||
if parameters["rocker_tab_panel_thickness"] >= parameters["lid_thickness"]
|
||||
raise ConfigError, "rocker_tab_panel_thickness must be less than lid_thickness"
|
||||
end
|
||||
raise ConfigError, "lid_lip_thickness must be at least 1.2 mm" if
|
||||
parameters["lid_lip_thickness"] < 1.2
|
||||
raise ConfigError, "lid_inlay_depth must be less than lid_thickness" if
|
||||
@@ -338,6 +352,7 @@ module FeatherCaseWizard
|
||||
"tripod_insert_outer_diameter must not be smaller than the pilot"
|
||||
end
|
||||
|
||||
validate_usb_opening!
|
||||
validate_cutouts!
|
||||
self
|
||||
end
|
||||
@@ -402,6 +417,19 @@ module FeatherCaseWizard
|
||||
validate_cutout_spacing!(bounds, dims)
|
||||
end
|
||||
|
||||
def validate_usb_opening!
|
||||
return unless parameters["usb_opening_enabled"]
|
||||
|
||||
dims = dimensions
|
||||
bounds = usb_wall_bounds(dims)
|
||||
if bounds["bottom"] < dims["floor"]
|
||||
raise ConfigError, "USB opening or guide intersects the case floor"
|
||||
end
|
||||
if bounds["top"] > dims["lip_bottom"]
|
||||
raise ConfigError, "USB opening or guide intersects the lid lip"
|
||||
end
|
||||
end
|
||||
|
||||
def validate_cutout_spacing!(bounds, dims)
|
||||
web = parameters["cutout_min_web"]
|
||||
bounds.combination(2) do |first, second|
|
||||
|
||||
@@ -225,7 +225,7 @@ module FeatherCaseWizard
|
||||
plate, and slicing settings in Bambu Studio.
|
||||
#{artwork}
|
||||
MARKDOWN
|
||||
File.write(stage.join("README.md"), text)
|
||||
File.write(stage.join("README.md"), text.rstrip + "\n")
|
||||
end
|
||||
|
||||
def install_atomically(stage, destination)
|
||||
|
||||
Reference in New Issue
Block a user