Skip to content

Instantly share code, notes, and snippets.

@nariakiiwatani
Created July 3, 2020 06:55
Show Gist options
  • Save nariakiiwatani/be358839059b0133637a1a30aaea17c1 to your computer and use it in GitHub Desktop.
Save nariakiiwatani/be358839059b0133637a1a30aaea17c1 to your computer and use it in GitHub Desktop.
(import "https://raw.githubusercontent.com/nariakiiwatani/My-GLISP-Snippets/master/arcjoined.cljs")
(import "https://raw.githubusercontent.com/nariakiiwatani/My-GLISP-Snippets/master/ik-nodes.glisp")
:start-sketch
(style (stroke "salmon" 10)
(map (fn [[a b]] (let [
center (vec2/scale (vec2/+ a b) 0.5)
sub (vec2/- b a)
angle (vec2/angle sub)
rx (* (vec2/len sub) 0.75)
ry (* rx 0.5)
]
(path (path/transform (translate center)
(path/transform (rotate angle)
(ellipse [0 0] [rx ry]))))))
(make-chain
(ik-nodes [0 0] [99.99999999999984 (deg -120.89093964455368)] [90.00000000000037 (deg -34.45036128774326)] [80.00000000000074 (deg 44.30550659877391)] [59.999999999999964 (deg 99.10803350402044)] [50.00000000000004 (deg 151.5104215007508)] [29.999999999999023 (deg 153.36449149847155)])
2 1))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment