TechDraw Geometric dimensioning and tolerancing: Difference between revisions

From FreeCAD Documentation
(more info)
(→‎Formatting: more info)
Line 36: Line 36:
# The property {{PropertyData|FormatSpec}} contains the format specifier, so change it to what you need
# The property {{PropertyData|FormatSpec}} contains the format specifier, so change it to what you need


The syntax of the format specifier is [https://www.cplusplus.com/reference/cstdio/printf/ explained here].
The syntax of the format specifier is [https://www.cplusplus.com/reference/cstdio/printf/ explained here]. You can also use [https://onlinetexttools.com/printf-text this online tool] to see what formatting specifier will format numbers.


'''Examples:'''
'''Examples:'''
* You use 2 decimals but for an angle you want to have only one decimal use the format specifier ''%.1f''.
* You use 2 decimals but for an angle you want to have only one decimal use the format specifier ''%.1f''.
* You use 2 decimals but don't like that zeroes are printed. So you prefer ''4'' instead of ''4.00''. Then use this format specifier: ''%g''. The 'g' will use the shortest possible output and thus it omits trailing zeroes. Moreover it will automatically switch to [https://en.wikipedia.org/wiki/Scientific_notation#E_notation scientific notation]] if necessary..
* You use 2 decimals but don't like that trailing zeroes are printed (you prefer ''4'' instead of ''4.00''). Then use this format specifier: ''%g''. The 'g' will use the shortest possible output and thus it omits trailing zeroes. Moreover it will automatically switch to [https://en.wikipedia.org/wiki/Scientific_notation#E_notation scientific notation] if necessary.


==Tolerancing==
==Tolerancing==

Revision as of 23:24, 25 December 2020

This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

Overview

The main purpose of a technical drawing is that others understand what the designer created with what tolerances and material and how to manufacture the design. To achieve this the system of Geometric Dimensioning and Tolerancing (GD&T) was developed for defining and communicating engineering tolerances.

TechDraws' capabilities to fulfill the common GD&T standards is still limited (as of FreeCAD 0.19) but you can achieve already many things. This Wiki page will explain what is implemented and what tricks are useful.

Dimensioning

TechDraw provides several tools to create different types of dimension. Please have a look at the different dimension on how to create and modify them.

Formatting

The default format for new dimension numbers depends on the preferences options Use Global Decimals and Alternate Decimals. This specifies the number of decimals, but in every case the dimension is a floating point number. For example if the setting is to have 2 decimals, the used format specifier is "%.2f" (floating point number with 2 decimals).

The number format can be changed:

  1. Select a dimension in the tree
  2. Go to the properties tab Data and there to the section Format
  3. The property DataFormatSpec contains the format specifier, so change it to what you need

The syntax of the format specifier is explained here. You can also use this online tool to see what formatting specifier will format numbers.

Examples:

  • You use 2 decimals but for an angle you want to have only one decimal use the format specifier %.1f.
  • You use 2 decimals but don't like that trailing zeroes are printed (you prefer 4 instead of 4.00). Then use this format specifier: %g. The 'g' will use the shortest possible output and thus it omits trailing zeroes. Moreover it will automatically switch to scientific notation if necessary.

Tolerancing

TechDraw allows you to add tolerances to every dimension.

Creation

  1. Create a dimension in your drawing
  2. Select the dimension