making a slider with "stops"

102 views
Skip to first unread message

David Young

unread,
Dec 8, 2015, 6:17:23 PM12/8/15
to apr...@googlegroups.com
I've been working on the Slider example from the Apparatus examples,
trying to add "stops" to it: I want for the circular handle to stop at the
leftmost and rightmost extent of the rectangular slot it moves on. Maybe
someone can tell me if the path I am on is a dead-end.

I tried to make X a function of value, min(1, max(0, value)), but I
found that when I moved the handle to either end of the slot, it got
stuck.

I figured that the stuck handle had something to do with the slope of
Circle's X versus value being 0 at the end of the slot. Presumably the
Apparatus solver doesn't have any basis for choosing a new value for a
new X when the X / value slope is 0.

In a second attempt (attached), I used the logistic function, which has
asymptotes at y = 0 and 1, to limit Circle's X to the range [0, 1]. The
solver seems to have the same problem with the logistic function, which
makes sense: in the limited precision of the machine, the slope of the
logistic function goes to zero, too.

It seems that I am unlikely to arrive at a slider with non-sticky stops
on my current course. Is there a better way?

Dave

--
David Young
dyo...@pobox.com Urbana, IL (217) 721-9981
Sigmoid-slider.json

Toby Schachman

unread,
Dec 8, 2015, 6:21:33 PM12/8/15
to Apparatus
Hi Dave,

There is no nice way to do this right now in Apparatus but is definitely something that we plan on implementing!

Toby

--
You received this message because you are subscribed to the Google Groups "Apparatus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aprtus+un...@googlegroups.com.
To post to this group, send email to apr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aprtus/20151208231717.GF10114%40pobox.com.
For more options, visit https://groups.google.com/d/optout.

Ira Joseph Woodhead

unread,
Jun 20, 2016, 12:34:54 PM6/20/16
to Apparatus

One way around this is to make a dial, rather than a slider. Make the value a function of the angle.

David Young

unread,
Jun 20, 2016, 1:59:09 PM6/20/16
to Apparatus
On Mon, Jun 20, 2016 at 09:34:53AM -0700, Ira Joseph Woodhead wrote:
> One way around this is to make a dial, rather than a slider. Make the value
> a function of the angle.

Thank you for the suggestion. I'm pretty keen on having stable
positions at the control's greatest and least value. It seems that your
workaround may not have any stops. That is, the dial would pass through
any angle in either direction. Or is there something I'm missing?

Dave

--
David Young //\ Trestle Technology Consulting
(217) 721-9981 Urbana, IL http://trestle.tech/

Ira Joseph Woodhead

unread,
Jun 20, 2016, 2:03:13 PM6/20/16
to Apparatus

No, you're correct. The dial idea only solves the problem of a control going off its range, but it doesn't provide stable stops.
Reply all
Reply to author
Forward
0 new messages