jes notes Index Gallery . Shaft passers Snap issues

2025-03-01

Last modified: 2025-03-01 22:39:14

< 2025-02-27 2025-03-02 >

FreeCAD

"tritao" has done some work to run document recomputes in a worker thread.

The plan is to merge this with my abort dialog and progress indicator.

Working from https://github.com/tritao/FreeCAD/commits/async-document-recompute I think.

I'm basically going to cherry-pick commits from https://github.com/FreeCAD/FreeCAD/pull/19796 into my staging area and then make them work with the async recompute stuff.

So tritao's code runs a worker thread that receives RecomputeRequest objects and then recomputes them. From the point that receives the RecomputeRequest, how can I launch my dialog on the main thread? Not sure I can.

Maybe I make MainGui install a task runner that invokes the task on the main thread?

Yep, seems to work.

https://github.com/jes/FreeCAD/commits/async-document-recompute/

So to remove the necessity to run the task with a modal on the main thread, we would want to add some sort of progress bar and cancel button on the main UI, and send progress updates to that.

OK, well I have it working by using the SequencerBar that already exists in the main UI, but for some reason I am not smart enough to put a cancel button next to it.

Clock

I'm going to finally get around to making new 12mm bearing blocks that stick "inwards" a little bit so that my short shaft can be supported and I can try to make the clock run again.

And can print 2 of these tomorrow.

Weight-driven truck toy

I kind of want to make a toy truck that drives along powered by a falling weight.

My first thought was to have a weight that falls vertically within the body of the toy, and then there is some toothed rack or something to connect it to the wheels, but then you end up needing twice the height that the weight falls through so that the rack doesn't need to pass underneath the ground.

So I actually think we should put the weight on an arm that can move through say a quarter of a turn, and then a few stages of speeding up, like in a clock, and then a ratchet drive at the axle. So to wind it up you just lift the weight by hand, and the ratchet spins freely. When you let go, the weight falls and the truck accelerates. When the weight reaches the bottom, it stops falling and the ratchet starts slipping.

Would it be better if the ratchet were at the end of the gear train with the weight, instead of with the axle? The advantage would be that it has to waste less energy compressing the ratchet spring, but the disadvantage is it has to waste more energy spinning the unnecessary gears.

Basically the ratchet will click (say) hundreds of times if it is at the axle, but only a handful of times if it is at the weight. And each time it clicks you are wasting energy compressing the spring.

I think put it at the axle and try to make the spring force very light.

Another option is don't have a ratchet at all! Put the weight on only a quarter of a gear, such that when it falls all the way down it completely disengages. Then you are wasting energy spinning the gear train, but no ratchet required. It does mean the wheels will turn backwards when you rewind the weight, probably you don't care.

Obviously the energy you give the truck is mgh where m is the mass of your weight, g is gravity, h is the vertical distance the weight falls though.

ChatGPT says the maximum distance the truck can travel is h / mu_r where mu_r is the rolling resistance. m factors out because the truck needs to move the weight, so after the vast majority of the weight of the truck is in the drive weight, adding more drive weight doesn't help.

ChatGPT suggests rolling resistance for toy car wheels is about 0.1, so we can only move the truck 10x as far as the weight falls. So this might actually be totally rubbish.

< 2025-02-27 2025-03-02 >