Skip to content

Image title

External Dimensions

Image title Obtaining the External Dimensions of a Part from a Technical Drawing can be challenging. A naive implementation would simply look for the largest measures on the drawing.

For most situations you need to go a lot further, e.g., when the width is the sum of several measures, or when the part contains a radius that lies outside the part. Take the image on the right for example. The naive implementation would yield a height of 65mm, while in reality it is only 30mm high. Check our blog article for more examples.

Another challenge is that turning parts are often illustrated with only one view. This requires us to make an educated guess on whether the illustrated part is a flat part or a lathe part. WERK24 handles all this complexity for your and returns two versions of the outer dimensions:

  • The Enclosing Cuboid (width x height x depth), and
  • The Enclosing Cylinder (diameter x depth)

Enclosing Cuboid

The enclosing cuboid (also described as bounding box) describes the cuboid necessary to enclose the part starting from the front view of the part in three dimensions:

  • width,
  • height, and
  • depth

Note

Width and height are chosen from the front view of the part. This implies that the resulting cuboid might not be minimal. Depending on the geometry, a smaller cuboid could be achieved by rotating the part.

Units

Werk24 returns the dimensions in the unit of the drawing. When there are multiple units, for example: "mm[inch]", in this case Werk24 returns the first unit, i.e. "mm".

Enclosing Cylinder

For lathe and lathe-mill parts, the enclosing cylinder might be a more suitable description of the part's geometry. WERK24 is also returning this information to you. It is described in two dimensions:

  • diameter, and
  • depth

Note

The orientation of the part is changed so that the view of the diameter describes the dimension with the hightest cylindricity. This implies that the orientation of the enclosing cylinder might be different from the orientation of the enclosing cuboid.

Note

The diameter of the enclosing cylinder automatically also describes the enclosing circle for aluminum profiles.

Confidence / Partial-Automation

Whenever possible, WERK24 tries to calculate the same result in at least two different ways. Its a concept similar to the Double-entry bookkeeping system (Wikipedia). This allows us to calculate a confidence value. Whenever the two (or more) models agree, we will yield a hight confidence score. When they disagree, the confidence value will be low, and you can trigger a manual check of the file.

Models

The data models are defined in the following models:

Requesting the External Dimensions

from werk24 import Hook, W24AskVariantExternalDimensions
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 request_ext_dimensions(drawing_bytes: bytes) -> None:
    """ Request the external dimensions """
    w24_read_sync(
        drawing_bytes,
        [Hook(ask=W24AskVariantExternalDimensions(), function=recv_ext_dimensions)]
    )


def recv_ext_dimensions(message: W24TechreadMessage) -> None:
    """ Called when the information is available """
    ...


if __name__ == "__main__":
    request_ext_dimensions(get_drawing_bytes())

Example Response

{
    "variant_id": "9553b581-3218-4ad7-b7a1-26eeea277513",
    "enclosing_cuboid": {
        "width": 23.0,
        "height": 26.8,
        "depth": 26.8
    },
    "enclosing_cylinder": {
        "diameter": 26.8,
        "depth": 23.0
    },
    "confidence": 0.9823201888708201
}