xLightsSequencer / xLights

xLights is a sequencer for Lights. xLights has usb and E1.31 drivers. You can create sequences in this object oriented program. You can create playlists, schedule them, test your hardware, convert between different sequencers.
GNU General Public License v3.0
558 stars 209 forks source link

Symmetrize (Rotational) on partial Spinner fails #3990

Open therapybeagles opened 1 year ago

therapybeagles commented 1 year ago

Describe the bug Symmetrize (Rotational) Fails for partial Spinner and outputs error log

To Reproduce I created a Spinner with the following specifications:

Strings: 1

Arms/String: 16 Lights/Arm: 25 Start Angle: 270 Arc: 180 Starting Location: Center Alternate Clockwise

This gives me an arch with 16 arms and a total of 400 nodes.

Next, I go to Submodels... I create one row of a submodel (e.g., Spokes), specifying 1-25 as the range. (Ideally I'd use 1,25,2,24... but doesn't matter for this example.) Next I select "Symmetrize (Rotational)" and select 16 degrees of symmetry. It asks if I want to Squarify Aspect Ratio. Regardless of what I answer here, I get an error and see a log. (Log included.)

Expected behavior I would have hoped for 16 submodel rows to appear, but no luck.

Screenshots If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

Additional context Awkward workaround: Set Arc to 360, double the # of arms, use Submodels/Squarify, set Arc back to 180, set # of arms back, and manually delete the extra rows of the submodel.

Error Log: Processing model: SubModel-1 Symmetrize DoS: 16 Model Dimensions (based on screen): 1028x2259 Number of nodes: 400 Centroid: 513.999756, 1304.221191 Ranges x:17.3-1010.7, y:1129.000000-1622.998047 Center by extremity: 514.000000, 1375.999023 Center by median: 524.560059, 1283.093994 Aspect ratio by extremity: 1.000000 / 0.497261 Aspect Ratio by variance: 1.000000 / 0.559781 Transformed nodes: 400 Found Match for 272 at radius 9 Member 272 Member 255 Member 230 Member 205 Member 196 Member 171 Member 155 Member 147 Member 129 Member 128 Member 149 Member 152 Member 225 Member 227 Member 253 Member 273 Found Match for 296 at radius 9 Member 296 Member 271 Member 231 Member 206 Member 181 Member 156 Member 131 Member 146 Member 105 Member 123 Member 124 Member 151 Member 201 Member 252 Member 298 Member 297 Found Match for 281 at radius 12 Member 281 Member 270 Member 245 Member 220 Member 195 Member 170 Member 145 Member 120 Member 96 Member 97 Member 99 Member 101 Member 251 Member 277 Member 304 Member 321 Found Match for 295 at radius 16 Member 295 Member 257 Member 232 Member 207 Member 182 Member 144 Member 119 Member 106 Member 81 Member 79 Member 102 Member 126 Member 276 Member 302 Member 322 Member 306 Found Match for 309 at radius 17 Member 309 Member 284 Member 233 Member 219 Member 168 Member 143 Member 118 Member 93 Member 69 Member 72 Member 28 Member 51 Member 351 Member 328 Member 346 Member 332 Found Match for 318 at radius 17 Member 318 Member 292 Member 259 Member 218 Member 184 Member 142 Member 110 Member 92 Member 59 Member 45 Member 29 Member 1 Member 376 Member 353 Member 370 Member 333 Found Match for 293 at radius 18 Member 293 Member 269 Member 244 Member 194 Member 169 Member 108 Member 83 Member 82 Member 71 Member 54 Member 75 Member 326 Member 349 Member 329 Member 320 Member 307 Maximum search radius hit: 21 Note the following nodes could not be matched. Ensure that zoom in/out is reasonable, that the model is centered, and that the point locations are clean. Node 2 Node 3 Node 4 Node 5 Node 6 Node 7 Node 8 Node 9 Node 10 Node 11 Node 12 Node 13 Node 14 Node 15 Node 16 Node 17 Node 18 Node 19 Node 20 Node 21 Node 22 Node 23 Node 24 Node 25

Attachments N/A

merryoncherry commented 1 year ago

Thanks for the detailed report - I love it when there are good instructions to reproduce the problem.

I have two suggestions that may help you get past your issue. But first, an explanation.

The symmetrize feature was aimed at, and tested on, custom models, which lay the pixels out in the render space the same way they look in the real world. Models such as the spinner look round in real life, but are rectangular arrays of vertical spokes in the render buffer. You can see this in the "Node Layout" right click option for the model: image That is where symmetrize looks, but it doesn't show symmetry.

So, what to do for your case? So, if all you are trying to do is generate spokes, option 1, is to use the "Actions..." button and select the "Generate Slices" option. image

If you are trying to do something more interesting, like add wedges, and really want to use symmetrize, you could first convert your spinner to a custom model (right click and "Export as Custom xLights Model"). image

I will try to do something about this, but the most likely thing in the short term is to warn users that are trying to symmetrize models that are not custom models.

cybercop23 commented 1 year ago

Ahhhh.. that's a great insight. So we can export and create on the custom model and then export the sub-models on the native model.