Has Sketchup tolerances changed in 2018?

I read here about LayOut now has precision to match Sketchup of 0.000001" (inches). I thought Sketchup had precision of 0.001" (1/1000th of an inch). When did this change? Is is documented anywhere in the developer docs? Am I getting confused with the concept of tolerances?

I am of the opinion that the precision value ought to be accessible as a variable (I suppose constant) in the C API and Ruby API. Having a change of precision can have an impact on some plugins (mine at least), and keeping a plugin compatible across several versions of Sketchup becomes harder without knowing the precision of each version of SU.

SketchUp uses a thousand of an inch as precision for its unit tests at least https://github.com/SketchUp/testup-2/blob/master/src/testup/sketchup_test_utilities.rb.

I’m thinking the LO precision is maybe meant to match the SU precision when the model view is scaled down, e.g. by a factor of 100 (1:100).

From the Sketchup blog:

We’ve improved the way LayOut calculates measurements, so it can now display dimensions as precisely as SketchUp can model: up to 0.000001 inches.

Eneroth, when you say 1/1000th of an inch for “unit tests”, is that to say that an operation of say (Point3D == Point3D) will return true if they are different by less than 0.0005" (1/2000th")?

The statement from the blog makes it clear that SketchUp is precise to 1,000,000th of an inch. So tolerances and precision are different concepts, I guess? Would be great to have a SketchUp developer clear this up.

It says it can display dimensions as precisely as…

That’s not talking about internal tolerances of the program.

It’s only talking about how many places to the right of the decimal dimensions can show. In previous versions of LayOut, that was limited to only 3 places.

I think it means that two points differing by 1/1000" are seen as the same but I’m not sure. I’ve never fully made sense of the precision/tolerance.

…but it also says that Sketchup can model up to a precision of 0.000001 inches.

This is important to me in my plugin, which among other things uses a polygon merging algorithm which only takes integer coordinates, so I have to scale from the doubles (decimal) coordinates taking the precision (or tolerance!) of SketchUp into account.

Do you think I am right in the following assumptions:

  • all vertices are accurate to 0.000001 inches (precision), and SketchUp can model them and display them at that precision
  • when two vertices are within 0.001 inches (tolerance) of each other, SU merges them into one vertex (which vertex coordinate to use in this case?)
  • the vertices of a face can be off the face plane by up to 0.001 inches - otherwise, the face would be triangulated further.
  • In the Ruby API: Vector3D == Vector3D and Point3D == Point3D return true if they are within 0.001 inches of each other (actually to be precise, they would have to be 0.0005 inches of each other).

I haven’t seen any changes in SketchUp’s ability to create tiny faces. If the vertices are too close together edges won’t be formed and there’ll be holes in the surface. Those short edges and faces can exist but SketchUp doesn’t make them. The the reason for the “Dave Method” as described by Box in his tutorial.

Assumptions are dangerous.

I would recommend test all these cases in code and see what happens. When vertices merges I’d suspect the oldest one (the one first in the file) is premiered, but I wouldn’t assume it without testing.

Tommy, Dave is correct (and Julia is using the wrong terms above.)

(1) Precision and Tolerance are two separate but related things.
For example in the title block of the standard ANSI drawing form, is a Tolerance sub-form in which several tolerances can be specified for different precisions (as well as an angular tolerance.)

(2) The blog statement is incorrect, and someone should have asked the SketchUp side of the office to proofread it before publication.

(The blog post reads like marketing hype and reflects poorly on the writer, the team and the product. If a company is going produce a product for engineers, … get your engineering terms correct.)

From a recent thread in the GitHub API Issue Tracker database, I repost my test of SketchUp edge lengths …


m = Sketchup.active_model.entities

smallest 1 dimension edges:

e = m.add_line([ 0, 0, 0 ],[ 0.001, 0.0, 0.0 ])
#=> 0.001

smallest 2 dimension edges:

e = m.add_line([ 0, 0, 0 ],[ 0.0007072, 0.0007071, 0.0 ])
#=> 0.001

smallest 3 dimension edges:

SketchUp silently fails to create an edge …

e = m.add_line([ 0, 0, 0 ],[ 0.0005, 0.0005, 0.0005 ])
#=> nil

… but does create an edge here:

e = m.add_line([ 0, 0, 0 ],[ 0.0006, 0.0006, 0.0006 ])
#=> 0.0015588457268119896
# This is the result of trig (pythagorean theorem.)
#=> 0.0009
#=> 0.0009
#=> 0.0009

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.