Units
Revision as of 12:48, 29 October 2024 by LabRPS (talk | contribs) (Created page with "{{TOCright}} Some reading about units: *[http://en.wikipedia.org/wiki/Metrology Metrology] *[http://en.wikipedia.org/wiki/International_System_of_Units SI system] *[http://en.wikipedia.org/wiki/Imperial_units Imperial units] *[http://en.wikipedia.org/wiki/SI_derived_unit SI derived units] *[http://en.wikipedia.org/wiki/Degree_%28angle%29 angle units] *[https://github.com/3drepo/occt/blob/master/src/UnitsAPI/Units.dat unit implemented in OCC] == Examples == {{Code|cod...")
Some reading about units:
Examples
# -- some examples of the LabRPS unit translation system -- # make a shortcut for the examples pq = LabRPS.Units.parseQuantity # 10 meters in internal numbers pq('10 m') # doing math pq('3/8 in') # combined stuff pq('100 km/h') # transfer to other units pq('100 km/h')/tu('m/s') # derived units (Ohm) pq('m^2*kg*s^-3*A^-2') # or pq('(m^2*kg)/(A^2*s^3)') # angles pq('2*pi rad') # full circle # as gon pq('2*pi rad') / tu('gon') # more imperial tu('1ft (3+7/16)in') # or pq('1\' (3+7/16)"') # the ' we have to escape because of python # trigonometry pq('sin(pi)')
Supported units
A complete list of all supported units can be found here.
See Also
- The Expressions page for a list of all known units.
- The documentation of Quantity.
- The Std UnitsCalculator tool.
Power user documentation
- LabRPS scripting: Python, Introduction to Python, Python scripting tutorial, LabRPS Scripting Basics
- Modules: Units, Quantity
- Workbenches: Gui Commands, Commands
- Parametric objects: Scripted objects, Viewproviders
- Graphical interface: Interface creation, Interface creation completely in Python, PySide, PySide examples beginner, intermediate, advanced
- Macros: Macros, How to install macros
- Other: Expressions
- Hubs: User hub, Power users hub, Developer hub