Setting :bowl-radii to nil results in a NullPointerException
NicolaiOksen opened this issue · 1 comments
Hi Viktor :)
I'm trying to generate key caps without a bowl, however when I set :bowl-radii
to nil
, it throws an exception in Java runtime.
I've tried both :bowl-radii [nil nil nil]
and :bowl-radii nil
.
I set the value in models.clj
I'm using lein run -- --render
to get a single keycap without a legend.
This is my enrich-options
:
(defn- enrich-options
"Take merged global-default and explicit user arguments. Merge these further
with defaults that depend on other options."
[{:keys [switch-type style] :as explicit}]
(merge {:top-size [nil nil 1]
:top-rotation [0 0 0]
:skirt-length (measure/default-skirt-length switch-type)
:stem-fn stem-model
:importable-filepath-fn to-filepath
:support-fn support-model}
(case style
:maquette {:body-fn maquette-body
:stem-fn (constantly nil)
:support-fn (constantly nil)}
:minimal {:top-size [9 9 1]
:bowl-radii [0 0 0]
:body-fn minimal-body
:shell-sequence-fn minimal-shell-sequences
:skirt-perimeter-fn minimal-skirt-perimeter})
explicit))
What am I doing wrong?
Hi Nicolai!
Please excuse my slow response; I was out of town. As I am sure you suspected, there was a bug in the program: a regression from earlier refactoring. I have now released a version 0.5.1 (f382af1) that can produce a flat top.
The correct usage is (now) :bowl-radii nil
. If you want to try it from the CLI, it’s --bowl-radii 'nil nil nil'
; I have attempted to clarify this rather poor interface in the readme.