Ability to cancel a calculation: an error can be costly!

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Ability to cancel a calculation: an error can be costly!

Post by RatonLaveur »

Hi boys and girls,

I hope the confinement is as pleasant as could be and that all ya'all are safe and sound in these current "interesting" times.

I have been using my time wisely getting more up-to speed with the current state of path and...boy has it grown. It's almost overwhelming.

Speaking of growing: my computation times. Partly my fault, as I was a vocal proponent of several ridiculous changes specifically in Adaptive and 3D surface.
And I don't complain at all. The increased accuracy and options are amazing. However, a slight mistake can be a costly one, for example, I accidentally scaled my model up 2 times and performed and adaptive...miiiiissstaakkke. As i'm writing this my computer is humming and puffing, lucky this laptop hasn't yet called uncle on any other app than FreeCAD.

As such, is it reasonable (even possible?) to ask for the ability to interrupt computations?

Looking forward to your comments, stay safe!
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Ability to cancel a calculation: an error can be costly!

Post by dubstar-04 »

The adaptive has a stop button hiding at the bottom:
adaptiveStop.png
adaptiveStop.png (53.16 KiB) Viewed 926 times
It would be nice to have similar on 3D Operations that can run for long periods.

Thanks,

Dan
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: Ability to cancel a calculation: an error can be costly!

Post by RatonLaveur »

Hey, thanks for the tip I did find it out after posting, and I tried clicking and clicking and clicking. I think I broke a nail. I had just done my nails!

At least in some cases this button won't work. My pointer was in the spinning blue wheel of death.
etrombly
Posts: 144
Joined: Thu Dec 05, 2019 6:50 pm

Re: Ability to cancel a calculation: an error can be costly!

Post by etrombly »

So it really depends on what operation you are doing. If it is something that is easily split into chunks and is all processed in python than it is feasible to add a stop button like adaptive. (it still won't respond while it is processing one of those chunks) If It's sending a whole shape to opencascade for processing, or it's a single long running task, there's not much you can do. Ideally you could have the operation run on a separate thread in those cases that you could cancel, but I don't think the shapes are thread safe. Also what if you modified the shape while it was processing? Since the gui wouldn't be locked anymore it could invalidate the operation. I was actually thinking about investigating a way to do this, and somehow lock whatever objects the operation was using, but this would be a pretty substantial change to how freecad works, and might not even be possible.

I think it's possible for some operations, but not all.
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: Ability to cancel a calculation: an error can be costly!

Post by RatonLaveur »

etrombly wrote: Fri Apr 10, 2020 12:08 pm but this would be a pretty substantial change to how freecad works, and might not even be possible.
RatonLaveur wrote: Thu Apr 09, 2020 9:47 pm As such, is it reasonable (even possible?)
Yep, that's what I thought as well. Difficult to have a process able to be stopped AND robust. Thought I'd ask anyway to hear what the experts would have to say. Thanks!
Post Reply