Page 1 of 1

Determine the tolerance used to create an existing fit spline (bonus points for fit deviation)

Posted: Sun Jan 28, 2024 4:28 pm
by ryan-feeley
Does anybody know a way to discover the fit tolerance used for an existing fit-spline sketch entity? At times I note the value I used for the tolerance in the name of the resulting sketch, but this feels like a hack. I believe such a spline will update parametrically (within reason), so Solidworks must store the tolerance. Can we access it?

Re: Determine the tolerance used to create an existing fit spline (bonus points for fit deviation)

Posted: Mon Jan 29, 2024 3:34 pm
by JSculley
I don't think it can be accessed. There is an SPR requesting the ability to see/change it:
image.png

Re: Determine the tolerance used to create an existing fit spline (bonus points for fit deviation)

Posted: Mon Jan 29, 2024 11:16 pm
by ryan-feeley
Thanks Jim! Well that answers that. I'll keep using my hacks.

Re: Determine the tolerance used to create an existing fit spline (bonus points for fit deviation)

Posted: Wed Jan 31, 2024 11:38 am
by josh
I’m not so sure it stores the tolerance. I think it’s just a parameter for how much detail it puts into creating the spline.

To test this, I created a sketch with some lines and arcs, then created a new sketch with a fit spline based on that sketch, using a tolerance of 0.01. Then I went back and edited the original sketch, dragging the entities around to create a significantly different shape, including a couple of sharp corners. When I exited the sketch, the fit spline updated based on the changes, with some variance particularly in the corners.
I then created another sketch, again creating a new fit spline based on the first sketch in its modified state, using the same tolerance of 0.01. This new fit spline had a better fit than the first one that had to follow the modified shape. If the tolerance were an actual stored parameter affecting future rebuilds, I would have expected both splines to match the sketch equally well. So… with that result, I don’t think I would recommend relying on that tolerance value for anything beyond the original spline creation.

Additionally, digging around in the API I don’t see any place that parameter would be stored. The API function for creating the fit spline does take a numeric input for the tolerance, but I can’t find anywhere in the various objects for splines or sketch relations where that value is stored.

Re: Determine the tolerance used to create an existing fit spline (bonus points for fit deviation)

Posted: Fri Feb 02, 2024 4:24 pm
by Arthur NY
@josh I luv when users really get into the think of things and really get into the guts of something. Your approach was 100% spot on. I've just one question.....

There's a difference in Solidworks when doing a rebuild (ctrl+b) vs force regen (ctrl+Q) and wonder if the option "verification on rebuild" was turned on? The only reason why I ask this is that ctrl+B doesn't always force a rebuild of the whole tree vs ctrl+q does.

I mean it does sound like, from what you've described, that it isn't being stored.

Re: Determine the tolerance used to create an existing fit spline (bonus points for fit deviation)

Posted: Fri Feb 02, 2024 5:31 pm
by josh
Verification on Rebuild does not affect sketch solving. It does more advanced body integrity checking to see which faces of the model should be affected by a feature. Ctrl+b vs q would not have any effect on this one either. In this case, the tree only contained three sketches. Sketch 2 certainly rebuilt to match the changes done to Sketch 1. Any given feature either rebuilds or not... There's not a "rebuild-ier" rebuild to make any given feature "try harder".

Re: Determine the tolerance used to create an existing fit spline (bonus points for fit deviation)

Posted: Thu Feb 08, 2024 5:23 pm
by ryan-feeley
@josh
Thanks for digging! I just tried to replicate this and actually had a different result testing in Swx2022 and Swx2020.

I created a simple sketch with a line segment, and a tangent arc. Then I fit this with a spline having a 0.01mm tolerance in sketch2 and a spline having a 0.05mm tolerance in sketch3. In both cases the original fit deviation was much lower than the provided tolerance. Then I edited the original sketch to remove the tangency relation and move the arc so there was a sharp corner between the entities. The downstream splines followed the update without errors.

However, in this experiment, the new deviations were much closer to the original tolerance limits, with the 0.01mm spline in sketch2 following the sharp corner with a much tighter curve radius. It is possible that this is a side effect of say the spline order being higher in the original fit, or something. But given the nearness of the resulting deviations to the tolerance used at spline construction, I think something may be being stored.

I also tried to recreate your result of re-fitting with the original tolerance, and getting a spline that differed from the (updated) initial spline. I didn't match your findings. So perhaps my very simple sketch gives a different result.
Edit Parent Skt of Fit Spline.PNG

Re: Determine the tolerance used to create an existing fit spline (bonus points for fit deviation)

Posted: Thu Feb 08, 2024 5:46 pm
by ryan-feeley
Random aside. I agree with Josh that this isn't relevant to the current question, but FYI
Any given feature either rebuilds or not... There's not a "rebuild-ier" rebuild to make any given feature "try harder".
This is supposed to be true, and is a good mental model. However, it isn't precisely true in practice. The iterative solvers need an initial condition, and the result can vary depending on the initial condition. Successive forced rebuilds do perturb those initial conditions. It isn't quite "try harder", but it can have that sort of effect.

I've had models where a delicate feature (say a parting line draft or hold-line C2 fillet) would consistently fail on the 3rd or 4th successive CTRL+Q. I've also have models that would pass the stringent solid/surface "check" most of the time, but again on say one CTRL+Q out of five, would display a "general body fault". I only see this sort of thing when I'm deep in the weeds of surfacing -- and typically using an approach that I'll ultimately discard -- but it can happen. It's exceedingly frustrating to debug.