Inkscape.org
Embroidery and InkStitch Meandering patterns
  1. #1
    zourid zourid @zourid
    *

    It is possible to have user-defined meandering patterns for fill stitching like the smooth one on the left rather than the sharp ones (middle) currently included? 

    Increasing the smoothness parameter does not help much (right). 

     

    Meander
    Meander Copy
    Meander Copy 2
  2. #2
    Lazur Lazur @Lazur

    Can try with the L-systems extension to render a Hilbert curve or a Peano curve.

    https://bentrubewriter.com/2012/04/26/fractals-you-can-draw-the-hilbert-curve-or-what-the-labyrinth-really-looked-like/

    or just use an existing svg:

    https://en.m.wikipedia.org/wiki/File:Peanocurve.svg

     

  3. #3
    zourid zourid @zourid
    *

    These are fantastic patterns.

    But how do you use them with the Ink/Stitch extension as a fill stitch pattern of an arbitrary object like a leaf as you would use the default meander option (see attached)?

    And how can you generate such a smooth curve to start with using the L-system?

    Screen Shot 2023 10 03 At 8.58.21 Pm
  4. #4
    Lazur Lazur @Lazur

    I don't know yet how to plot such a pattern in inkscape within a custom shape.

    Don't know if that's even mathematically possible properly-this page suggests it's not:

    https://mathtician.weebly.com/space-filling-curves.html

    I suspect if the shape can be broken down into square and triangle-like sections that are connected,

    each can have their own space filling curves defined and those may be connected together.

    So it would be like creating a 3D mesh covering the shape with a topology that has a Hamilton-path amongst the faces.

     https://en.wikipedia.org/wiki/Hamiltonian_path

    Optimising a mesh into quads and tris is already possible automatically:

    https://exoside.com/quadremesher/

     

    Not exactly meandering but a Brownian motion is somewhat similar which can probably fill any space in a "proportionally random" nature.

    https://en.wikipedia.org/wiki/Brownian_motion

    Random walk is the related term, which can be plotted with python in a more straightforward way. 

    https://medium.com/analytics-vidhya/simulating-random-walk-in-python-ed95bfb55210

     

    The most commonly suggested option is the hatches (rough) path effect, which also has its limitations.

     

    Anyway think I misunderstood your initial question. 

    If you can plot the pattern in the second image, try the corners path effect,

    then maybe stack a spiro spline path effect atop of it.

    If still not smooth enough, convert object to path and change all nodes to smooth.

    There is still a chance some nodes would need manual adjustments -needs some experimenting.

     

     

  5. #5
    claudine.peyrat claudine.peyrat @claudine.peyrat
    *

    You could try this :
    1- use  N6-2 or  hexagonal treillis as meander pattern

    2- create a stitch plan preview

    3 move the meandering path  from  stitch preview layer to  your "normal" layer. Run parameters  and change method from manual path  to  running stitches.
    4 select all nodes and turn  them into smooth nodes (alternatively add  a simplify path effect to the path increasing the number of repetitions).




     

    Test
  6. #6
    claudine.peyrat claudine.peyrat @claudine.peyrat
    🔥*

    Another option  is to use https://www.finitecurve.com/
     

    Select the fill that you want to meander fill
    Export it as a png
    Upload this png file on https://www.finitecurve.com/ , chose the resolution

    Download the resulting svg
     

     

    Finitecurve(1)
  7. #7
    zourid zourid @zourid
    *

    Thank you @claudine, these suggestions are great! I especially love the finitecurve.com tool.

    I was wondering though if it were possible to include some user defined patterns — I noticed that the Ink/stitch.app under Contents/Resources includes several tiles (including the hexagon and the N6-2 you suggested) but I don't know how I could add my own tile or replace an existing one. If I knew how to do it I would not mind putting the time.

     

     

  8. #8
    claudine.peyrat claudine.peyrat @claudine.peyrat

    There is no easy way for the user to include defined patterns.
    You probably could add a tile, but If you do look into the Resources, you can see that each tile is 3 files. The preview is an approximation of what you will get, the json is  some  text data, the important file is the svg one, as it is the one used to actually compute the meander fill. As far as i understand it the svg file contains a rectangle (the red stuff) and several straight lines. Basically  whatever is in the red rectangle  is tiled to fill the shape, and then the algorithm first find a path from the starting point of the fill to the ending point of the fill using the straight lines of the tiling. Then it   randomly choses edges  or consecutive edges and replace them by longer paths, eventually finding a very long path.
    You can see that there is actual randomness in the meandering filling by  rolling the dice to change the seed in the params widow.

    So it is maybe not as easy as you think (in particular because all the lines of the tiles must be straight) and i'm sure that the developpers tried a lot of tiles.

    My understanding is that commercial embroidery tools use a very different algorithm based on peano curve or other space filling curves, the result being much less random.