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

Documentation of freespace.py #46

Open
osmithy opened this issue Jun 9, 2018 · 2 comments
Open

Documentation of freespace.py #46

osmithy opened this issue Jun 9, 2018 · 2 comments

Comments

@osmithy
Copy link

osmithy commented Jun 9, 2018

The example suggests starting with the freespace layout, which works, but I have no idea how to change the layout because the code in freespace.py has no comments that explain what it does. Any chance you could add a few?

@willisk-main
Copy link

Hey Osmithy, we had trouble with the how the points were mapped also. From messing around with freespace.py it looks like the coordinates for the line

"point" ( 0, 0, 0,)

Map to the colored axis (red, green, blue) on the visual interface.

It's still not completely clear what inputs OPC will recognize for shapes though but from looking at the provided files it looks like "point" and "circle" are used.

Hope that helps.

@longears
Copy link
Collaborator

longears commented Jul 8, 2018

A layout file is a list of points in 3d space, in json, representing each LED. The numbers are x, y, z coordinates. The order of points should be the same order they occur on your LED string.

  {"point": [1.32, 0.00, 1.32]},
  {"point": [1.32, 0.00, 1.21]},
  {"point": [1.32, 0.00, 1.10]},

This format is not part of the OPC spec, which is only about sending colors to LEDs.

The spatial information from the layout file is used by:

  • gl_server.c to draw a preview of the points
  • Most of the included python pattern generators like spatial_stripes.py which use an LED's location to procedurally generate its color.
  • Other tools like pixelslinger

gl_server.c draws a little red-green-blue axis marker at the origin to help you get oriented. Red is x, green is y, and blue is z.

I see that gl_server.c also supports lines in addition to points. Looks like it expects this format:

    {"line": {"start": [11, 22, 33], "end": [77, 88, 99]}}

...but I don't see any example layout files that use lines.

I think there were once "circles" or maybe "spheres" which were drawn as extra large spheres in the 3d preview, but I don't see that code here.

The purpose of freespace.py is to generate a layout file representing an installation that was at Freespace in SF which was a grid folded in half in the middle.

In my fork I have some more JSON layouts to play with and also a script objToLayout.py which converts the vertices of an OBJ file into a JSON layout.

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

3 participants