CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
442 stars 28 forks source link

Option for no overlap of fill and stroke #40

Closed tatyanade closed 4 years ago

tatyanade commented 4 years ago

Is there a way to eliminate overlap of stroke and fill on a singular shape from a bitmap? This is achievable with shapes through culling:

E.beginCull();

  E.noStroke();
  E.fill(0,0,0);
  E.circle(100, 100, 100); 

  E.noFill();
  E.stroke(255, 255, 0); // yellow stroke
  E.circle(100, 100, 100); 

  E.endCull();

(culling v not culling)

2020-06-19_20h47_472020-06-19_20h48_14

but does not work with images

E.beginCull();

  E.noStroke();
  E.fill(0,0,0);
  E.image(myImage, 0, 0); 

  E.noFill();
  E.stroke(255, 255, 0); // yellow stroke
  E.image(myImage, 0, 0); 
  E.endCull();

2020-06-19_20h49_05

Might be usefull and more legible to have something like 'E.Fill_Stroke_Overlap(false); ' to call function instead of making multiple instances of the same element

golanlevin commented 4 years ago

@LingDong- , could you look at this please? Is culling is behaving differently for images?

LingDong- commented 4 years ago

@golanlevin @tatyanade I forgot to increment cullGroup in image(). Now fixed: a0c6bb6887593ba0bd647f487e53a6e74972ce80

golanlevin commented 4 years ago

@tatyanade Please test?

tatyanade commented 4 years ago

image P_cull

golanlevin commented 4 years ago

Looks good.