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.
On Sat, Jul 29, 2017 at 8:53 AM, Luke Kenneth Casson Leighton <lkcl@lkcl.net
wrote:
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.
I don't really speak python, but I'm happy to put my two cents in.
You've got three of the four cases defined, but to start with I only looked at the simple one (invert==0, oldinvert==0) which you seem to think is solved. Unless I'm missing something, it's not really solved at all -- it looks like it completely ignores any difference in radius when figuring the contact angles. And I think when you fix that, the hard cases will mostly explain themselves (you'll basically negate the radius in that calculation, and maybe also add/subtract the belt thickness).
So, given the old bearing has radius R1 and the new bearing has radius R2, separated horizontally (or at any other angle) by a distance D, we can find the deviation from horizontal (or in the general case, the deviation from the angle connecting their centers): arcsin((R1-R2)/D)
And of course, negate that if they're both inverted (rather than both noninverted). (Not entirely clear on your sign convention, so this may be exactly backwards, but you can figure that out faster than I could puzzle through it.)
And if you're crossing over, with belt thickness T, that should just become arcsin((R1+R2+T)/D) (again, this is going from noninverted to inverted -- negate for inverted to noninverted, or maybe the opposite.) But of course in this case, you leave the first bearing at one angle, and contact the second bearing at the opposite angle; if you actually redefine R2=-(R2+T), this takes care of itself, so you might not need all the cases. (Though the part where you wrap the arc around the old bearing will need to be careful about clockwise/counterclockwise.)
Hope that helps.
Benson Mitchell
--- crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
On Sat, Jul 29, 2017 at 2:51 PM, Benson Mitchell benson.mitchell+arm-netbook@gmail.com wrote:
On Sat, Jul 29, 2017 at 8:53 AM, Luke Kenneth Casson Leighton <lkcl@lkcl.net
wrote:
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.
I don't really speak python, but I'm happy to put my two cents in.
python's pretty clear and human-readable.
You've got three of the four cases defined,
yes. the last case - which is when 2 or more inverted-belt bearings are added - i skipped, on the basis that i would not really use it (if ever).
but to start with I only looked at the simple one (invert==0, oldinvert==0) which you seem to think is solved.
it is... but explaining how it works is not something i can easily do. i tend to work by intuition and guess-work. i was terribly surprised when a series of random and semi-arbitrary code-modifications actually produced the desired result.
Unless I'm missing something, it's not really solved at all -- it looks like it completely ignores any difference in radius when figuring the contact angles.
ah. ok you see the loop "+= 360"? i vaguely figured that any change would have to result in a positive increase in angle. any change that went over 360 could be made modulus 360 for the *next* change.
staggeringly this actually works.
And I think when you fix that, the hard cases will mostly explain themselves (you'll basically negate the radius in that calculation, and maybe also add/subtract the belt thickness).
ok the problem of actually creating the belt is passed to that SurfaceFromCurves function. you give it a set of points (actually two sets) and a "thickness" parameter, and it *automatically* creates the full 3D polygon set needed to create a complete 3D surface of thickness "thickness".
So, given the old bearing has radius R1 and the new bearing has radius R2, separated horizontally (or at any other angle) by a distance D, we can find the deviation from horizontal (or in the general case, the deviation from the angle connecting their centers): arcsin((R1-R2)/D)
yep this case is not covered at all. however given that i am only using radii of 6 and 7 or 8 and 9, with long separation between them and also where there is a huge discrepancy the angles are 180 degrees and dead-straight (lined up by eye), the differences caused by not taking into account the case R1 != R2 are either actually zero or negligeably small.
it's a visual aid and approximation anyway, but i would really like it to actually be complete and accurate, as i will be doing more complex belt layouts later.
And if you're crossing over, with belt thickness T, that should just become arcsin((R1+R2+T)/D) (again, this is going from noninverted to inverted -- negate for inverted to noninverted, or maybe the opposite.)
if i can be absolutely honest, my mind isn't one that can cope with or follow accurate mathematical calculations. when working with the spline-generating function i had to leave *six years* in between modifications and it took me 2 days of experimentation to get even a reaasonably-approximate version of "normalised vectors" up and running. that was from a lot of google searches, as well :)
so if i may, i'd like to leave it to others to discuss this, if they want to: i'll chip in if necessary.
l.
On Sat, 29 Jul 2017 15:49:21 +0100 Luke Kenneth Casson Leighton lkcl@lkcl.net wrote:
On Sat, Jul 29, 2017 at 2:51 PM, Benson Mitchell benson.mitchell+arm-netbook@gmail.com wrote:
On Sat, Jul 29, 2017 at 8:53 AM, Luke Kenneth Casson Leighton <lkcl@lkcl.net
wrote:
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.
I don't really speak python, but I'm happy to put my two cents in.
python's pretty clear and human-readable.
<snip>
so if i may, i'd like to leave it to others to discuss this, if they want to: i'll chip in if necessary.
l.
I'm going to look into this luke, no promises, but I'm ok with math and python.
Sincerely, David
On Mon, Aug 7, 2017 at 11:46 PM, David Niklas doark@mail.com wrote:
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.
I'm going to look into this luke, no promises, but I'm ok with math and python.
star. i _could_ do it.... it'd take time.
l.
https://math.stackexchange.com/questions/882067/given-two-circles-find-the-l...
this might help - i'm going to ask another question.
https://math.stackexchange.com/questions/2386333/how-do-you-find-the-length-...
'faakin 'ellfire, faaking stupid system - you don't quotes have enough reputation quotes to post images, thus making it near-impossible to express th faaking question in an easy-to-faakin-understand way. faak!
l.
https://math.stackexchange.com/questions/2386333/how-do-you-find-the-length-...
hiya david: okay! so someone kindly edited the question to put the proper links in, so the question's actually understandable.
so... benson.... with the diagrams that aretino kindly added, i was able to not only understand what he was saying, but, also, understood it well enough to appreciate that *your* answer is correct :)
aretino recommends using arccos instead of arcsin.
l.
On Thu, 10 Aug 2017 05:43:48 -0400 Luke Kenneth Casson Leighton lkcl@lkcl.net wrote:
https://math.stackexchange.com/ (bla)
hiya david: okay! so someone kindly edited the question to put the proper links in, so the question's actually understandable.
so... benson.... with the diagrams that aretino kindly added, i was able to not only understand what he was saying, but, also, understood it well enough to appreciate that *your* answer is correct :)
aretino recommends using arccos instead of arcsin.
Luke, just getting through my emails, does this mean that you have your problem solved or were you referring this info for my benefit?
Thanks, David
--- crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
On Thu, Aug 17, 2017 at 11:24 PM, doark@mail.com wrote:
On Thu, 10 Aug 2017 05:43:48 -0400 Luke Kenneth Casson Leighton lkcl@lkcl.net wrote:
https://math.stackexchange.com/ (bla)
hiya david: okay! so someone kindly edited the question to put the proper links in, so the question's actually understandable.
so... benson.... with the diagrams that aretino kindly added, i was able to not only understand what he was saying, but, also, understood it well enough to appreciate that *your* answer is correct :)
aretino recommends using arccos instead of arcsin.
Luke, just getting through my emails, does this mean that you have your problem solved
that's incorrect.
or were you referring this info for my benefit?
that is correct.
if you look at the source code (git cloned or simply verify belts.py manually) you will see that there have been no commits which implement the algorithm. i have too much else to do, so your help is very much needed.
l.
On Fri, 18 Aug 2017 06:58:54 +0100 Luke Kenneth Casson Leighton lkcl@lkcl.net wrote:
On Thu, Aug 17, 2017 at 11:24 PM, doark@mail.com wrote:
On Thu, 10 Aug 2017 05:43:48 -0400 Luke Kenneth Casson Leighton lkcl@lkcl.net wrote:
https://math.stackexchange.com/ (bla)
hiya david: okay! so someone kindly edited the question to put the proper links in, so the question's actually understandable.
<snip>
Unfortunately I've not been able to finish this. I've tried luke, but my laptop's battery just went totally bad, my desktop's HD filled up all the way and my family has been in need of my help. I just don't have the time to do this either, and with the hurricane coming (to Florida), I'm not certain what's going to become of me or this house (yes, I'm staying with my family). We will probably loose power and water at the least.
In case you've not heard it's a CAT 5! AND there is another one behind it!
I've done several of the calculations by hand and I understand how to do it, just not with a computer nor with your program, plus I don't have the python bindings for openscand so you program still will not work (yes I set python's path correctly). I've created a simple gif that illustrates the steps that the computer must take. This should help you to not have to take shots in the dark when trying to figure this out. 1. Create a polygon. 2. Separate the polygon into squares or right triangles. 3. Enlarge based on sizes of pulleys. 4. Measure angles of side and use this to calculate the angles of your pulleys.
Sincerely, David
On Sat, Sep 9, 2017 at 4:43 PM, doark@mail.com wrote:
Unfortunately I've not been able to finish this. I've tried luke, but my laptop's battery just went totally bad, my desktop's HD filled up all the way and my family has been in need of my help.
hey sounds like you have your hands full
I just don't have the time to do this either, and with the hurricane coming (to Florida), I'm not certain what's going to become of me or this house (yes, I'm staying with my family). We will probably loose power and water at the least.
_really_ full :)
In case you've not heard it's a CAT 5! AND there is another one behind it!
just been in a typhoon here in taiwan couple months back, i have to say it was utterly cool, 14 storey apartment, we're on the 13th floor and the thing was SWAYING about a foot, for an hour. i was very disappointed that the only damage done was a few tree plants blown over, bits of corrugated iron pin-wheeling down the street, but not even a flicker on the power-grid or the water supply.
mind you, this place is set up for year-on-year typhoons. i found it strange (and quotes backwards quotes) as to why you see all these motor cycles running about the place with 2 or 3 1 metre long propane gas cylinders strapped to the back: it's because it's too dangerous to have gas main lines running underground. so everyone cooks with camping gas style kitchen stoves and the hot water heater runs off another one, and you'll never get people being blown up because a tornado ripped up a gas main.
I've done several of the calculations by hand and I understand how to do it, just not with a computer nor with your program, plus I don't have the python bindings for openscand
there aren't any. pyopenscad is an independent program that *outputs* scad (as a text file).
so you program still will not work (yes I set python's path correctly). I've created a simple gif that illustrates the steps that the computer must take. This should help you to not have to take shots in the dark when trying to figure this out.
:)
- Create a polygon.
- Separate the polygon into squares or right triangles.
- Enlarge based on sizes of pulleys.
- Measure angles of side and use this to calculate the angles of your
pulleys.
i can manage that with enough guess-work :)
thanks david.
l.
Luke, Is this the correct location of pyopenscad?
http://forum.openscad.org/ANN-pyopenscad-spline-surface-generator-td21838.ht...
Are there any other deps I should be aware of?
Sincerely, David
On Mon, Aug 14, 2017 at 11:11 PM, David Niklas doark@mail.com wrote:
Luke, Is this the correct location of pyopenscad?
http://forum.openscad.org/ANN-pyopenscad-spline-surface-generator-td21838.ht...
yes. do let me know how you get on, it would be good to have a double-check from someone that i got the files right.
Are there any other deps I should be aware of?
python2, openscad... thaaat's... about it :)
l.
arm-netbook@lists.phcomp.co.uk