Skip to content

Drawings: a flat pattern view of a sheet-metal part, with its bend lines (part of #860) #13030

Open

Description

@CamWight

Part of #860 (W37, sheet metal on drawings). It sits on the view work in #5866 (W07) and #4816 (W17).

Goal: a flat pattern view on a drawing. A drafter places the flat pattern of a sheet-metal part on a sheet, next to its folded views, with its bend lines (up and down drawn differently) and its overall size. Shops use this sheet to cut and fold the part.

What exists today

The slice

  • A flat pattern view of a sheet body (an option of drawing.view.base, or its own command): it draws the outline, the cut-outs and the bend lines from the flat pattern's exact curves, at the view's scale.
  • Bend lines: up and down in two line types. Their ends stop at the outline.
  • An option for bend notes beside each bend line (direction, angle, radius), from the same data the DXF bend notes use.
  • The view's orientation: as the flat pattern lies, or turned in 90° steps.
  • Dimensions on a flat view use the same commands as on other views.
  • The folded views and the flat view on one sheet keep their own scales.

Out of scope

Acceptance

  • A 100 × 60 × 2 mm sheet with one 90° flange gives a flat view whose outline measures the flat size that sheet.flat_pattern reports, to 1e-6 mm, at 1:1 and 1:2.
  • A round hole on the flat view is a circle of its exact diameter, not a polyline.
  • An up bend and a down bend are drawn in different line types. Each bend line ends on the outline.
  • Changing the flange height updates the flat view after an update.
  • A body that isn't sheet metal is refused with a clear message.
  • Hostile input never panics.

Activity

  1. added
    area:kernel
    needs-triage
    in progress
    on Nov 7, 2026
  2. github-actions commented on Nov 7, 2026

    @github-actions
    Contributor

    Claimed by @CamWight through #13033. The claim lapses after 14 days without pushes.

  3. CamWight commented on Nov 7, 2026

    @CamWight
    ContributorAuthor

    Plan

    A flat pattern view is a third kind of drawing view, next to base and projected views, with its own command, drawing.view.flat. It draws the flat pattern of one sheet-metal body at its own scale, turned in 90° steps.

    It reads only sheet.flat_pattern's reply. The scene draws with a read-only session, so cmd/sheet.rs gets one small read-only function that flat_pattern itself calls. Nothing else in the sheet-metal code changes. The sheet-metal rebuild (#9245) changes the same few lines. Whichever lands second moves that one call, and the view then draws the new model's flat with no other change. #12545's typed reply can replace the JSON later without touching the view.

    Slices

    1. FV1, the view (draft Drawings: a flat pattern view of a sheet-metal part, with its bend lines (#13030) #13033, into drawings).
      • drawing.view.flat {sheet, body?, scale?, position_mm?, turn?}: one undo step, saved as a new view kind (one pending format file). With no body, the last sheet body, as sheet.flat_pattern does.
      • Outline and cut-outs drawn as visible lines. Round holes and arcs come from cutout_shapes, exact. The outline comes from the reply's points.
      • Each bend line is clipped to the outline. Up and down bends are drawn in two narrow ISO 128 line types: up is type 04 (long dash, dot), and down is type 05 (long dash, two dots). Neither can be read as a hidden line.
      • turn is 0, 90, 180 or 270, never a free angle, so the flat's coordinates map exactly.
      • A flat view redraws whenever the model changes. A rule change, such as the K-factor, changes the flat without changing the body.
      • A body that isn't sheet metal is refused with sheet.flat_pattern's own message. A body that is later renamed or changed fails the view with a reason; it never panics.
      • Inspect, move and copy to another sheet work as for a base view.
      • A dimension on a flat view is refused for now ("not supported yet"). The sheet's other dimensions and drawing.status keep working.
    2. FV2, bend notes: "B1 UP 90° R2.5" beside each bend line, from one wording function shared with the flat DXF's bend notes.
    3. FV3, dimensions on a flat view: first with references to the flat's own geometry (outline corners, cut-out centres, bend ends). Then, once Sheet metal: one model, the part's surfaces; the flat pattern is derived (#6748) #9245's flat lineage lands, by the model's persistent names.
    4. FV4, exact outlines in the flat pattern's reply (on main): an outline_shapes key next to cutout_shapes, agreed with Agents and scripts: Flat Pattern, Export Bend Table and Path Flange describe their exact parameters and replies (#6581) #12545 and Sheet metal: one model, the part's surfaces; the flat pattern is derived (#6748) #9245 first.

    FV1's PR says "Part of #13030", because the acceptance list asks for dimensions, which come in FV3.

    Tests, written first

    • The 100 × 60 × 2 mm plate with one 90° flange: the view's outline measures the reported flat size to 1e-6 mm, at 1:1 and 1:2.
    • A round hole is one circle of its exact diameter.
    • Up and down bends are drawn in different patterns, and each bend line ends on the outline.
    • A flange height change, and a K-factor change, each update the view.
    • Each quarter turn maps a corner exactly. Saved and reopened, the view is the same. A saved file with a bad turn or body is refused.
    • Hostile input never panics.

    The cost of one flat reply is measured on the desktop and in the web app, for this plate and for a sheet with 100 cut-outs.

    Nearby work

  4. removed
    in progress
    on Nov 26, 2026
  5. github-actions commented on Nov 26, 2026

    @github-actions
    Contributor

    No draft PR showed up within 72 h, so this one is free again. Anyone can /claim it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:kernelneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions