Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TurboDXF ๐Ÿš€

English | ็ฎ€ไฝ“ไธญๆ–‡

TurboDXF Banner

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.


๐ŸŒŸ Key Features

  • Blazing Fast Rendering Engine Powered by Three.js (WebGL) for complex line geometries and native Canvas 2D for 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 Float32Array representations 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 jschardet to accurately infer encoding (Shift_JIS, GBK, Big5) when the $DWGCODEPAGE is missing. This bypasses browser-specific TextDecoder quirks 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.


๐Ÿ“ธ Showcase

Intelligent Parsing & Rendering

Rendered DXF Model Demonstration of a legacy DXF file precisely decoded and rendered with correct formatting, dimensions, and texts.


๐Ÿ› ๏ธ Architecture

TurboDXF is composed of three cleanly decoupled layers:

  1. 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.
  2. Serializer (src/serializer): Converts the object-oriented DOM into flattened, ECS-style data buffers (Float32Array for positions, colors, mesh vertices) optimized specifically for GPU consumption.
  3. Renderer (src/render): The WebGL visualization wrapper. Subscribes to the serialized data arrays, builds Three.js BufferGeometry, and manages panning/zooming via orthogonal cameras.

๐Ÿš€ Getting Started

Prerequisites

Ensure you have Node.js (v18+) and pnpm installed.

Installation

Clone the repository and install the dependencies:

git clone https://github.com/SilenceEchoLab/TurboDXF.git
cd TurboDXF
pnpm install

Running Locally

Start the Vite development server:

pnpm run dev

Open 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!

Building for Production

To create an optimized production bundle:

pnpm run build

The output will be placed in the dist/ directory, ready to be deployed to Vercel, Netlify, or any static host.


๐Ÿ“ Roadmap & Known Limitations

  • 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

๐Ÿค Contributing

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.

๐Ÿ“„ License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

About

๐Ÿš€ A high-performance, mathematically accurate DXF parsing and WebGL rendering engine built for the modern web.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages