This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-28
Channels
- # aleph (7)
- # babashka (13)
- # beginners (10)
- # biff (4)
- # calva (75)
- # cljs-dev (22)
- # clojure (55)
- # clojure-berlin (1)
- # clojure-europe (15)
- # clojure-nl (1)
- # clojure-norway (35)
- # clojure-serbia (1)
- # clojure-uk (2)
- # clojurescript (46)
- # community-development (1)
- # core-async (23)
- # data-science (1)
- # datalevin (2)
- # datascript (10)
- # datomic (11)
- # fulcro (28)
- # helix (12)
- # hyperfiddle (26)
- # introduce-yourself (4)
- # malli (16)
- # off-topic (1)
- # pathom (4)
- # pedestal (1)
- # polylith (12)
- # quil (11)
- # releases (3)
- # scittle (24)
- # shadow-cljs (85)
- # specter (1)
- # sql (9)
- # xtdb (5)
Hi, This code:
(defn petal [[center-x center-y] r angle]
(let [g (q/create-graphics 400 400 :p2d)]
(q/with-graphics g
(q/translate 200 200)
(q/fill 160 20 20)
(q/begin-shape)
(q/bezier -50 -87 -100 -200 0 -180 0 -200)
(q/bezier 50 -87 100 -200 0 -180 0 -200)
(q/triangle -50 -87 0 -200 50 -87)
(q/begin-contour)
(q/arc 0 0 200 200 (* q/PI 1.33) (* q/PI 1.66) :open)
(q/end-contour)
(q/end-shape :close))
(q/image g 0 0)
(swap! shapes assoc :petal g)))
is then used to generate the image below. My question is how can I get rid of those filled arc slices inside the circle?I haven't used Quil in a while but my first thought is that it comes from the triangle, so maybe you can replace it with the contour of the two lines and the arc.
What do you mean by absolute? Do you mean repositioning the applet window? Do you mean position accounting for multiple monitors? Or do you mean something about coordinates within the sketch?
Sorry I missed this, but you can do it calling the processing methods (.setLocation (.getSurface applet) x y)
where applet
is the applet object returned by q/sketch
.
q/sketch
returns a PApplet
https://processing.github.io/processing-javadocs/core/processing/core/PApplet.html, and .getSurface()
returns a https://processing.github.io/processing-javadocs/core/processing/core/PSurface.html which has .setLocation
. Currently this is not exposed as a Quil API call directly.
I believe defsketch creates a named def with the applet, so that's also an option, but perhaps a little trickier as it should probably only be called after creation.