Skip to content
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

XY Map Generator for irregular matrices #3903

Open
Intrinsically-Sublime opened this issue Apr 15, 2024 · 34 comments
Open

XY Map Generator for irregular matrices #3903

Intrinsically-Sublime opened this issue Apr 15, 2024 · 34 comments
Labels
enhancement keep This issue will never become stale/closed automatically

Comments

@Intrinsically-Sublime
Copy link

Intrinsically-Sublime commented Apr 15, 2024

I have updated my version of Garret Maces FastLED-XY-Map-Generator to output wLED ledmap.json . You can find it here https://intrinsically-sublime.github.io/FastLED-XY-Map-Generator/

I know you do not want this here but I do NOT use discourse or any other forums so it is either share it here or no one ever knows it exists. Feel free to share it, delete, move or do whatever you want with this post.

I have also just added 2d-gaps.json output support.

@blazoncek
Copy link
Collaborator

Thank you! This looks great.

One suggestion: Gap files can have missing and disabled pixels but the applet now only allows selecting either, not both. It would be great if you could accommodate both.

@blazoncek blazoncek added the keep This issue will never become stale/closed automatically label Apr 16, 2024
@willmmiles
Copy link
Contributor

Could we add a link to this project in the mapping page in the documentation?

@Intrinsically-Sublime
Copy link
Author

@blazoncek That thought crossed my mind while making the changes but I figured that was a very niche situation. I figured in those situations you would only have a few of one with possibly lots of the other and one would just manually edit the ones you only have a few of. If I am wrong and it is common to have a mix with lots of each state I could possibly rewrite it to be tri-state but it is currently not that easy (at least to my understanding, I am not a programmer).

@blazoncek
Copy link
Collaborator

I would much like to see a complete solution, not a half baked one no matter how pretty it is or how difficult it is to make it complete. But that's me.

In any case if you share your repository (as opposed to the applet) others can step in and fill your knowledge gaps so everyone (even the niche users) will benefit.

@Intrinsically-Sublime
Copy link
Author

@blazoncek The link to the code is right at the top of the app.

@dosipod
Copy link

dosipod commented Apr 17, 2024

@Intrinsically-Sublime If you are not in discourse or discord then might be just allow the guys to open issues or discussion on your repo to get feedback ( i had some but could only post that in discord for the reason above ) .

@Intrinsically-Sublime
Copy link
Author

@dosipod Feel free to open issue on my repo. I do respond fairly quickly in most cases.

@dosipod
Copy link

dosipod commented Apr 17, 2024

@Intrinsically-Sublime That is what i am telling you , you need to enable issues or discussion on your repo as at the moment that is not possible
image

@Intrinsically-Sublime
Copy link
Author

@dosipod Oops sorry I misunderstood. I have never had to enable issues before. I thought they were always enabled by default. It is enabled now.

@dosipod
Copy link

dosipod commented Apr 18, 2024

@Intrinsically-Sublime Sure i added one and will try to test everything else if this bit is done but I think it is very good as is

@Intrinsically-Sublime
Copy link
Author

@blazoncek I have added the Tri-State 2d-gaps.json support.

@blazoncek
Copy link
Collaborator

With a few cosmetic touch-ups this could now be included within WLED itself in a similar way as custom palettes (by @werkstrom) or PixelMagic (by @ajotanc) are.
Thank you!

@Intrinsically-Sublime
Copy link
Author

Intrinsically-Sublime commented Apr 23, 2024

@blazoncek I could see a striped down version just for gap files being included as you say. If you want I can make a branch with a striped down version.

Also be sure to force a page refresh to make sure you are using the latest css and script as it doesn't always reload. I did try and clean up the layout and instructions a little in the last round of changes.

@blazoncek
Copy link
Collaborator

If you want I can make a branch with a striped down version.

Please do. Thank you!
You can get matrix dimensions from WLED itself.

@Intrinsically-Sublime
Copy link
Author

Intrinsically-Sublime commented Apr 23, 2024

@blazoncek Rather than another branch I created a new repo so I could have a live usable version using github pages.

I have not looked into linking it to WLED yet to get the matrix size.

Here is a 2d-gaps.json only version https://intrinsically-sublime.github.io/WLED-2D-gaps.json-Generator/
The link to the code is now at the bottom of the page.

2d-gaps-mapper_screenshot

Sorry no dark mode. I use Dark Reader plugin in Vivaldi.

@Intrinsically-Sublime
Copy link
Author

I figured while I was at it and the code was fresh in my head I would make the ledmap.json generator standalone too. I will put a link to each one in the original at a later time.

Here is the ledmap.json only version https://github.com/Intrinsically-Sublime/WLED-Ledmap.json-Generator
The link to the code at the bottom of the page.

wled-ledmap-generator_screenshot

@blazoncek
Copy link
Collaborator

Ledmaps can be more tricky as they should allow any kind of wiring (this is the basic idea behind ledmaps).
The best way to create a ledmap would be to allow a user to draw a path (of LEDs) on a matrix. Something like connecting each cell with another using a string.

@Intrinsically-Sublime
Copy link
Author

I understand what you are saying but the tool was written by Garret Mace and modified by me many years ago for FastLED to allow you to map rectangular images onto manually made arrays that are missing LEDs or are partially there in some way. Which is what I modified it to do again recently but for WLED. I do understand in 95% of cases 2d-gaps files are better for this use.

I have put some time into making it possible to do freestyle wiring since that is what I thought was being asked for since that is what the tool is designed for. I just thought people wanted even more freedom to wire strange arrays and I have such a use. But those changes are not live yet.

As for drawing arbitrary paths on a premade panel that is possible but not something I have time to do right now, nor is it something I have a use for. It seems something better done programmatically if the idea is to map 1D effects onto a 2D panel. Then at least you could apply the same logic to a virtual matrix even if it was missing pixels. Like making a 1D effect go in a square spiral on a round display or a round spiral on a square or T shaped display. It seems strange to have to change the ledmap to change an effect.

Anyway I have reverted my FastLED version to Just FastLED and added links to the WLED versions at the top of the tool and in the Readme for the FastLED version.

@blazoncek
Copy link
Collaborator

Do not get me wrong. I appreciate what you have done. I'm just tossing ideas.

@Intrinsically-Sublime
Copy link
Author

Intrinsically-Sublime commented Apr 25, 2024

@blazoncek After cleaning up the code and making them all separate apps it was fairly clear how to do what you wanted. Here is Arbitrary Paths version https://intrinsically-sublime.github.io/WLED-Arbitrary-Path-Ledmap.json-Generator/

WLED-arb-path_screenshot

@dosipod
Copy link

dosipod commented Apr 25, 2024

@Intrinsically-Sublime Finally :) , Spiral mapping example we talked about works now as expected , so reordering of leds is possible and i have been sending the guys your way so might be minor issues could be fixed while you are still fresh on this . One of those minor issues is if you click to correct a square the commas are messed up , There is also one extra comma in the ledmap at the end even in your picture , good work otherwise

image

@blazoncek
Copy link
Collaborator

After cleaning up the code and making them all separate apps it was fairly clear how to do what you wanted. Here is Arbitrary Paths version https://intrinsically-sublime.github.io/WLED-Arbitrary-Path-Ledmap.json-Generator/

I am not sure this produces the correct output though.

What I'd consider correct output is:

{"n":"my_matrix", "width":16, "height":5, "map":[
   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  16,
  -1,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,  -1,  17,
  -1,  34,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  18,
  -1,  33,  32,  32,  30,  29,  28,  27,  26,  25,  24,  23,  22,  21,  20,  19
]}

@Intrinsically-Sublime
Copy link
Author

@blazoncek I would agree but I think for what @dosipod wanted this is correct as they want to map a 1D effect onto a 2D matrix. So the only LEDs that get mapped are the ones clicked so they are used as a 1D strip in that order. Maybe I am still wrong, maybe I am still not getting how this is supposed to work.

For freestyle wiring (which is part of the first ledmap.json generator and not released yet) I then put the -1s in to represent empty pixels in the 2D grid array.

@dosipod I will try and get that figured out hopefully in the next day.

@dosipod
Copy link

dosipod commented Apr 25, 2024

@Intrinsically-Sublime Yes your last changes is what we needed to reorder the leds , otherwise the old versions of the tool is more then enough . I do hope you will keep this version somewhere in case the recording will no longer be possible ( i did fork it now just in case ) .

In all cases might be waiting for the guys to test in practice on real fixtures is better then just talking in theory but give some time for that as I am planning to test it with different fixtures that we wired in multiple ways

@Intrinsically-Sublime
Copy link
Author

@dosipod All the repos will stay up for as long as Github allows. I have some that have been up 12 years already. The changes made are also tracked in the original FastLED repo in separate branches. The changes to make the Arbitrary one from the Ledmap version is tracked in the ledmap version. The only reason I created new repos was to use the Github pages feature to have a live version of each and now those repos track all future changes. A little inconvenient but at least the trail exists.

@Intrinsically-Sublime
Copy link
Author

@dosipod It is fixed. It was just missing a conditional statement.

@dosipod
Copy link

dosipod commented Apr 25, 2024

@Intrinsically-Sublime Looks good now and commas are fixed . I think we are okay with this Arbitrary-Path version for our needs now ( it would takes us now a lot of time to figure out how to use it for more creative ideas as unfortunately we wasted a lot of time on manual mapping with sheets but we will get there ) .

I very much like that you have a link on the top of the page for other version which covers other needs and what blaz asked for ,might be he did not notice that . Have a nice day and thank you for the quick and excellent work

@blazoncek
Copy link
Collaborator

@Intrinsically-Sublime if you want to map arbitrary wired LEDs into a matrix (so that 2D effects will display nicely on them) then you need to follow the example I gave above, you need to fill missing spaces with -1. With it, WLED will be set up in 2D mode and LEDs will behave as part of that particular X & Y coordinate of the matrix.

With current implementation (clicking on a LED to add it to array sequentially) there is no logical connection between LED arrangement and matrix. I am getting the impression that current implementation of the tool will map a 2D panel into a 1D string so WLED can be set as a 1D set-up. This is the opposite of the intent (where you set up WLED as 2D matrix and then you fill that matrix grid with LED indexes).

Both have value, but 1st description (and my example) is what majority of users will want. Discord example was given for glasses (though those can be done using gap file). The 2nd (@dosipod ) is more niche but will allow very unorthodox setups with interesting outcome and for those that do not want to set up WLED as 2D.

In any case this is a very nice tool that will definitely help anyone with irregular matrices.

@Intrinsically-Sublime
Copy link
Author

Intrinsically-Sublime commented Apr 25, 2024

@blazoncek Yes I understand the need for the freestyle wired LEDs and I am working on that one.

The Arbitrary map one is just for stuff like @dosipod wanted to do.

The regular led map version https://github.com/Intrinsically-Sublime/WLED-Ledmap.json-Generator is intended for wiring and will have a freestyle check box fairly soon that will allow freestyle.

@Intrinsically-Sublime
Copy link
Author

I should add that I used the word Arbitrary to separate the two versions. The Arbitrary one really doesn't need to follow any rules, you could go randomly if you wanted.

If there are better names for these I am listening. Right now there are four versions.
WLED 2d-gaps.json generator
WLED ledmap.json generator
WLED Arbitrary path ledmap.json generator
FastLED XY-map generator

They all link to each other at the top of the page and all have repo and issue links at the bottom.

@dosipod
Copy link

dosipod commented Apr 25, 2024

@Intrinsically-Sublime Thank you , I will be waiting to see and do real test with anything you do for the ledmap version and come to think of it yes the use case blaz mentioned is the one that might be mostly used by a lot of the guys . I did get the point initially that you will be adding more flexibility to the tools but honestly not in a position to ask for more now as we are still to test what is done as of now which is a lot .If you are planning to add features and wait for us to catch-up to that and test then please do and as said we will get there at one point

@dosipod
Copy link

dosipod commented Apr 26, 2024

@Intrinsically-Sublime Very hard for me to show demos and info here compared to discord as that a bit easier , still I could dig some of the info we did for one case might be that is good use case on a small scale

wled_s
wled-sv2

For the WLED fixtures we mapped that as a matrix for 2D effects as in the video , I think i also tested that with gapfiles and it worked so maybe we could use that test for all the tools versions if possible to compare as I think we still have the fixture ( or I could quickly build one ) . Otherwise I could see if the other guys with more complex fixture could try the same process but might not get a quick response that way . I am saying that while I have not actually really tested the ledmap or gapfile version so not really sure that is possible or not as is even partially

@Intrinsically-Sublime
Copy link
Author

Okay I have pointed https://github.com/Intrinsically-Sublime/WLED-Ledmap.json-Generator at the freestyle branch which should be the last change I make unless until you find any bugs.

At this point all of them should be ready for testing/use. Please use the issue trackers for each version if you find any problems rather than this thread.

@dosipod
Copy link

dosipod commented Apr 26, 2024

@Intrinsically-Sublime I have tested ledmap version with free style and it does exactly what is expected.
Also sent a small note to the guys so it could be tested along with other versions , we will make demos based on feedback as i expect it to be straight forward to use based on the feed back i got from some of the students
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement keep This issue will never become stale/closed automatically
Projects
None yet
Development

No branches or pull requests

4 participants