Skip to content

Import option for AutoCAD files #158

Open

Description

@chiraggavande

Can we import 2D home plans created from AutoCAD and import them here to get a basic 3D design ?

Activity

  1. kleenkanteen commented on Mar 26, 2026

    @kleenkanteen
    Contributor

    seems complex to get a 3D design from 2D plans. would be a long term feature

  2. ngiotta commented on Apr 27, 2026

    @ngiotta

    It would disrupt the architect/draftsman profession in a very positive way if .dwg files could be imported natively.

  3. AdrianPerez3 commented on Apr 30, 2026

    @AdrianPerez3
    Contributor

    Hi 👋 — taking a swing at this in a fork. Working branch + draft PR in our fork: AdrianPerez3/editor#1 (branch claude/feat/dxf-import-issue-158).

    What's in it
    A new workspace package @pascal-app/dxf-importer (MIT, built on dxf-parser) plus an "Import DXF / DWG" button in the Settings panel. Picking a .dxf:

    Sniffs format — .dwg is rejected with a sonner toast pointing at the free ODA File Converter
    Parses + classifies layers (multilingual: AIA, plain English, German Allplan, French AFNOR, Spanish, Italian, Japanese SXF, Chinese CJK, curtain wall) with a (?:[-_]|$) boundary policy that avoids WALLPAPER/DOORHANDLE false positives
    Resolves units: $INSUNITS → $MEASUREMENT fallback → bbox heuristic, with a persistent toast on the result
    Creates WallNodes, snaps INSERT blocks to the nearest wall (placeOpenings) → DoorNode/WindowNode with wallId for the wall CSG cutout pipeline
    Renders non-wall entities as an SVG-backed GuideNode 2D underlay
    Whole batch wrapped in useScene.temporal.pause()/resume() → Cmd/Ctrl+Z reverts the entire import as one step
    Numbers
    152 vitest tests passing across 11 files (parser correctness, layer regex, bulge tessellation, false-positive boundaries, end-to-end)
    Wall defaults match Pascal's existing native 2.5 m × 0.1 m (wall-tool.tsx:11, wall-panel.tsx:122)
    CI workflow added (.github/workflows/dxf-importer-tests.yml)
    Real-shaped fixtures: Revit metric, SketchUp imperial-quirk, Civil 3D unitless, L-shaped house with door INSERTs
    Comlink-backed Web Worker for files >5 MB ships in apps/editor/lib/ (wired but not yet consumed by the button — activation note in INTEGRATION.md)
    DWG
    Phase A (reject + ODA pointer) ships now. Phase C (server-side conversion via CloudConvert / Aspose.CAD Cloud) is documented in INTEGRATION.md as a follow-up. Skipped LibreDWG because it's GPL-3.0 and AutoCAD APS Model Derivative because it doesn't actually output DXF (verified — only SVF/OBJ/STL/STEP/IGES/FBX/IFC/glTF/PDF).

    Honestly NOT verified
    Door/window rotation sign — [0, -wallAngleY, 0] is best-guess; needs a browser eye to confirm openings aren't mirrored
    GuideNode plane scaling against the existing renderer
    Layer-mapping table UI is deferred (auto-classify covers ~75-80% per the research; long tail belongs in a follow-up)
    Happy to rebase, address review feedback, or split into smaller PRs if the maintainers prefer. Five focused commits, each independently reviewable.

  4. KongNan commented on May 16, 2026

    @KongNan
  5. Aymericr commented on Aug 4, 2026

    @Aymericr
    Member

    Maintainer update, with a concrete path for @AdrianPerez3's work and an answer for @KongNan.

    The architecture we want for format importers already exists in the repo, and DXF should follow it. IFC landed as two pieces:

    • packages/ifc-converter — pure conversion logic. Parses the format, maps onto @pascal-app/core node schemas, emits scene-graph JSON. No DOM, no React.
    • apps/ifc-converter — a standalone web app: drop zone, extracted-element inspector, live @pascal-app/viewer preview, JSON download.

    That split is deliberate and it's why IFC could ship while still being explicitly early alpha. The conversion is independently testable, the format's heavy dependency stays out of the editor bundle, and — the part that matters most for a sprawling format — users get to inspect what was extracted before importing, instead of a button that silently produces a wrong building.

    DXF has exactly the same properties as IFC here: a loose standard, wildly varying real-world exports, and no way to be confident a given file converted correctly. So the ask for this issue is packages/dxf-converter + apps/dxf-converter, mirroring the IFC pair.

    @AdrianPerez3 — that's mostly a re-targeting of what you already have, not a rewrite: @pascal-app/dxf-importer is already a separate workspace package built on dxf-parser, which is the right instinct and the bulk of the work. Two changes to land it here:

    1. Move the UI out of the editor's Settings panel into a standalone apps/dxf-converter. This also resolves @KongNan's problem — the Settings gear on editor.pascal.app is the hosted app's, which isn't in this repo, so a button added to the OSS editor's settings won't appear where they were looking. A standalone app has no such ambiguity.
    2. Split pure conversion from UI if it isn't already, so the mapping onto core node schemas can be unit-tested without a DOM. bun run test is CI-gating the suite as of ci: run the test suite in CI #548, so tests on real-world DXF fixtures are the thing that makes this maintainable.

    5,296 lines across 52 files is a lot to review in one PR against this repo. If you open it as packages/dxf-converter first (conversion + tests, no UI), I'll review that on its own and we can add the app in a follow-up. Rejecting .dwg with a clear message rather than half-supporting it is the right call — worth stating in the README the way the IFC one does.

    @ngiotta on native .dwg: it's a closed binary format with no viable open parser, so conversion to DXF or IFC first will stay the realistic path.

    Labeling enhancement + help wanted. Related: #174 (Sweet Home 3D) is the same importer shape.

  6. added
    enhancement
    help wanted
    on Aug 4, 2026
  7. Aymericr commented on Aug 5, 2026

    @Aymericr
    Member

    Housekeeping index for the format-import cluster, since these keep getting opened in parallel and each one rediscovers the same architecture. Linking them here rather than filing a new meta-issue:

    Thread Format State
    #158 (this) DXF / DWG help wanted — @AdrianPerez3 has a fork branch; the reshaping needed to land it is in my comment above
    #174 Sweet Home 3D help wanted, no work started
    #553 IFC — preserving unsupported geometry open PR, follows the right shape, awaiting contributor changes
    #219 IFC support closed — shipped as packages/ifc-converter + apps/ifc-converter
    #145 general import/export closed as completed — the per-format threads below are what remains
    Discussion #460 2D blueprint import + scale calibration answered
    Discussion #199 RVT answered

    The shape every one of these should follow is the one IFC already proved, and it's written down in apps/ifc-converter/README.md — read that before starting, it's shorter than this comment:

    • packages/<fmt>-converter — pure conversion. Bytes in, { nodes, rootNodeIds, stats } out, shaped against @pascal-app/core schemas. No DOM, no React, so it's unit-testable against fixture files and publishable on its own.
    • apps/<fmt>-converter — a standalone web app for the UI: drop zone, extracted-element inspector, preview in the real @pascal-app/viewer, JSON download.

    Two things that shape decisions and aren't obvious until you're deep in it:

    • Don't add a converter button to the editor's Settings panel. That was the one structural change requested on the DXF fork. The standalone-app split is what lets a converter ship as early-alpha with an honest "expect rough edges" banner without that caveat leaking into the editor's own UI.
    • Bring a fixture file, not just a parser. IFC is a sprawling, loosely-followed standard and DXF is no better — the converters that hold up are the ones with real-world exports checked in as tests. feat(ifc): preserve unsupported IFC geometry #553 is a good example of the shape: conversion logic and its tests in the same PR.

    Nothing here changes the status of any of these threads. Keeping #158 open as the DXF/DWG one.

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

    enhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions