-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No clip paths? #337
Comments
There is basic clipping, not documented yet. For basic clipping, everything outside the set_default_graphic_size(7inch,3.5inch)
points(x::Compose.Form) = x.primitives[1].points
X = rand(10,2)
colv = HSVA.(range(0,stop=180,length=10), 1, 1, 0.5)
img = compose(context(units=UnitBox(0,0,2,1)), stroke("black"),
(context(), rectangle(), fill(nothing)),
(context(), ngon([0.5,1.5],[0.5], [0.4], [10]), fill(nothing), stroke("lightgray")),
(context(), xgon(X[:,1],X[:,2],[0.2],[4]), fill(colv)),
(context(), xgon(X[:,1].+1,X[:,2],[0.2],[4]), fill(colv),
clip(points(ngon(1.5,0.5, 0.4, 10))) )
)
draw(PNG(), img)
# draw(SVG(), img) Your hypothetical example of a crescent moon is interesting because that would involve inner clipping i.e. everything inside the inner circle (or shape) is clipped out. Pasting a white circle would have the same effect (but don't know if that's suitable): img = compose(context(),
(context(), circle([0.5,0.35], [0.5], [0.25,0.3]), fill(["gold","white"]))
) |
It would be awesome to have this make it into the docs, looks great @Mattriks |
I can't find documentation on clipping paths, like making a half moon by subtracting a circle from another circle. Is this not possible in compose.jl?
The text was updated successfully, but these errors were encountered: