Open Eneroth3 opened 3 years ago
TT's article is a good start, but we should have this covered by official documentation/help documents.
https://www.thomthom.net/thoughts/2012/08/dealing-with-units-in-sketchup/
Every Cad app I have developed for has internal units. Sketchup has inches, Revit feet, Archicad meters, ... The only difference is that Sketchup uses a separate class, instead of just a number/double, which is especially confusing when serializing them.
That's good to know. I haven't developed for those but I know Rhino is "unitless" and I think AutoCad is too.
Serializing lengths is definitely worth mentioning in this article!
Yea, my article is also 8 years old and some of the features I described then as missing is now implemented. But we can lift most of it to a knowledge article in the docs and expand on it with up to date info.
The only difference is that Sketchup uses a separate class, instead of just a number/double, which is especially confusing when serializing them.
That along with the string conversion of Length
prints in model units, leading to confusing for some developers as they thing the values printed by Length#to_s
represent the underlying data value. We should emphases that Length#inspect
dumps the true value as it's stored.
We need an article to explain how to think of units in SketchUp. This can be presented similarly to #549.
SketchUp handles length in a quite different way from other programs. In most CAD programs it seems you are working with numeric values, and it is defined on model level what unit to use when reading those values as physical distances in space.
In SketchUp there is an internal unit, the inch. This can feel counter-intuitive to non-Americans, but also makes sense when you get used to it.
In most cases you don't need to think of what the internal unit is. Distances in space should be represented by the Length class. You can parse string input to it and format values for the UI from it. Generally you can think of the Length as being a physical distance in space, not a number and a unit.