From 2d879477469eff308ba827374d57e66582f759a4 Mon Sep 17 00:00:00 2001 From: Sam Ritchie Date: Fri, 30 Jun 2023 07:52:46 -0600 Subject: [PATCH] fix polar --- dev/mathbox/examples/test/polar.clj | 77 +++++++++++++++-------------- src/deps.cljs | 2 +- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/dev/mathbox/examples/test/polar.clj b/dev/mathbox/examples/test/polar.clj index 47aac20..2622490 100644 --- a/dev/mathbox/examples/test/polar.clj +++ b/dev/mathbox/examples/test/polar.clj @@ -21,12 +21,13 @@ {:transform-fn clerk/mark-presented :render-fn '(fn [{:keys [offset]}] - [mathbox/MathBox {:style {:height "400px" :width "100%"} - :init {:background-color 0xffffff - :focus 3}} - [box/Camera {:proxy true - :position [0 0 3]}] - [box/Polar + [mathbox.core/MathBox + {:container {:style {:height "400px" :width "100%"}} + :renderer {:background-color 0xffffff} + :focus 3} + [mathbox.primitives/Camera {:proxy true + :position [0 0 3]}] + [mathbox.primitives/Polar {:bend 1 :range [[(* -2 Math/PI) (* 2 Math/PI)] [0 1] @@ -34,45 +35,45 @@ :scale [2 1 1] :helix 0.1} ;; radius axis with ticks. - [box/Transform {:position [0 0.5 0]} - [box/Axis {:detail 256}] - [box/Scale {:divide 10 :unit Math/PI :base 2}] - [box/Ticks {:width 2 - :classes ["foo", "bar"]}] - [box/Ticks {:opacity 0.5 - :width 1 - :size 50 - :normal [0 1 0] - :classes ["foo", "bar"]}]] + [mathbox.primitives/Transform {:position [0 0.5 0]} + [mathbox.primitives/Axis {:detail 256}] + [mathbox.primitives/Scale {:divide 10 :unit Math/PI :base 2}] + [mathbox.primitives/Ticks {:width 2 + :classes ["foo", "bar"]}] + [mathbox.primitives/Ticks {:opacity 0.5 + :width 1 + :size 50 + :normal [0 1 0] + :classes ["foo", "bar"]}]] ;; The polar axes. - [box/Axis {:axis 2}] - [box/Transform {:position [(/ Math/PI 2) 0 0]} - [box/Axis {:axis 2}]] - [box/Transform {:position [(- (/ Math/PI 2)) 0 0]} - [box/Axis {:axis 2}]] + [mathbox.primitives/Axis {:axis 2}] + [mathbox.primitives/Transform {:position [(/ Math/PI 2) 0 0]} + [mathbox.primitives/Axis {:axis 2}]] + [mathbox.primitives/Transform {:position [(- (/ Math/PI 2)) 0 0]} + [mathbox.primitives/Axis {:axis 2}]] ;; This is the opaque surface where the grid lives. - [box/Area {:width 256 - :height 2}] - [box/Surface {:color "#fff" - :opacity 0.75 - :zBias -10}] + [mathbox.primitives/Area {:width 256 + :height 2}] + [mathbox.primitives/Surface {:color "#fff" + :opacity 0.75 + :zBias -10}] ;; This puts the grid on, but the opaque surface is already there. - [box/Grid {:divideX 5 - :detailX 256 - :width 1 - :opacity 0.5 - :unitX Math/PI - :baseX 2 - :zBias -5 - :zOrder -2}] + [mathbox.primitives/Grid {:divideX 5 + :detailX 256 + :width 1 + :opacity 0.5 + :unitX Math/PI + :baseX 2 + :zBias -5 + :zOrder -2}] ;; The function. - [box/Interval + [mathbox.primitives/Interval {:width 256 :expr (fn [emit theta _i t] @@ -81,7 +82,7 @@ (* 3 (+ theta t)))))] (emit theta r))) :channels 2}] - [box/Line {:points "<" - :color 0x3090ff - :width 5}]]])}} + [mathbox.primitives/Line {:points "<" + :color 0x3090ff + :width 5}]]])}} {:offset 0.5} diff --git a/src/deps.cljs b/src/deps.cljs index ab012b4..9034a11 100644 --- a/src/deps.cljs +++ b/src/deps.cljs @@ -2,4 +2,4 @@ {"mathbox-react" "^0.2.2" "mathbox" "^2.3.1" "threestrap" "0.5.1" - "three" ">= 0.118.0 || <= 0.150.0"}} + "three" "<=0.150.0"}}