I tested yesterday and endpoint tangent to knot worked well, creating first tangent at knot constraint and then adding a coincidence constraint still failed to converge, it would be ideal if it was auto replaced by end point tangent as it happens with normal tangent constraints.
B-Spline Constraints: Fully Funded! Thanks everybody!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- adrianinsaval
- Veteran
- Posts: 5548
- Joined: Thu Apr 05, 2018 5:15 pm
Re: B-Spline Constraints: Fully Funded! Thanks everybody!
Re: B-Spline Constraints: Fully Funded! Thanks everybody!
This should not be the case if a zero is an actual zero (not e.g. 1e-15), as the system is created as a dense matrix and only then it is converted to a sparse one. But, hey! you have already implemented it so we will take a lookjnxd wrote: ↑Tue Jan 17, 2023 7:16 pmNote that the sparsity of a matrix in the data structure may be different than the actual sparsity of the matrix: it is possible that elements that are actually zero are stored explicitly in the data structure, eating up resources during computations. This may not be a bad thing all the time (e.g. in GPU matrix operations, which we don't do here), but just something to keep in mind.abdullah wrote: ↑Tue Jan 17, 2023 3:18 pmIt should not. Diagnosis is run at the beginning, with the parameter value as initialised by OCC. If the constraint uses this value to calculate gradients (Jacobian), all but the intervening ones will be zero. This will keep the matrix sparse. If a point can move in a segment of BSpline, it will move on any to other. So the fact that diagnosis is restricted to the relevant segment appears to me an advantage...
From previous experiences, the amount of people testing during pre-merge is limited. The moment something is announced as a new feature in master, many more users will try it out. Some power users may well abuse the poor feature to test its limits.jnxd wrote: ↑Tue Jan 17, 2023 7:16 pm Definitely don't have anything against your heart's health. It's in everyone's (including Sketcher's) interest that it keeps working fine .
I think most of the actual "tests" will eventually only happen in the wild. Anyone who wanted to test it pre-merge seems to have already done so.
Thank you!
Yes, we are missing the constraint substitution part. Do you want to give it a go Ajinkya?adrianinsaval wrote: ↑Wed Jan 18, 2023 6:01 pm tested yesterday and endpoint tangent to knot worked well, creating first tangent at knot constraint and then adding a coincidence constraint still failed to converge, it would be ideal if it was auto replaced by end point tangent as it happens with normal tangent constraints.
Re: B-Spline Constraints: Fully Funded! Thanks everybody!
Could try. Where to start?abdullah wrote: ↑Thu Jan 19, 2023 2:53 pmYes, we are missing the constraint substitution part. Do you want to give it a go Ajinkya?adrianinsaval wrote: ↑Wed Jan 18, 2023 6:01 pm tested yesterday and endpoint tangent to knot worked well, creating first tangent at knot constraint and then adding a coincidence constraint still failed to converge, it would be ideal if it was auto replaced by end point tangent as it happens with normal tangent constraints.
My latest (or last) project: B-spline Construction Project.
Re: B-Spline Constraints: Fully Funded! Thanks everybody!
When adding a coincident, this checks what should do instead in particular cases:
https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L2027
https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L1909
https://github.com/FreeCAD/FreeCAD/blob ... s.cpp#L485
That is for coincident, there are others for when, for example, a PoO is added:
https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L2465
or tangencies:
https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L4031
It is rather rudimentary...
- adrianinsaval
- Veteran
- Posts: 5548
- Joined: Thu Apr 05, 2018 5:15 pm
Re: B-Spline Constraints: Fully Funded! Thanks everybody!
is it expected the the solver fails to converge when I add first the tangent and then the coincidence then? If I first add the coincidence and then the tangent it says it's partially redundant but it works, it converges and I can drag stuff around
Re: B-Spline Constraints: Fully Funded! Thanks everybody!
That's not my own experience with recent builds, but apparently abdullah said it's unrelated.adrianinsaval wrote: ↑Thu Jan 19, 2023 5:40 pm is it expected the the solver fails to converge when I add first the tangent and then the coincidence then?
My latest (or last) project: B-spline Construction Project.
Re: B-Spline Constraints: Fully Funded! Thanks everybody!
It is not expected that the solver fails to converge. However, the tangent constraint is not, IMO, what makes it fail to converge. The fact that the other way around it works buts some weight on this position.adrianinsaval wrote: ↑Thu Jan 19, 2023 5:40 pm is it expected the the solver fails to converge when I add first the tangent and then the coincidence then? If I first add the coincidence and then the tangent it says it's partially redundant but it works, it converges and I can drag stuff around
It would be great to find the real culprit. However, finding the real culprit is not relevant for this specific case, as the constraint should be the other one (endpoint to endpoint tangency). When constraint substitution is implemented this issue won't arise for this case. However, it may appear in another combination of constraints, where the problem is not that the "wrong" constraint was selected.
But that we will see when people start using it and report issues... and maybe those issues help us find that sneaky culprit...
Re: B-Spline Constraints: Fully Funded! Thanks everybody!
Point on B-Spline is merged.
@jnxd
Do you feel like AngleViaPoint next?
@jnxd
Do you feel like AngleViaPoint next?
Re: B-Spline Constraints: Fully Funded! Thanks everybody!
We need to chart the future course a little. So far, you're suggesting the constraint substitution (which is simple but is also just a long chain of if-else statements) and angle-via-point (which can evolve from what we're doing so far, but might need us to add more of those dreaded parameters). Are their other things?
Also in priority is the construction project, which I want to get done by March end. In that preferably we should have control over the nonuniformity of the B-spline, so the knots' parameters can change continuously.
My latest (or last) project: B-spline Construction Project.
Re: B-Spline Constraints: Fully Funded! Thanks everybody!
Thanks to jnxd! I rate this as another milestone in Sketcher development.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.