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

Use this space to ask how to do whatever you're trying to use SolidWorks to do.
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 90

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

Unread post 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?
by JSculley » Mon Jan 29, 2024 3:34 pm
I don't think it can be accessed. There is an SPR requesting the ability to see/change it:
image.png
Go to full post
User avatar
JSculley
Posts: 638
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 868

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

Unread post by JSculley »

I don't think it can be accessed. There is an SPR requesting the ability to see/change it:
image.png
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 90

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

Unread post by ryan-feeley »

Thanks Jim! Well that answers that. I'll keep using my hacks.
User avatar
josh
Posts: 293
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 500

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

Unread post 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.
User avatar
Arthur NY
Posts: 197
Joined: Sat Mar 27, 2021 12:32 pm
Answers: 1
x 40
x 175

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

Unread post 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.
User avatar
josh
Posts: 293
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 500

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

Unread post 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".
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 90

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

Unread post 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
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 90

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

Unread post 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.
Post Reply