Search found 34 matches

by acolomitchi
Fri Jun 16, 2023 8:27 am
Forum: Part Design module development
Topic: Sketcher performance - where do those CPU cycles go.
Replies: 37
Views: 10977

Re: Sketcher performance - where do those CPU cycles go.

Experimentation and some preliminary results ( @DeepSOIC @abdullah ) on scaling up the angle constraints to size constraints ... No hard promise, but I'll likely round all up next weekend and send a pull request for you to review and maybe merge. Apologies, fate hasn't been kind enough to allow me ...
by acolomitchi
Tue Jan 03, 2023 3:26 pm
Forum: Part Design module development
Topic: Sketcher performance - where do those CPU cycles go.
Replies: 37
Views: 10977

Re: Sketcher performance - where do those CPU cycles go.

I used the DeriVector2 arithmetic to transform ConstraintL2LAngle and ConstraintP2PAngle from radians to size/dimensions errors Now, if you somehow include the lengths of these lines into the error function, the solver will see that reducing the length of the lines is also a perfectly valid way of ...
by acolomitchi
Tue Jan 03, 2023 12:42 am
Forum: Part Design module development
Topic: Sketcher performance - where do those CPU cycles go.
Replies: 37
Views: 10977

Re: Sketcher performance - where do those CPU cycles go.

Experimentation and some preliminary results ( DeepSOIC abdullah ) on scaling up the angle constraints to size constraints So far: "modernized" a bit of the code (using hypot instead of sqrt(x^2, y^2), introducing lerp - based on std::fma - instead on linCombi, ...) filled-in what I saw as...
by acolomitchi
Mon Jan 02, 2023 11:15 pm
Forum: Part Design module development
Topic: Sketcher performance - where do those CPU cycles go.
Replies: 37
Views: 10977

Re: Sketcher performance - where do those CPU cycles go.

On the other CAD, with relative precision, i worked before, all elements under the tolerances vanishes. Ugh... they may leave some gaps into a poly-curve that is supposed to be continuous/closed => topological damage. Actually, it may happen even with a CAD based on the absolute precision if the pr...
by acolomitchi
Mon Jan 02, 2023 11:10 pm
Forum: Part Design module development
Topic: Sketcher performance - where do those CPU cycles go.
Replies: 37
Views: 10977

Re: Sketcher performance - where do those CPU cycles go.

A cheap criterion to stop the iterations is on the line of "when the rate of convergence is smaller than a limit" - on the ground of "diminishing returns - too much effort to squeeze the improvements in the least significant bits". I have an impression that usually, if the solve...
by acolomitchi
Sun Jan 01, 2023 3:21 am
Forum: Part Design module development
Topic: Sketcher performance - where do those CPU cycles go.
Replies: 37
Views: 10977

Re: Sketcher performance - where do those CPU cycles go.

Ideally, we should derive solution_accuracy of solved sketch from constraint errors, and write out shape tolerances as something like 3*(solution_accuracy). I'm not sure if it's possible for sketches with remaining degrees of freedom, though. 1e-7 mm is not hard-wired into OCC, it's just a default ...
by acolomitchi
Sat Dec 31, 2022 5:18 pm
Forum: Part Design module development
Topic: Sketcher performance - where do those CPU cycles go.
Replies: 37
Views: 10977

Re: Sketcher performance - where do those CPU cycles go.

Then altering the tolerance is a better path to follow. Like in: working with relative tolerances. But then again, neither this is a silver bullet - that's just the nature of the beast. If one really needs 1e-10 absolute precision, the only way to obtain this in more cases is to perform the computa...
by acolomitchi
Sat Dec 31, 2022 12:26 pm
Forum: Part Design module development
Topic: Sketcher performance - where do those CPU cycles go.
Replies: 37
Views: 10977

Re: Sketcher performance - where do those CPU cycles go.

That is to say: in the unit (1.0) range, the absolute imprecision of going through square/sqrt is around 1e-8; >>> sqrt(pi)**2 - pi -4.440892098500626e-16 seems like you're about 5 orders of magnitude off >>> def f(a) : ... return (math.sqrt(math.pi) + a)*(math.sqrt(math.pi) - a) + a*a -math.pi ......
by acolomitchi
Sat Dec 31, 2022 1:18 am
Forum: Part Design module development
Topic: Sketcher performance - where do those CPU cycles go.
Replies: 37
Views: 10977

Re: Sketcher performance - where do those CPU cycles go.

Personally, when if comes to hypot/square, I see anything beyond double(1e-8) relative precision as questionable. this is an absolute comparison, relative precision is mostly irrelevant. Absolute comparison is much worse, as it scales with the magnitude of the terms involved. That is to say: in the...
by acolomitchi
Fri Dec 30, 2022 7:50 pm
Forum: Part Design module development
Topic: Sketcher performance - where do those CPU cycles go.
Replies: 37
Views: 10977

Re: Sketcher performance - where do those CPU cycles go.

Question - is the success condition of the iterative solving absolute or relative to the sketch size? Does the solver stop once an absolute precision has been reached or is the precision relative to sketch size? it is hypot(err1, err2, ...) < convergence (convergence = 1e-10 by default; err1 and er...