Looks nice but the continuous motion is an illusion: the teeth each move one position then jump back to zero and statr again. Seems that's the only way to do it.
But I cant integrate it in a design with parts that move at continuous $t*360 speed, which is much faster. Any ideas, anyone?
It would be a start if it were possible to get the teeth to move continuously all the way to the end of the straight sections then jump back one by one to the beginning of the section, but while that is possible with "rotate", it can't be done with "translate".
The green and blue squares "rotate" around the same circle, but the red squares "translate" in different ranges, 0-100 and 50 to 150. I would need each square to jump back to zero when it hits the ton.
BTW I have often wondered whether it is possible to show gears with different numbers of teeth rotating at the correct speed - I think not. Multiples of $t*360 are no problem but fractions are tricky.
Please read the first pinned post, posts here will not generally get seen so people won't see them.
You may want to post the above message as an email to the Mailing-list.
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
Concerning the belt: You seem to spend one cycle on moving the belt one tooth. Say your gears have 20 teeth. Then you need 20 cycles to get a full revolution that can be synchronized with some other object also doing a full revolution.
In this case you need to stretch $t with the least common multiple (and also raise the steps value). I.e. you get something like this:
b = 360*$t;
If you want to animate a gearing system e.g. with i=13:4. You need 13*4 cycles to correctly display the gears. Thus you use
a = 4*360*$t; // larger gear1
b = 13*360*$t; // smaller gear2
To synchronize the object with the gears use a or b respectively.
If factors get too large you have to cheat. But this is another theme.
Concerning the squares: Use multiplication instead instead of offseting the second golden square.
a = $t*360;