Giter Club home page Giter Club logo

Comments (12)

LingDong- avatar LingDong- commented on May 24, 2024 1

Hi @tatyanade , there's no need to call it, theoretically it is already turned on for all strokes in TANGENT mode (not for CONCENTRIC fill yet, because the implementation is a bit different)

See the heart in PEmbroider_bitmap_image_1 example

from pembroider.

LingDong- avatar LingDong- commented on May 24, 2024 1

Hi @golanlevin

Now concentric fill is also given the staggering. I noticed your muybridge demo's concentric fill looks very aligned so I added that :)

There's now an option called CONCENTRIC_ANTIALIGN. When set to 0, no staggering will be done. When set to a positive float, it will be treated as angle in radians (θ in image below), turnings that are steeper than this will be kept. Default is 0.6 ≈ 35°

            C
           /
          /
         / θ
A-------B. . . . . . . . . . . . . . . . 

from pembroider.

LingDong- avatar LingDong- commented on May 24, 2024

Hi @golanlevin

🤔. One way I can think of is to use take the midpoint of each segment of every other polyline and connect them. The downside is that the strokes will no longer be concentric and will have intersections and there will be problems at sharper corners. But judging from the "fluffy" look in the photo, seems like people won't be able to tell :P

IMG_0922

I think main reason the stitches in the photograph look very aligned is that the stitch length is long compared to the length of the segment in the polyline. If we draw a larger shape with smaller stitch length, only the ones at end points of segments will be aligned, and all the other points that come from resampling will be randomized and not aligned.

From issue #17, looks like we'll drastically increase the size of everything? Perhaps by increasing the ratio of unit per pixel? Wondering if that would solve this issue automatically?

from pembroider.

golanlevin avatar golanlevin commented on May 24, 2024

Hi @LingDong- , I'd rather use a proper geometric solution than rely on getting lucky with scaling effects. Why can't we just slide the "start point" of even-numbered contours forward by half a stitch length, and then resample the contour from there? (While possibly retaining points of very high curvature.)

from pembroider.

LingDong- avatar LingDong- commented on May 24, 2024

Hi @golanlevin , that's what I was trying to describe in the first paragraph (and the illustration). However I was saying half segment length instead of half stitch length to maximize the offset (like we did with the parallel stitch resampling)


It's not "getting lucky with scaling" though. It's simply the resolution of the polyline is higher than that of the stitches, which will be definitely solved by increasing the scale.

IMG_0923

from pembroider.

LingDong- avatar LingDong- commented on May 24, 2024

Screen Shot 2020-06-15 at 7 23 39 PM

corner-aware half-segment-length staggering added in a2df276

from pembroider.

golanlevin avatar golanlevin commented on May 24, 2024

Magnificent — thank you, Lingdong. @tatyanade , please test?

from pembroider.

tatyanade avatar tatyanade commented on May 24, 2024

Hi @LingDong- I'm confused as to how to call this, I see the edits to the strokePolyTangentRaster but am not sure how to call it so it uses the staggering

from pembroider.

tatyanade avatar tatyanade commented on May 24, 2024

Tested with spacings of 1,2,3,4,5

tangent_spacing_1_bmpheartimage

PEmbroider_bitmap_heart_tangent_spacing2 2020-06-16_16h57_07

Had some weird issues with spacing of 3; you can see in the png render there are a lot of stitches in the center of the crack, which piles up in real life.

PEmbroider_bitmap_heart_tangent_spacing3 image image

PEmbroider_bitmap_heart_tangent_spacing4 image

tangent_spacing_5_bmpheart 2020-06-16_16h58_57

Did the same test with a different heart & it gets a bit crowded in the center of the crack near sharper corners but not as much as spacing3 on the original image does
image
difheart
image

from pembroider.

golanlevin avatar golanlevin commented on May 24, 2024

@tatyanade , those long straight stitches on the left side of the heart — I assume you're aware that you can adjust those with the setStitch() function, any reason you made them so long?

In general, do you think the staggered stitches for TANGENT strokes are working well?

The pile-up on my broken heart could reasonably be considered a fault of my design — or do you disagree with that?

from pembroider.

LingDong- avatar LingDong- commented on May 24, 2024

@tatyanade @golanlevin oops, the really long stitches is likely due to my enabling of toggleResample(false) in PEmbroider_bitmap_image_1 to test/showcase the new staggering algorithm

from pembroider.

tatyanade avatar tatyanade commented on May 24, 2024

Hi @LingDong-
Staggering gets eliminated at some point when two shapes are culled - visable in lower part of circles on the left - both are parallel hatch with hatch spacing of 2 and second one is sapcing of 4
2020-06-23_00h55_19
2020-06-23_00h55_00

from pembroider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.