Skip to content

I want to operate"division" between two shapes, & the result to have to have one path in color and one path transparent? #104

Answered by spakin
MarySofy asked this question in Q&A
Discussion options

You must be logged in to vote

zip is a perfectly reasonable approach. To produce a transparent object you can specify its color as none, as in the following code:

c1 = circle((60, 60), 50, fill='magenta', stroke_width=4).to_path()
c2 = circle((90, 60), 50, fill='cyan', stroke_width=4).to_path()
color_list = ['red', 'none']
objs = apply_path_operation('division', [c1, c2])
for o, color in zip(objs, color_list):
    o.style(fill=color)

Does that do what you want?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MarySofy
Comment options

Answer selected by MarySofy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants