klipper-led_effect icon indicating copy to clipboard operation
klipper-led_effect copied to clipboard

Simulator only showing line

Open kevinkhill opened this issue 1 year ago • 1 comments

I got the simulator up and running, but was saddened when the layout did not switch to circle.

I have a 16 pixel ring and want to experiment, but the only layout that works in the simulator for me is line. Circle, Triangle and Voron all do not work for me.

kevinkhill avatar Jun 10 '24 00:06 kevinkhill

I think I might have found the issue! The difference between the x,y in Rectangle vs all the others, is that they were int

I tried adding a method like this

def _push_led_coordinates(self, x, y, size, round_xy=False):
    if round_xy is True:
        self.led_coordinates += [(round(x), round(y), size)]
    else:
        self.led_coordinates += [(x, y, size)]

Then switched out self.led_coordinates += [(x, y, size)] in _calc_coordinates() to use that method. With rectangle, I didn't use the 4th param to round, but enabling it in Circle worked!

elif self.m_cbLayout.GetValue() == "Circle":
    self.m_spinLines.Enable(False)
    r = distance * self.led_count / (2 * math.pi)
    for i in range(self.led_count):
        a = 2 * math.pi / self.led_count * i
        x = r * math.sin(a)
        y = r * math.cos(a)
        self._push_led_coordinates(x, y, size, round_xy=True)

image

(Triangle seems to have a slight issue in the algorithm leaving gaps at certain counts) image image

kevinkhill avatar Jun 10 '24 01:06 kevinkhill

I can't reproduce your problem. All shapes are working fine for me. For the triangle: You just can't form a equilateral triangle with any number of leds. That's why there are gaps. image image image

julianschill avatar Jul 11 '24 07:07 julianschill

Can you maybe elaborate what "not working" means for you? What behaviour are you expecting vs. what are you getting?

julianschill avatar Jul 11 '24 07:07 julianschill

When I would try to switch to the other shapes, it would just show nothing up in the top area

kevinkhill avatar Jul 11 '24 14:07 kevinkhill

Are you using the packaged version or are you running it with your own python? If the latter, what python version are you using?

julianschill avatar Jul 11 '24 15:07 julianschill

Is this still an issue or can I close this?

julianschill avatar Oct 13 '24 16:10 julianschill

Go ahead and close. Thanks for asking 😊

kevinkhill avatar Oct 13 '24 16:10 kevinkhill