[Arm-netbook] python coding help needed (sin, cosine, blah blah)

Luke Kenneth Casson Leighton lkcl at lkcl.net
Sat Jul 29 13:53:55 BST 2017


http://hands.com/~lkcl/foldable3dsandwich200/belts.py

ok, i could use some algorithm help, here, if anyone's interested.
the key function is add_bearing in class Belt.

basically what i have done is create a class which completely
specifies a belt path, by starting out with the angle that the belt is
wrapped around so far, plus the position, plus the diameter of the
bearing (a fake bearing initially).

subsequent bearings need only be added specifying their position,
radius, and whether the belt is to go on the INTERIOR or the EXTERIOR
of the bearing.

the swapping-from-interior-to-exterior is where i'm having
difficulties.  i've made a half-assed approximation so far, i will
upload a quick video about it... https://youtu.be/AV5yRz6GPX0

the problem i have is that the flip-over between interior and exterior
is a little bit too complicated for my tiny brain to handle.  i know
that it involves twin offsets.  i think it might be possible to work
out the first angle between the bearings, then pretend that there's
another bearing added on the *other* side (in the opposite
configuration), then work out the angle of *that* (fake) bearing to
the one before it...

anyway if anybody would like to have a go at tackling this i would be
really grateful.

l.



More information about the arm-netbook mailing list