Measures¶
DIN 406-11 defines the valid measure systems in Technical Drawings. While we are acutely aware there are different conventions across different geographies and industries, we use the DIN naming conventions as a solid basis and "map" the different conventions used in your Technical Drawings into the conventions that the DIN standardization organization suggests.
Overview Measure Systems¶
There are probably as many ways to define Measures as there are Drafters. We do our best to interpret as many as possible and return them to you in a consistent way. Below, table gives you a brief overview of the most common measure systems. This solely provides an overview of the most frequently used measure systems. We handle the complexity for you and return the same response, independently of which measure system the drafter chose.
Method 1 (mainly European) | Method 2 (mainly US-American) | Diameter Measures | Chain Measures | Ascending Measures |
---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() |
DIN 406-11 defines two methods for annotating simple measures. In Method 1, the measure labels are following the two main reading directions: (i) bottom up and (ii) from left to right. This method is mainly used in European countries. | Method 2 allows the drafter to draw all labels parallel to the title block. This is mainly used in the United States of America. | Diameter Measures can be annotated with only one measure arrow and can be located at the inside or outside of the element. We look at the drawing and find the most likely interpretation for you. | Chain measures can improve the readability of the drawings by using the same measure line for adjacent measures. | The ascending dimensioning system is typically chosen when the number of measures increases further and space becomes a problem. The system works similar to a measuring tape by defining an origin and annotating the distance of a whole range of points from this origin. |
Models¶
The data models are defined in the following models:
-
Requesting the Measures: W24AskVariantMeasures
-
Receiving the Measures: W24AskVariantMeasuresResponse
-
Processing the Measures: W24Measure
Extracted information can be accessed from the W24Measure
Model.
W24Measure¶
Measure object
Attributes:
measure_id: Unique UUID4 identifier
label: Measure Label
warnings: List of Warnings that are associated with the
measure. See W24MeasureWarning for details.
confidence: Werk24 calculates an internal confidence score for
each measure. Depending on your use-case, you might want
to consider or discard low-confidence measures. This
value allows you to do so. The value ranges from
0.0 to 1.0
Properties¶
-
position
: Refer to #/definitions/W24BaseFeaturePosition. -
measure_id
(string) -
label
: Refer to #/definitions/W24MeasureLabel. -
warnings
(array): Default:[]
. -
Items: Refer to #/definitions/W24MeasureWarning.
-
confidence
(number): Default:0.0
.
Definitions¶
-
W24BaseFeatureCoordinate
(object): Coordinate point
Attributes: x: x position normalized by the thumbnail's width
y: y position normalized by the thumbnail's height. -
x
(number) -
y
(number) -
W24BaseFeaturePosition
(object): Position of the Feature on the individual thumbnails normalized by the width and height of each thumbnail.
Each features position is indicated as a list of coordinates. If the list only has two elements, you are dealing with a line. If it has four or more, you are looking at a polygon
Attributes: page: Position of the Feature on the Page thumbnail
sheet: Position of the Feature on the Sheet thumbnail
sectional: Position of the Feature on the Sectional thumbnail. -
sheet
(array)- Items: Refer to #/definitions/W24BaseFeatureCoordinate.
-
canvas
(array)- Items: Refer to #/definitions/W24BaseFeatureCoordinate.
-
sectional
(array)- Items: Refer to #/definitions/W24BaseFeatureCoordinate.
- W24SizeType
(string): Enumeration class for W24 size types.
Attributes:¶
NOMINAL (str): Nominal size type. DIAMETER (str): Diameter size type. WIDTH_ACROSS_FLATS (str): Width across flats size type. Must be one of: ['NOMINAL', 'DIAMETER', 'SPHERICAL_DIAMETER', 'WIDTHS_ACROSS_FLATS', 'SQUARE']
.
W24UnitLength
(string): Enum of the supported length units . Must be one of:['METER', 'DECIMETER', 'CENTIMETER', 'MILLIMETER', 'FOOT', 'INCH', 'MICRO_INCH']
.
- W24Size
(object): Abstract Base Class for the Sizes.
Attributes:¶
blurb: A blurb for human consumption.
size_type: The type of size for deserialization.
nominal_size: The unit-less nominal size. The unit is attached to the parent object, which also defines the toleration.
unit: Unit of the measure if known. This should typically be inch or millimeter. In some cases it might be possible that the units are unknown.
-
blurb
(string) -
size_type
: Refer to #/definitions/W24SizeType. -
nominal_size
(number) -
unit
: Refer to #/definitions/W24UnitLength. -
W24Tolerance
(object): Abstract Base Class to cover the Tolerances.
Attributes: blurb (str): String representation for human consumption
toleration_type (W24SizeToleranceType): Toleration Type for deserialization. -
blurb
(string) -
toleration_type
(string) -
W24ThreadType
(string): Enum for the individual thread types
NOTE: UTS_COARSE, UTS_FINE, UTS_EXTRAFINE and UTS_SPECIAL as individual types will be deprecated. Their information individualthreads_per_inch
information will be stored in the corresponding variable. Must be one of:['ISO_METRIC', 'WHITWORTH', 'UTS', 'UTS_COARSE', 'UTS_FINE', 'UTS_EXTRAFINE', 'UTS_SPECIAL']
. -
W24ThreadHandedness
(string): Enum describing the direction of the thread. Must be one of:['LEFT', 'RIGHT']
. -
W24ThreadMultiStart
(object): Multi-Start Thread Information
A common example of multi-start threads are the cap on a plastic water bottle. The cap will screw on quickly because a multi-start thread.
Attributes:
thread_lead (Decimal, optional): Thread lead for multiple starts
number_of_starts (int): Number of intertwined threads running in parallel to one another. -
thread_lead
(number) -
number_of_starts
(integer): Default:1
. -
W24Thread
(object): Abstract Base Class for all Threads
Attributes: blurb (str): String representation of the thread for human consumption
diameter (Decimal): Diameter of the thread
diameter_preference: Not all Threads are made equal. The standardization bodies assign different preferences to the different thread diameters.
unit (W24UnitLength): Length unit of the diameter. This allows you to differentiate between inch and millimeter (UTS or ISO METRIC). NOTE: Whitworth inch are not 2.54mm long! (for historic reasons). Use the whitworth_size if you need to have the Whitworth inches.
thread_type: thread type to facilitate deserialization
pitch: Pitch of the thread in mm. Normed range: 0.25 - 9mm The value will always be set - even if the pitch is give implicitly (e.g. M10c) or when the pitch is given in threads per inch. When the Pitch is ambiguous, this value be the median pitch
threads_per_inch: Pitch and Threads per inch are interchangeable concepts. Depending on your geographic focus, the one or the other concept is more suitable. We convert ISO pitches to UTS threads per inch and vice versa, so that you do not have to handle the conversion.
handedness: Left of right-handedness of the thread. This will be RIGHT unless explicitly described as LEFT in the drawing.
length (Decimal, optional): Length of the Thread if specified on the label (e.g., M15x1x20). None otherwise. NOTE: If the thread length is not specified in the label, you can still obtain the information from the W24ThreadElement NOTE: If the thread label specifies both a thread length and a bore length, only the thread length will be included here. The bore length can be found in the W24MeasureElement.depth attribute. -
blurb
(string) -
diameter
(number) -
unit
: Default:MILLIMETER
. -
thread_type
: Refer to #/definitions/W24ThreadType. -
pitch
(number) -
threads_per_inch
(number) -
handedness
: Default:RIGHT
. -
multi_start
: Refer to #/definitions/W24ThreadMultiStart. -
length
(number) -
W24UnitAngle
(string): Enum of all the supported angle units
NOTE: currently we are only supporting degrees. If you come across a drawing that uses GON, let us know, we love the concept! Must be one of:['DEGREE']
. -
W24Chamfer
(object): Chamfer in degree.
Attributes: blurb: String representation for human consumption
angle: Chamfer angle in degrees
unit: Angle Unit. Currently only degrees are supported.
!!! note The chamfers can be tolerated. Future implementations will take this into account. -
blurb
(string) -
angle
(number) -
unit
: Default:DEGREE
. -
W24DepthThroughType
(string): Through Type specified on ASME drawings. . Must be one of:['THRU', 'THRU_ALL']
. -
W24Depth
(object): Depth object that describes the details of the depth of a drilling or thread
Attributes: blurb: String for human consumption
depth: Depth of the drilling or thread in the units of the parent object. -
blurb
(string) -
depth
(number) -
through_type
: Refer to #/definitions/W24DepthThroughType. -
W24TestCriticality
(string): An enumeration. Must be one of:['CTD', 'CTF', 'CTP', 'CTQ', 'CTS']
. -
W24TestDimension
(object): Test Dimension attributes that can either be attached to a MeasureLabel or a GDTLabel
Attributes: blurb: Blurb of the complete label for human consumption
criticality: Some measures can be critical to Function, others critical to price. The TestDimensions sometimes highlight this with a shorthand (e.g., CTF)
rate: Test rate as percentage. If a 100% inspection rate has been defined, rate will be Decimal('100'). If not defined, the rate will be None. -
blurb
(string) -
criticality
: Refer to #/definitions/W24TestCriticality. -
rate
(number) -
W24MeasureLabel
(object): Measure Label
Attributes:
blurb: String representation of the item for human consumption
quantity: Quantity for spacings, e.g., (2x). Currently only the indicated measure will be detected and returned. Future implementation could detect the spacings and return individual measures for the respective spacings. When we implement this feature, we will add an attribute to the ASK, which allows you to control the behavior.
size: Size of measure as referred to in the drawing. Sizes are always associated with units! This becomes important to remember when you are dealing with mixed-unit drawings (e.g., an adapter bolt that has an ISO thread and an UTC tapped hole). To avoid any loss of precision, we return the size in the unit that was indicated on the drawing.
size_tolerance: Tolerance details. Default: General tolerances. By default we are referring to the general tolerances of the drawing. When you are also requesting the TitleBlock, we are attaching the applicable General Tolerances (assuming they were understood) to the measure. This will consider the nominal size of the measure. If the W24MeasureLabel describes a "Theoretically Exact Measure", i.e, the label is surrounded by a box, like: "[15]", the size_tolerance refers to a W24ToleranceTheoreticallyExact object (and is NOT None)
unit: Length unit of the size. This information is only available when you request the TitleBlock as well; as only the title block will allow us to determine the geographic origin of the drawing.
thread: Optional thread details. The thread details describe the complete thread description and follow the respective standards. In consequence, the thread diameter of an ISO-thread will be indicated in millimeter, while the thread diameter of an UTS thread will be in inch.
chamfer: Optional Chamfer
depth: Depth of the drilling or thread. Uses the same dimensions. -
blurb
(string) -
quantity
(integer): Default:1
. -
size
: Refer to #/definitions/W24Size. -
size_tolerance
: Default:{'blurb': '', 'toleration_type': 'GENERAL_TOLERANCES', 'standard': None, 'standard_class': None, 'deviation_lower': None, 'deviation_upper': None, 'tolerance_grade': None}
. -
unit
: Refer to #/definitions/W24UnitLength. -
thread
: Refer to #/definitions/W24Thread. -
chamfer
: Refer to #/definitions/W24Chamfer. -
depth
: Refer to #/definitions/W24Depth. -
test_dimension
: Refer to #/definitions/W24TestDimension. -
W24MeasureWarningType
(string): List of all warnings that can be associated with the returned measures. Must be one of:['UNCONVENTIONAL_TOLERANCE_ORDER', 'UNPROPORTIONAL']
. -
W24MeasureWarning
(object): Warnings are issued when something about the label or measure is not conforming with convention. -
warning_type
: Refer to #/definitions/W24MeasureWarningType.
Requesting the Measures¶
from werk24 import Hook, W24AskVariantMeasures
from werk24.models.techread import W24TechreadMessage
from werk24.utils import w24_read_sync
# define a function to read a file and return it as bytes
from . import get_drawing_bytes
def recv_measures(message: W24TechreadMessage) -> None:
""" print the Measures when we received them
"""
if message.is_successful:
print(message.payload_dict)
else:
print("Exceptions occurred: {message.exceptions}")
if __name__ == "__main__":
# get your drawing bytes from a file or buffer
drawing_bytes = get_drawing_bytes()
# define what information you want to receive from the API
# and what shall be done when the info is available.
hooks = [Hook(ask=W24AskVariantMeasures(), function=recv_measures)]
# submit the request to the Werk24 API
w24_read_sync(drawing_bytes, hooks)
Example Response¶
{
"variant_id": "585b4002-6371-4e49-8d2c-3a0f3c0a66e8",
"sectional_id": "0aa77b6f-18c0-4671-af78-6cdf8b0fb173",
"measures": [
{
"measure_id": null,
"line": [
[
0.9871959026888605,
0.06939281288723669
],
[
0.009603072983354673,
0.06939281288723669
]
],
"label": {
"blurb": "194",
"quantity": 1,
"size": {
"blurb": "194",
"size_type": "NOMINAL",
"nominal_size": 194.0
},
"unit": "MILLIMETER",
"size_tolerance": {
"toleration_type": "GENERAL_TOLERANCES",
"blurb": ""
},
"thread": null,
"chamfer": null
},
"warnings": [],
"confidence": 0.9399190327750098
},
{
"measure_id": null,
"line": [
[
0.6811779769526248,
0.6852540272614622
],
[
0.15172855313700384,
0.6852540272614622
]
],
"label": {
"blurb": "(INSP|105.1 +0.1/-0.1|N/A)",
"quantity": 1,
"size": {
"blurb": "105.1",
"size_type": "NOMINAL",
"nominal_size": 105.1
},
"unit": "MILLIMETER",
"size_tolerance": {
"toleration_type": "OFF_SIZE",
"blurb": "\u00b10.1",
"deviation_lower": -0.1,
"deviation_upper": 0.1
},
"thread": null,
"chamfer": null
},
"warnings": [],
"confidence": 0.7165165922654457
},
{
"measure_id": null,
"line": [
[
0.6811779769526248,
0.25154894671623296
],
[
0.529449423815621,
0.25154894671623296
]
],
"label": {
"blurb": "(INSP|30.2 +0.1/0|N/A)",
"quantity": 1,
"size": {
"blurb": "30.2",
"size_type": "NOMINAL",
"nominal_size": 30.2
},
"unit": "MILLIMETER",
"size_tolerance": {
"toleration_type": "OFF_SIZE",
"blurb": "-0/0.1",
"deviation_lower": -0.0,
"deviation_upper": 0.1
},
"thread": null,
"chamfer": null
},
"warnings": [],
"confidence": 0.892163023720418
},
{
"measure_id": null,
"line": [
[
0.9583866837387964,
0.9491945477075588
],
[
0.6811779769526248,
0.9491945477075588
]
],
"label": {
"blurb": "(INSP|55 +0.1/-0.1|N/A)",
"quantity": 1,
"size": {
"blurb": "55",
"size_type": "NOMINAL",
"nominal_size": 55.0
},
"unit": "MILLIMETER",
"size_tolerance": {
"toleration_type": "OFF_SIZE",
"blurb": "\u00b10.1",
"deviation_lower": -0.1,
"deviation_upper": 0.1
},
"thread": null,
"chamfer": null
},
"warnings": [],
"confidence": 0.8775596704502485
},
{
"measure_id": null,
"line": [
[
0.6811779769526248,
0.5662949194547707
],
[
0.2496798975672215,
0.5662949194547707
]
],
"label": {
"blurb": "(INSP|85.7 +0.1/-0.1|N/A)",
"quantity": 1,
"size": {
"blurb": "85.7",
"size_type": "NOMINAL",
"nominal_size": 85.7
},
"unit": "MILLIMETER",
"size_tolerance": {
"toleration_type": "OFF_SIZE",
"blurb": "\u00b10.1",
"deviation_lower": -0.1,
"deviation_upper": 0.1
},
"thread": null,
"chamfer": null
},
"warnings": [],
"confidence": 0.697752746667218
},
{
"measure_id": null,
"line": [
[
0.6811779769526248,
0.80545229244114
],
[
0.009603072983354673,
0.80545229244114
]
],
"label": {
"blurb": "(INSP|133.3 +0.2/-0.2|N/A)",
"quantity": 1,
"size": {
"blurb": "133.3",
"size_type": "NOMINAL",
"nominal_size": 133.3
},
"unit": "MILLIMETER",
"size_tolerance": {
"toleration_type": "OFF_SIZE",
"blurb": "\u00b10.2",
"deviation_lower": -0.2,
"deviation_upper": 0.2
},
"thread": null,
"chamfer": null
},
"warnings": [],
"confidence": 0.7781219167768586
}
]
}