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.

Example Usage

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[str] DEFAULT: 'v2'

ask_type

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

page_type

TYPE: Literal[PageType] 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[Union[ThreadISOMetric, ThreadSM, ThreadUTS, ThreadACME, ThreadWhitworth, ThreadKnuckle, ThreadNPT]] 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`).",
    )

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
                }
            }
        }
    ],
    "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",
                "tolerance":null
            },
        }
    ],
    "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
                }
            }
        }
    ]
}