CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
442 stars 28 forks source link

Errors rendering image contours with thin strokes #31

Closed golanlevin closed 4 years ago

golanlevin commented 4 years ago

This bug report concerns the Example, PEmbroider_bitmap_image_2, which is tracing the Processing.org logo.

Things look fine with E.strokeWeight(2); E.strokeMode(PEmbroiderGraphics.TANGENT);:

Screen Shot 2020-06-17 at 11 48 14 PM

However, there is a strange error with E.strokeWeight(2); E.strokeMode(PEmbroiderGraphics.PERPENDICULAR);:

Screen Shot 2020-06-17 at 11 48 32 PM

And with E.strokeWeight(1); E.strokeMode(PEmbroiderGraphics.TANGENT);, one of the shapes is omitted altogether:

Screen Shot 2020-06-17 at 11 49 14 PM
LingDong- commented 4 years ago

@golanlevin All fixed: 199b106835f75880c5400f4e57654f26a76e02c7

Strokes below length of 2 were discarded by my quality control algorithm. That's why some of the short strokes when strokeWeight=2 are classified as garbage and removed. Special case now added.

My TSP sometimes skips the trivial case of 2 total polylines, which is the reason for the missing half of "P". (Not actually related to computation of strokes). Special case now added

golanlevin commented 4 years ago

Thanks!