Housing with Screen slide

master
Ryan Rix 2015-09-01 05:31:17 +00:00
parent e760824bcb
commit 1ef27417db
3 changed files with 54 additions and 27 deletions

View File

@ -25,6 +25,7 @@
(def main-body-height 30)
(def main-body-width 200)
(def tent-angle (/ pi 9))
(def main-body-depth 160)
;; Screen constants
(def screen-width 228)

View File

@ -2,42 +2,60 @@
(:use [scad-clj.scad])
(:use [scad-clj.model])
(:use [ergodox-laptop.constants])
(:require [ergodox-laptop.ergodox :as ergodox]))
(:require [ergodox-laptop.ergodox :as ergodox]
[ergodox-laptop.screen :as brace]))
(def angle-slice
(translate [0 0 (* -1.5 main-body-height)]
(difference
(translate [0 0 -10]
(cube main-body-width
ergodox-body-depth
main-body-depth
80))
(translate [0 0 -50]
(rotate tent-angle [0 1 0]
(cube (+ 100 main-body-width)
(+ 2 ergodox-body-depth)
(+ 2 main-body-depth)
80))))))
(def housing
(difference
(translate [(/ (- main-body-width
ergodox-body-width) 2) 0 0]
(cube main-body-width
ergodox-body-depth
main-body-height)
angle-slice)
(translate [-40 -55 38]
ergodox/left-ergodox)))
(defn housing [with-dox]
(let [txfn (if with-dox
union
difference)]
(txfn
(translate [(/ (- main-body-width
ergodox-body-width) 2)
(/ (- main-body-depth
ergodox-body-depth) -2)
0]
(cube main-body-width
main-body-depth
main-body-height)
angle-slice)
(translate [-40 55 38]
(rotate pi [0 0 1]
ergodox/right-ergodox)))))
(def full-housing
(defn full-housing [with-dox]
(union
housing
(housing with-dox)
(translate [200 0 -73]
(mirror [1 0 0]
(rotate (* 2 tent-angle) [0 -1 0]
housing)))))
(housing with-dox))))))
(def hollow-housing
(difference
full-housing
(translate [10 -10 -5]
(scale [0.9 1.1 0.9]
full-housing))))
(rotate tent-angle [0 -1 0]
(difference
(full-housing false)
(translate [10 -10 -5]
(scale [0.9 1.1 0.9]
(full-housing false))))))
(def housing-with-base
(union hollow-housing
(translate [105 -10 0]
brace/brace)))
(spit "resources/screen-brace.scad"
(write-scad ergodox-laptop.housing/housing-with-base))

View File

@ -12,9 +12,14 @@
(translate [(/ screen-width 2)
(/ (- screen-height brace-length) 2)
0]
(cube (+ 2 screen-thickness)
brace-length
(+ 2 screen-thickness))))
(union
(cube (+ 2 screen-thickness)
brace-length
(+ 2 screen-thickness))
(translate [0 0 (/ 40 -2)]
(cube (+ 2 screen-thickness)
brace-length
40)))))
(def brace-back
(translate [0 (/ screen-height 2) 0]
@ -24,6 +29,12 @@
(def brace
(union
;; screen
;; brace-side
;; brace-back
;; (mirror [1 0 0]
;; brace-side)
(difference brace-side
screen)
(difference brace-back
@ -31,6 +42,3 @@
(difference (mirror [1 0 0]
brace-side)
screen)))
(spit "resources/screen-brace.scad"
(write-scad ergodox-laptop.screen/brace))