Skip to content

AskFeatures

Request

AskFeatures is a request object used to extract features from a technical drawing. Features may include geometric elements, annotations, dimensions, and other key components essential for understanding the drawing.

Qualifiers written next to a dimension or a radius come back as flags on it: a bolt circle (PCD 80, LK Ø 120) sets is_pitch_circle_diameter, and TYP, INT, EXT and ALL AROUND set is_typical, is_internal, is_external and is_circulating (see Dimension and Radius).

Features a drawing specifies by a standard rather than by size are reported in their own lists: thread undercuts and relief grooves in undercuts (DIN 76-B, DIN 509-E0,8x0,3), slots for parallel keys in key_slots (DIN 6885 A 8x7x56) and center holes in center_holes (DIN 332-A 2,5x5,3).

Fasteners the drawing specifies are reported in fasteners: press-in nuts, studs and standoffs (3x PEM CLS-M4-2, Einpressmutter M5), weld nuts and weld studs (4x DIN 929 M12, 6x Schweißbolzen M6x15), threaded inserts, rivet nuts, and screws, nuts and washers named by their standard (ISO 4762 M6x20). A fastener listed in the bill of material carries the same description in its row's fastener field (see BillOfMaterialRow).

Example Usage

1
2
3
from werk24 import AskFeatures, read_example_drawing

read_example_drawing([AskFeatures()])

Response

Bases: Response

Represents an Response to a request for features of a mechanical component drawing from the server. It contains extracted features from the technical drawing, providing structured data for further processing.

PARAMETER DESCRIPTION
ask_version

TYPE: Literal['v2'] DEFAULT: 'v2'

ask_type

TYPE: Literal[<AskType.FEATURES: 'FEATURES'>] DEFAULT: <AskType.FEATURES: 'FEATURES'>

page_type

TYPE: Literal[<PageType.COMPONENT_DRAWING: 'COMPONENT_DRAWING'>] DEFAULT: <PageType.COMPONENT_DRAWING: 'COMPONENT_DRAWING'>

bores

Bore specifications for the component (e.g., Ø6 H7 (+0.012/0) ↧13.4, 6x Ø3.3 ↧12.0 ⌵ Ø3.3x45° M4×0.7—6H/6g×8.0).

TYPE: List[Bore] DEFAULT: <dynamic>

chamfers

Chamfer specifications for the component (e.g., 3 x 45°, 4x 0.031 x 45.00° TYPICAL).

TYPE: List[Chamfer] DEFAULT: <dynamic>

dimensions

Dimension details for the component (e.g, 5 ±0.3, Ø30, □5).

TYPE: List[Dimension] DEFAULT: <dynamic>

gdnts

Geometric dimensioning and tolerancing (GD&T) details (e.g., [◎|Ø0.02|A-B]).

TYPE: List[GDnT] DEFAULT: <dynamic>

radii

Radius specifications for the component (e.g., R5).

TYPE: List[Radius] DEFAULT: <dynamic>

roughnesses

Additional surface roughness details beyond general roughness. (e.g., √URa 12.5)

TYPE: List[Roughness] DEFAULT: <dynamic>

threads

Thread specifications for the component (e.g., M5×0.8—6g/6H, 0.25—20 UNC—2A).

TYPE: List[ThreadISOMetric | ThreadSM | ThreadUTS | ThreadACME | ThreadWhitworth | ThreadKnuckle | ThreadNPT] DEFAULT: <dynamic>

undercuts

Thread undercuts and relief grooves specified by standard (e.g., DIN 76-B, DIN 509-E0,8x0,3).

TYPE: List[Undercut] DEFAULT: <dynamic>

key_slots

Slots for parallel (feather) keys specified by standard (e.g., DIN 6885 A 8x7x56).

TYPE: List[KeySlot] DEFAULT: <dynamic>

center_holes

Center holes specified by standard (e.g., DIN 332-A 2,5x5,3).

TYPE: List[CenterHole] DEFAULT: <dynamic>

slots

Elongated holes with round ends (e.g., 3x Langloch Ø 10, 2x Langloch 14x15).

TYPE: List[Slot] DEFAULT: <dynamic>

retaining_ring_grooves

Grooves for retaining rings on a shaft or in a bore (e.g., DIN 471 30x1,5, DIN 472 42x1,75).

TYPE: List[RetainingRingGroove] DEFAULT: <dynamic>

fasteners

Fasteners the drawing specifies, such as press-in nuts, weld nuts, weld studs and screws (e.g., 3x PEM CLS-M4-2, 4x DIN 929 M12).

TYPE: List[Fastener] DEFAULT: <dynamic>

Source code in werk24/models/v2/responses.py
class ResponseFeaturesComponentDrawing(Response):
    """
    Represents an Response to a request for features of a mechanical component drawing from the server.
    It contains extracted features from the technical drawing, providing structured data for further processing.
    """

    ask_type: Literal[AskType.FEATURES] = AskType.FEATURES
    page_type: Literal[PageType.COMPONENT_DRAWING] = PageType.COMPONENT_DRAWING

    bores: List[Bore] = Field(
        default_factory=list,
        description="Bore specifications for the component (e.g., `Ø6 H7 (+0.012/0) ↧13.4`, `6x Ø3.3 ↧12.0 ⌵ Ø3.3x45° M4×0.7—6H/6g×8.0`).",
    )
    chamfers: List[Chamfer] = Field(
        default_factory=list,
        description="Chamfer specifications for the component (e.g., `3 x 45°`, `4x 0.031 x 45.00° TYPICAL`).",
    )
    dimensions: List[Dimension] = Field(
        default_factory=list,
        description="Dimension details for the component (e.g, `5 ±0.3`, `Ø30`, `□5`). ",
    )
    gdnts: List[GDnT] = Field(
        default_factory=list,
        description="Geometric dimensioning and tolerancing (GD&T) details (e.g., `[◎|Ø0.02|A-B]`).",
    )
    radii: List[Radius] = Field(
        default_factory=list,
        description="Radius specifications for the component (e.g., `R5`).",
    )
    roughnesses: List[Roughness] = Field(
        default_factory=list,
        description="Additional surface roughness details beyond general roughness. (e.g., `√URa  12.5`)",
    )
    threads: List[ThreadUnion] = Field(
        default_factory=list,
        description="Thread specifications for the component (e.g., `M5×0.8—6g/6H`, `0.25—20 UNC—2A`).",
    )
    undercuts: List[Undercut] = Field(
        default_factory=list,
        description="Thread undercuts and relief grooves specified by standard (e.g., `DIN 76-B`, `DIN 509-E0,8x0,3`).",
    )
    key_slots: List[KeySlot] = Field(
        default_factory=list,
        description="Slots for parallel (feather) keys specified by standard (e.g., `DIN 6885 A 8x7x56`).",
    )
    center_holes: List[CenterHole] = Field(
        default_factory=list,
        description="Center holes specified by standard (e.g., `DIN 332-A 2,5x5,3`).",
    )
    slots: List[Slot] = Field(
        default_factory=list,
        description="Elongated holes with round ends (e.g., `3x Langloch Ø 10`, `2x Langloch 14x15`).",
    )
    retaining_ring_grooves: List[RetainingRingGroove] = Field(
        default_factory=list,
        description="Grooves for retaining rings on a shaft or in a bore (e.g., `DIN 471 30x1,5`, `DIN 472 42x1,75`).",
    )
    fasteners: List[Fastener] = Field(
        default_factory=list,
        description="Fasteners the drawing specifies, such as press-in nuts, weld nuts, weld studs and screws (e.g., `3x PEM CLS-M4-2`, `4x DIN 929 M12`).",
    )

Example Response

{
    "ask_version": "v2",
    "ask_type": "FEATURES",
    "page_type": "COMPONENT_DRAWING",
    "dimensions": [
        {
            "reference_id": 0,
            "label": "12 ±0.1",
            "confidence": {
                "score": "0.96"
            },
            "quantity": 1,
            "size": {
                "value": "12",
                "unit": "mm",
                "size_type": "LINEAR",
                "tolerance": {
                    "tolerance_grade": "12",
                    "deviation_lower": "-0.1",
                    "deviation_upper": "0.1",
                    "fit": null,
                    "is_theoretically_exact": false,
                    "is_reference": false,
                    "is_general_tolerance": false,
                    "is_approximation": false
                }
            },
            "is_pitch_circle_diameter": false,
            "is_typical": false,
            "is_internal": false,
            "is_external": false,
            "is_circulating": false
        },
        {
            "reference_id": 41,
            "label": "Ø120 PITCH CIRCLE DIAMETER",
            "confidence": {
                "score": "0.94"
            },
            "quantity": 1,
            "size": {
                "value": "120",
                "unit": "mm",
                "size_type": "DIAMETER",
                "tolerance": null
            },
            "is_pitch_circle_diameter": true,
            "is_typical": false,
            "is_internal": false,
            "is_external": false,
            "is_circulating": false
        }
    ],
    "threads": [
        {
            "reference_id": 1,
            "label": "M5×0.8—6g/6H",
            "thread_type": "ISO_METRIC",
            "quantity": 1,
            "diameter": "5",
            "spacing": {
                "pitch_in_mm": "0.8",
                "threads_per_inch": "31.75"
            },
            "handedness": "RIGHT",
            "depth": null,
            "confidence": {
                "score": 0.95
            }
        }
    ],
    "bores": [
        {
            "reference_id": 2,
            "label": "Ø6 H7 (+0.012/0) ↧13.4",
            "quantity": 1,
            "counterbore": null,
            "countersink": null,
            "counterdrill": null,
            "diameter": {
                "size_type": "DIAMETER",
                "value": "6",
                "tolerance": {
                    "deviation_lower": "0",
                    "deviation_upper": "0.012",
                    "tolerance_grade": "7",
                    "fit": "H7",
                    "is_theoretically_exact": false,
                    "is_reference": false,
                    "is_general_tolerance": false,
                    "is_approximation": false
                },
                "unit": "mm"
            },
            "depth": {
                "depth_type": "SIZE",
                "value": "13.4",
                "tolerance": null,
                "unit": "mm"
            },
            "thread": null,
            "confidence": {
                "score": 0.94
            }

        }
    ],
    "chamfers": [
        {
            "reference_id": 3,
            "label": "1 x 45°",
            "quantity": 1,
            "size": {
                "size_type": "LINEAR",
                "value": "1",
                "tolerance": {
                    "deviation_lower": null,
                    "deviation_upper": null,
                    "tolerance_grade": null,
                    "fit": null,
                    "is_theoretically_exact": false,
                    "is_reference": false,
                    "is_general_tolerance": true,
                    "is_approximation": false
                },
                "unit": "mm"
            },
            "angle":{
                "size_type": "ANGULAR",
                "value": "45",
                "tolerance": {
                    "deviation_lower": null,
                    "deviation_upper": null,
                    "tolerance_grade": null,
                    "fit": null,
                    "is_theoretically_exact": false,
                    "is_reference": false,
                    "is_general_tolerance": true,
                    "is_approximation": false
                },
                "unit": "degree"
            }
        }
    ],
    "roughnesses": [
        {
            "reference_id": 4,
            "label": "○√",
            "confidence": {
                "score": "1.00"
            },
            "standard": "ISO 1302:2002",
            "machining_allowance": null,
            "material_removal_type": "PROHIBITED",
            "applies_all_around": false,
            "direction_of_lay": null,
            "manufacturing_process": "",
            "conditions": [],
            "waviness": null
        }
    ],
    "gdnts": [
        {
            "reference_id": 26,
            "label": "[⟂|0.5|A]",
            "confidence": {
                "score": "0.98"
            },
            "characteristic": "⟂",
            "zone": {
                "value": {
                    "value": "0.5",
                    "unit": "mm",
                    "size_type": "LINEAR",
                    "tolerance": null
                },
                "extend": null,
                "combination": null,
                "offset": null,
                "constraint": null
            },
            "feature": null,
            "reference": null,
            "material_condition": null,
            "state": null,
            "datums": [
                {
                    "label": "A"
                }
            ]
        }
    ],
    "radii": [
        {
            "reference_id": 35,
            "label": "R7 0/-0.5",
            "confidence": {
                "score": "0.96"
            },
            "quantity": 1,
            "curvature_type": null,
            "size": {
                "value": "7",
                "unit": "mm",
                "size_type": "LINEAR",
                "tolerance": {
                    "tolerance_grade": "14",
                    "deviation_lower": "-0.5",
                    "deviation_upper": "0",
                    "fit": null,
                    "is_theoretically_exact": false,
                    "is_reference": false,
                    "is_general_tolerance": false,
                    "is_approximation": false
                }
            },
            "is_typical": false,
            "is_circulating": false
        }
    ],
    "undercuts": [
        {
            "reference_id": 36,
            "label": "DIN 509-E0,8x0,3",
            "confidence": {
                "score": "0.93"
            },
            "quantity": 1,
            "undercut_type": "RELIEF_GROOVE",
            "standard": "DIN 509",
            "form": "E",
            "radius": {
                "value": "0.8",
                "unit": "mm",
                "size_type": "LINEAR",
                "tolerance": null
            },
            "depth": {
                "value": "0.3",
                "unit": "mm",
                "size_type": "LINEAR",
                "tolerance": null
            }
        }
    ],
    "key_slots": [
        {
            "reference_id": 37,
            "label": "DIN 6885 A 8x7x56",
            "confidence": {
                "score": "0.92"
            },
            "quantity": 1,
            "standard": "DIN 6885",
            "form": "A",
            "key_width": {"value": "8", "unit": "mm", "size_type": "LINEAR", "tolerance": null},
            "key_height": {"value": "7", "unit": "mm", "size_type": "LINEAR", "tolerance": null},
            "key_length": {"value": "56", "unit": "mm", "size_type": "LINEAR", "tolerance": null}
        }
    ],
    "center_holes": [
        {
            "reference_id": 38,
            "label": "2x DIN 332-A 2,5x5,3",
            "confidence": {
                "score": "0.94"
            },
            "quantity": 2,
            "standard": "DIN 332",
            "form": "A",
            "pilot_diameter": {"value": "2.5", "unit": "mm", "size_type": "DIAMETER", "tolerance": null},
            "outer_diameter": {"value": "5.3", "unit": "mm", "size_type": "DIAMETER", "tolerance": null},
            "requirement": null
        }
    ],
    "fasteners": [
        {
            "reference_id": 39,
            "label": "3x press-in nut PEM CLS-M4-2",
            "confidence": {
                "score": "0.97"
            },
            "fastener_type": "PRESS_IN_NUT",
            "designation": "PEM CLS-M4-2",
            "standard": null,
            "manufacturer": "PEM",
            "thread": {
                "reference_id": 39,
                "label": "M4",
                "confidence": {
                    "score": "0.97"
                },
                "thread_type": "ISO_METRIC",
                "quantity": "1",
                "diameter": {"value": "4", "unit": "millimeter", "size_type": "DIAMETER", "tolerance": null},
                "spacing": {
                    "pitch_in_mm": "0.7",
                    "threads_per_inch": "36.286"
                },
                "handedness": "RIGHT",
                "depth": null
            },
            "length": null,
            "quantity": 3,
            "note": null
        },
        {
            "reference_id": 40,
            "label": "6x weld stud M6x15",
            "confidence": {
                "score": "0.96"
            },
            "fastener_type": "WELD_STUD",
            "designation": null,
            "standard": null,
            "manufacturer": null,
            "thread": {
                "reference_id": 40,
                "label": "M6",
                "confidence": {
                    "score": "0.96"
                },
                "thread_type": "ISO_METRIC",
                "quantity": "1",
                "diameter": {"value": "6", "unit": "millimeter", "size_type": "DIAMETER", "tolerance": null},
                "spacing": {
                    "pitch_in_mm": "1",
                    "threads_per_inch": "25.4"
                },
                "handedness": "RIGHT",
                "depth": null
            },
            "length": {"value": "15", "unit": "millimeter", "size_type": "LINEAR", "tolerance": null},
            "quantity": 6,
            "note": "nach innen zeigend"
        }
    ]
}