Skip to content

Satins - extra parameters vs Grouping (beta4.2.7) #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Neon22 opened this issue Dec 18, 2024 · 8 comments
Open

Satins - extra parameters vs Grouping (beta4.2.7) #215

Neon22 opened this issue Dec 18, 2024 · 8 comments

Comments

@Neon22
Copy link

Neon22 commented Dec 18, 2024

I did the following in an attempt to make a Satin generator that would create a balanced satin (suitable for some kinds of weaving), and its inverse so that floats are minimised when using them both in a pattern.
Satins-5_3 groupedd-beta

You can see that several transformations are needed to create the balanced satin and its inverse.
I considered if there was a grouping element then you could box these into a single Satin box that would have three possible outputs.
Here simulated using the V1 interface:
Satins-5_3 grouped

However the shift will be different for each of the satins (although it can be calculated)
Here we can see that a 5_2 satin has an added weft shift of 1 - so we can't simply copy a parameter between ops.
Satins-5_2 balanced

This perhaps argues for a dedicated Satin generator with special internal code (so the added weftshift doesn't have to be adjusted everytime you change the Satin shift value). Smaller on-screen as well.
Note that satins of 4,6 are sometimes referred to as Irregular Satins but they are really broken twills. However leaving them in "Satins" does simplify how to think about it.

Perhaps this would also have a shaded output for the weft/warp density increases, or a special shaded operator (I see a similar op in v1) which would also work for twills (also frequently used for shading), and maybe a general case solution to support other weave structures.

@Devendork
Copy link
Member

This is interesting. I have imagined some kind of grouping feature but haven't gotten there yet. I do like your sketch and how you are thinking about it. Do you have a text reference I might be able to refer to on creating well structured inverse satins?

@Neon22
Copy link
Author

Neon22 commented Dec 28, 2024

I have taken the opportunity afforded by this discussion to muck about with a Satin generator.
Creates regular and irregular satins for a given dimension.
I'll also work out the adjustments to make balanced ones.
Should be able to give you the algorithm (python) or at the very least, a list of all values to look up.

Here's an experiment using the balanced satin and inverse for nicely controlled floats.
v4 2 6 skull satin5_3 balanced

Also seems like a mod of your satin-shading generator could make shadings of an input and then end up with a sequence of N patterns representing increasing/decreasing density. This could make a good input to an image_map variant that took a grayscale shaded image and mapped the patterns on basis of an error diffusion algorithm. Could make nice results. Here's a thing on error diffusion - https://tannerhelland.com/2012/12/28/dithering-eleven-algorithms-source-code.html

Could also try making a twill shading or a general shading variant for any arbitrary weave.
I'll keep you posted. Happy Christmas

@Neon22
Copy link
Author

Neon22 commented Dec 28, 2024

satin refs. I dig around in here mostly:

@Neon22
Copy link
Author

Neon22 commented Jan 1, 2025

OK. Got most of it working pretty well:

  • enter size and regular or irregular.
  • if regular - get the step back and all the tileable offsets (Hmmm. something not quite right here)
  • if irregular - get back a list of them all (heaps)
    So going to have to do the irregulars as a live calc. Regulars could be looked up for speed

There's a tiling error. Looking into it. More soon.

So far:
Irregular Satins:
3=1,
4=6,
6=6,
7=42,
8=352,
9=3102,
10=29924,
11=315854,
12=3628904
Need to calc everything on the fly above 7

Regular Satins:
5=2 [5_2 (3), 5_3 (1)] ,
7=4 [7_2 (3,4,5), 7_3 (1,4,5), 7_4 (1,5), 7_5 (1,2,3)],
8=2 [8_3 (1,4,5,6) 8_5 (1,2,3,6)],
9=4 [9_2 (3,4,5,6,7), 9_4 (1,2,5,6,7),
9_5 (1,2,3,6,7), 9_7 (1,2,3,4,5)],
10=2 [10_3 (1,4,5,6,7,8), 10_7 (1,2,3,4,5,8)],
11=8 [11_2 (3,4,5,6,7,8,9), 11_3 (1,4,5,6,7,8,9), 11_4 (1,2,5,6,7,8,9),
11_5 (1,2,3,6,7,8,9), 11_6 (1,2,3,4,7,8,9), 11_7 (1,2,3,4,5,8,9),
11_8 (1,2,3,4,5,6,9), 11_9 (1,2,3,4,5,6,7)],
12=2 [12_5 (1,2,3,6,7,8,9,10), 12_7 (1,2,3,4,5,8,9,10)],
13=10

Might not need to calc regulars on the fly but tiling not always mirroring... yet...

@Neon22
Copy link
Author

Neon22 commented Jan 12, 2025

OK there is no algorithm which will generate an inverse for a given balanced satin by any combination of shifting/rotating/flipping/inverting of the balanced satin. There are shortcuts for small satins.

There may also be several solutions to the balanced inverse as the satin gets larger (more internal possibilities for satin swaps not located on edges).
Gets pretty big in terms of numbers.

However not difficult to filter on basis of desired points.
Working on it.

@Neon22
Copy link
Author

Neon22 commented Jan 28, 2025

This is interesting. I have imagined some kind of grouping feature but haven't gotten there yet. I do like your sketch and how you are thinking about it.

I was playing some more and thought of what a shading operator might look like.
You already have a kind of encapsulation which I was thinking of. You can see it in the "Generate floorloom..." tool here:

Image

So one or more inputs and one or more outputs.
Anyway here's a mockup of a shading kind of tool:

Image

The point being make all the shades possible then allow users to connect the ones they want to use.
This specific operator would produce a different number of outputs on the basis of the input pattern and the technique for shading selected. (Left, right, up, down, box, random, ...)

Satins coming soon

@Neon22
Copy link
Author

Neon22 commented Mar 1, 2025

OK. Here's the progress so far:

This is ALL the satins :)

It turns out I can set this up (without the UI) as a pyscript "Donkey". What this means is that you can call it from javascript as a worker and get back whatever computations you need.
So no need to rewrite any of this in Javascript.
So you can:

  • ask for regular, irregular satins for any square size. E.g. size 7 satins regular only.
    • you get back a list of the satins in a simple list format
  • ask for shifted or inverted versions of those satins
  • ask if a certain pattern is centered or not (reflection of itself)
  • ask for the shifts required (x,y) for a satin so you get a balanced satin back (one pick on each edge, none on the corners).
    • get a list of all possible offsets for that satin which will be balanced (no dups)
  • given a balanced satin, find all possible satins that will make clean cuts when placed alongside inverted
    • return those as a list with the offsets to make them balanced and in correct pos for clean cuts

Works for all satins but it needs another worker if you go above 10 in Irregular satins - working on that (> 30,000 results)

Anyway - have a look and see if you want me to continue to massage it into shape for use by AdaCAD.
(Got a bit of refactoring to do but basically its done)

Please check your email spam filter for emails from me about this. Would be easier to communicate more directly.

@Neon22
Copy link
Author

Neon22 commented Mar 20, 2025

Satin Generator is here with ADACad export option:

  • https://neon22.pyscriptapps.com/satin-generator/latest/
  • Given a size, and regular and/or irregular checkboxes - will generate ALL the available satins
  • Has a heatmap to show the user available satin spots for any given size (hard to describe - take a look)
  • Once selected - will show all of the balanced versions if possible and
  • all suitable cleancut inverses of that pattern. For user selection.
  • The resulting two patterns (and their inverses) are useful for making "minimal float" Satin image maps or patterns.

Exports to WIF or ADACad's .ada file formats.

Working on making the core code available as a Javascript worker so it might be integrated into ADACad.
However the UI is not going to be migratable.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants