CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
442 stars 28 forks source link

Spiraling #37

Closed tatyanade closed 4 years ago

tatyanade commented 4 years ago

When I call E.setStitch(10,30,0); E.hatchMode(SPIRAL); E.hatchSpacing(8); E.rect(350, 350, 100, 100);

image

With the inner corners becoming slanted instead of keeping the shape at right angles

a lot less noticable with a stitch length of 40, but you can see it a bit towards the center image

Also spiraling for circles gets a bit funky depending on stitch length ; this is circle with E.setStitch(10,40,0) 2020-06-19_18h53_57

verses E.setStitch(10,30,0), both with hatch spacing of 4. 2020-06-19_18h55_26

smaller stitch length looks better but im not sure why there would only be one inconsistently lengthen stitch with length 40

I think the circle spiral issue is not as much of a concern (or possibly not a concern at all, easy for the user to fix on their own) but for rectangle spiraling I think special attention should be payed to the inner corners guaranteeing a stitch point at least for more noticeable (non-central) corners

LingDong- commented 4 years ago

Yes. Spiralling works by interpolating concentric rings, so corners might get interpolated. One way to alleviate this I can think of right now, is to oversample the concentric rings, interpolate into spiral, then downsample while keeping the corners. Will investigate, thanks for raising this

tatyanade commented 4 years ago

Screenshot 2020-06-19 at 9 49 35 PM Here's what it looks like printed (the first image of circle and first square); their smaller than an inch so its not really that noticeable in reality but is a bit more noticeable in the center

golanlevin commented 4 years ago

Yes, @LingDong- , it would be better if the resampling and interpolation here did a better job preserving corners. To be clear, I'm not concerned about the diagonals on the inside (marked #1 in the image below), I'm very concerned about the snipped corners (marked #2):

85184383-a9e0b500-b25d-11ea-9382-4ffdd844f041

LingDong- commented 4 years ago

@golanlevin yes I think the diagonals are inevitable -- if all sides are straight, there won't be a spiral. But I'll look into the corners

LingDong- commented 4 years ago

Fixed spiral corners by oversampling 100x (was 2x): 946609f67f4c91cf0557491494fedf6f9d10da8b

golanlevin commented 4 years ago

OK!