Skip to content

Instantly share code, notes, and snippets.

@sylefeb
Created June 18, 2023 10:09
Show Gist options
  • Select an option

  • Save sylefeb/ebc1aca2107aa7b1859e9dfd216cd56d to your computer and use it in GitHub Desktop.

Select an option

Save sylefeb/ebc1aca2107aa7b1859e9dfd216cd56d to your computer and use it in GitHub Desktop.
-- fridge carriage and rail
-- @sylefeb 2023-06-17
-- MIT License
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
-- main dimensions
rail_width = 28
rail_center_width = 11
rail_len = 130
rail_thickness = 2
rail_center_height = 5.4
rail_tolerance = 0.75
rail_radius = 3
bore_head_th = 2.6
bore_small_in_radius = 4.6
bore_small_len = 7
bore_large_in_radius = 9
bore_large_len = 12
carriage_width = rail_width + 7
carriage_len = 30
carriage_side = 28
carriage_side_th = 6
-- -------------------------
-- rail
-- -------------------------
rail = union{
cube(rail_width,rail_len,rail_thickness),
cube(rail_center_width,rail_len,rail_center_height),
difference{
cube(rail_center_width+2*rail_radius,rail_len,rail_thickness+rail_radius),
translate((-rail_center_width)/2-rail_radius,0,rail_thickness+rail_radius)*rotate(90,0,0)*ccylinder(rail_radius,rail_len),
translate(( rail_center_width)/2+rail_radius,0,rail_thickness+rail_radius)*rotate(90,0,0)*ccylinder(rail_radius,rail_len),
}
}
rail_diff = translate(0,0,-rail_tolerance/2)*union{
cube(rail_width+rail_tolerance,rail_len,rail_thickness+rail_tolerance),
cube(rail_center_width+rail_tolerance+rail_radius,rail_len,rail_center_height+rail_tolerance),
}
-- -------------------------
-- bore
-- -------------------------
bore = rotate(0,0,90)*
union{
union{
translate(0,-(bore_small_len-bore_small_in_radius)/2,0)
*cylinder(bore_small_in_radius/2,rail_center_height*1.5),
translate(0, (bore_small_len-bore_small_in_radius)/2,0)
*cylinder(bore_small_in_radius/2,rail_center_height*1.5),
cube(bore_small_in_radius,(bore_small_len-bore_small_in_radius),rail_center_height*1.5)
},
union{
translate(0,-(bore_large_len-bore_large_in_radius)/2,0)
*cylinder(bore_large_in_radius/2,bore_head_th),
translate(0, (bore_large_len-bore_large_in_radius)/2,0)
*cylinder(bore_large_in_radius/2,bore_head_th),
cube(9,(bore_large_len-bore_large_in_radius),bore_head_th)
},
translate(0,-(bore_large_len-bore_large_in_radius)/2,bore_head_th)
*cone(bore_large_in_radius/2,bore_small_in_radius/2,1),
translate(0, (bore_large_len-bore_large_in_radius)/2,bore_head_th)
*cone(bore_large_in_radius/2,bore_small_in_radius/2,1),
}
--emit(bore)
bore_pos = 10.5 + -rail_len/2+rail_radius
bores = union{
translate(0,bore_pos,0)*bore,
translate(0,bore_pos+11.5,0)*bore,
translate(0,bore_pos+11.5*2,0)*bore
}
--emit(bores)
rail = difference(rail,bores)
emit(translate(0,0,rail_len/2)*rotate(90,0,0)*rail)
-- -------------------------
-- carriage
-- -------------------------
carriage =
difference{
translate(0,carriage_side/2-rail_center_height,0) * difference{
cube(carriage_width,carriage_side,carriage_len),
translate(0,rail_center_height+rail_thickness,carriage_side_th)*cube(carriage_width,carriage_side,carriage_len),
},
translate(0,0,rail_len/2)*rotate(90,0,0)*rail_diff,
-- bores
translate(-19.5/2,carriage_side-14,-1)*rotate(0,0,90)*bore,
translate( 19.5/2,carriage_side-14,-1)*rotate(0,0,90)*bore
}
emit(carriage)
@sylefeb
Copy link
Author

sylefeb commented Jun 18, 2023

Repair for a fridge rail (between fridge door and exterior panel).
Use with IceSL: https://icesl.loria.fr/download/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment