Skip to content

Commit

Permalink
Merge pull request #58 from happysalada/add_rotation_around_row_axis
Browse files Browse the repository at this point in the history
add rotation around row axis
  • Loading branch information
ibnuda authored Oct 10, 2020
2 parents bb0921c + 16f444f commit 7b485f5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions resources/manuform.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ <h3>Curvature & Tenting</h3>
<option value="{{ta}}">pi/{{ta}}</option>
{% endfor %}
</select>
<label for="curve.rotate-x">Rotation around row axis</label>
<select id="curve.rotate-x" name="curve.rotate-x">
{% for ta in rotate-x %}
<option value="-{{ta}}">-pi/{{ta}}</option>
{% endfor %}
</select>
</fieldset>
<label for="connector">
<h3>Connectors</h3>
Expand Down
2 changes: 2 additions & 0 deletions src/dactyl_keyboard/common.clj
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
tenting-angle (get c :configuration-tenting-angle)
switch-type (get c :configuration-switch-type)
keyboard-z-offset (get c :configuration-z-offset)
rotate-x-angle (get c :configuration-rotate-x-angle)
column-angle (* beta (- centercol column))
placed-shape (->> shape
(translate-fn [(offset-for-column c
Expand All @@ -162,6 +163,7 @@
(translate-fn (dm-column-offset c column)))]
(->> placed-shape
(rotate-y-fn tenting-angle)
(rotate-x-fn rotate-x-angle)
(translate-fn [0 0 keyboard-z-offset]))))

(defn rotate-around-x [angle position]
Expand Down
3 changes: 2 additions & 1 deletion src/dactyl_keyboard/generator.clj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
:pinky-alpha (get confs :configuration-pinky-alpha)
:beta (get confs :configuration-beta)
:centercol (get confs :configuration-centercol)
:tenting (get confs :configuration-tenting-angle)}
:tenting (get confs :configuration-tenting-angle)
:rotate-x (get confs :configuration-rotate-x-angle)}
:connector {:external (get confs :configuration-use-external-holder?)
:trrs (get confs :configuration-use-trrs?)
:micro-usb (get confs :configuration-use-promicro-usb-hole?)}
Expand Down
4 changes: 4 additions & 0 deletions src/dactyl_keyboard/handler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
:pinky-column-curvature (range 12 3 -1)
:row-curvature (range 36 17 -1)
:tenting-angle (range 15 5 -1)
:rotate-x (range 36 5 -1)
:thumb-tenting-angle (range 24 15 -1)
:height-offset (range 4 26 2)}))

Expand Down Expand Up @@ -73,6 +74,7 @@
param-beta (parse-int (get p "curve.beta"))
param-centercol (parse-int (get p "curve.centercol"))
param-tenting-angle (parse-int (get p "curve.tenting"))
param-rotate-x-angle (parse-int (get p "curve.rotate-x"))

param-use-external-holder (parse-bool (get p "connector.external"))
param-trrs-connector (parse-bool (get p "connector.trrs"))
Expand Down Expand Up @@ -120,6 +122,7 @@
:configuration-beta (if generate-json? param-beta (/ pi param-beta))
:configuration-centercol param-centercol
:configuration-tenting-angle (if generate-json? param-tenting-angle (/ pi param-tenting-angle))
:configuration-rotate-x-angle (if generate-json? param-rotate-x-angle (/ pi param-rotate-x-angle))
:configuration-plate-projection? generate-plate?

:configuration-use-external-holder? param-use-external-holder
Expand Down Expand Up @@ -270,6 +273,7 @@
:configuration-beta (/ pi (get curve :beta 36))
:configuration-centercol (get curve :centercol 4)
:configuration-tenting-angle (/ pi (get curve :tenting 15))
:configuration-rotate-x-angle (/ pi (get curve :rotate-x 15))

:configuration-use-external-holder? (get connector :external false)
:configuration-use-trrs? (get connector :trrs false)
Expand Down
1 change: 1 addition & 0 deletions src/dactyl_keyboard/manuform.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@
:configuration-beta (/ pi 36)
:configuration-centercol 4
:configuration-tenting-angle (/ pi 12)
:configuration-rotate-x (/ pi 36)

:configuration-use-promicro-usb-hole? false
:configuration-use-trrs? false
Expand Down

0 comments on commit 7b485f5

Please sign in to comment.