TurboDXF is an industrial-grade, high-performance DXF viewer and parser built natively for the modern web. It enables zero-block rendering of large CAD drawings directly in the browser, featuring robust multi-encoding text support, hardware-accelerated rendering, and a completely typed architecture.
-
Blazing Fast Rendering Engine Powered by
Three.js(WebGL) for complex line geometries and nativeCanvas 2Dfor rich text and intricate hatch patterns, achieving 60 FPS even on large drawings. -
Zero-Copy Architecture DXF processing happens entirely off the main thread inside a Web Worker. Buffer data is efficiently serialized into
Float32Arrayrepresentations and passed to the GPU renderer using Transferable Objects, guaranteeing zero memory copy overhead and a buttery smooth UI. -
Intelligent Encoding Detection (CJK Support) Unlike standard parsers that fail on legacy files, TurboDXF implements byte-level binary string sampling combined with
jschardetto accurately infer encoding (Shift_JIS, GBK, Big5) when the$DWGCODEPAGEis missing. This bypasses browser-specificTextDecoderquirks and ensures flawless Japanese and Chinese text rendering. -
64-bit Precision Jitter Elimination Large coordinate CAD models suffer from WebGL's 32-bit float limitations (which causes visual jittering). TurboDXF dynamically computes a localized World Coordinate System (WCS) bounding box and uses camera offset translations to completely eliminate rendering jitter.
-
Modern Tech Stack Built from the ground up using React 19, Vite, TypeScript, and TailwindCSS v4 for a clean, futuristic, and highly responsive user interface.
Demonstration of a legacy DXF file precisely decoded and rendered with correct formatting, dimensions, and texts.
TurboDXF is composed of three cleanly decoupled layers:
- Parser (
src/parser): Strictly typed tokenizer and state machine that reads ASCII/Binary DXF into a JSON-like Document Object Model (DOM). Handles complex Group Code mappings. - Serializer (
src/serializer): Converts the object-oriented DOM into flattened, ECS-style data buffers (Float32Arrayfor positions, colors, mesh vertices) optimized specifically for GPU consumption. - Renderer (
src/render): The WebGL visualization wrapper. Subscribes to the serialized data arrays, builds Three.jsBufferGeometry, and manages panning/zooming via orthogonal cameras.
Ensure you have Node.js (v18+) and pnpm installed.
Clone the repository and install the dependencies:
git clone https://github.com/SilenceEchoLab/TurboDXF.git
cd TurboDXF
pnpm installStart the Vite development server:
pnpm run devOpen your browser to the URL displayed in the terminal (e.g., http://localhost:3000). You can drag and drop your DXF files directly into the UI!
To create an optimized production bundle:
pnpm run buildThe output will be placed in the dist/ directory, ready to be deployed to Vercel, Netlify, or any static host.
- Basic Entities (LINE, CIRCLE, ARC, POLYLINE, LWPOLYLINE)
- Block References (INSERT)
- Text & MTEXT (Advanced formatting & multi-byte characters)
- Dimensions & Leaders
- 3D Entities (3DFACE, SOLID extrusion)
- Layer visibility toggling UI
- Measurement & Snap Tool
Contributions are always welcome! Feel free to open an issue or submit a Pull Request if you'd like to improve the parser or add support for newer AutoCAD DXF versions.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
