{"id":47061054,"url":"https://github.com/zouwei/morcad","last_synced_at":"2026-03-12T04:01:59.518Z","repository":{"id":343749136,"uuid":"1178820415","full_name":"zouwei/morcad","owner":"zouwei","description":"Moraya-based DXF/DWG Viewer and Editor Plugin","archived":false,"fork":false,"pushed_at":"2026-03-11T17:49:31.000Z","size":3524,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-11T21:25:37.124Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zouwei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-11T12:00:50.000Z","updated_at":"2026-03-11T17:49:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zouwei/morcad","commit_stats":null,"previous_names":["zouwei/morcad"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/zouwei/morcad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouwei%2Fmorcad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouwei%2Fmorcad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouwei%2Fmorcad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouwei%2Fmorcad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zouwei","download_url":"https://codeload.github.com/zouwei/morcad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouwei%2Fmorcad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30415037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T00:40:14.898Z","status":"online","status_checked_at":"2026-03-12T02:00:07.260Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-12T04:01:57.049Z","updated_at":"2026-03-12T04:01:59.512Z","avatar_url":"https://github.com/zouwei.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MorCad — DXF/DWG Inline CAD Viewer\n\n\u003e Render AutoCAD DXF and DWG engineering drawings inline in Markdown documents — as naturally as embedding a Mermaid diagram.\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n---\n\n## Overview\n\nMorCad is a CAD file renderer plugin for [Moraya](https://github.com/zouwei/moraya) and Obsidian. It renders `.dxf` and `.dwg` engineering drawings directly inside Markdown code blocks using Three.js WebGL with an orthographic camera — no separate viewer window needed.\n\n**Supported platforms:**\n\n| Platform | Integration | Status |\n|----------|-------------|--------|\n| Moraya | `RendererPlugin` | v0.1.0 |\n| Obsidian | `registerMarkdownCodeBlockProcessor` | Planned v0.2.0 |\n\n---\n\n## Usage\n\n### Basic (file path)\n\n````markdown\n```dxf\n./drawings/floor-plan.dxf\n```\n````\n\n````markdown\n```dwg\n./drawings/building.dwg\n```\n````\n\n### With parameters (v0.2.0)\n\n````markdown\n```morcad\nfile: ./electrical-plan.dxf\nlayers: WALLS, DOORS, ELECTRICAL\nheight: 500\ntheme: auto\n```\n````\n\nFile paths are relative to the current Markdown document's directory.\n\n---\n\n## Features\n\n- **DXF rendering** — pure JavaScript, no WASM, MIT stack\n- **DWG rendering** — LibreDWG compiled to WebAssembly, loaded on demand (~5 MB)\n- **Orthographic camera** — correct 2D engineering drawing projection, no perspective distortion\n- **Layer panel** — toggle layer visibility with a collapsible overlay\n- **Dark / light theme** — follows the host editor's theme automatically\n- **Pan \u0026 zoom** — mouse wheel / two-finger pinch + drag to pan\n- **Entity support** — LINE, ARC, CIRCLE, LWPOLYLINE, POLYLINE, SPLINE, ELLIPSE, INSERT (block expansion), HATCH, DIMENSION, SOLID, TEXT\n\n---\n\n## Repository Structure\n\n```\nmorcad/\n├── packages/\n│   ├── core/          # Framework-agnostic rendering engine (Three.js)\n│   ├── moraya/        # Moraya RendererPlugin adapter (Tauri IPC)\n│   └── obsidian/      # Obsidian plugin adapter (planned)\n├── examples/\n│   └── vanilla/       # Plain HTML demo (no framework)\n└── docs/\n```\n\n---\n\n## Moraya Integration\n\n### 1. Build the plugin bundle\n\n```bash\npnpm build:moraya:bundle\n# Output: packages/moraya/dist/index.bundle.js\n```\n\n### 2. Register in Moraya\n\nAdd to `src/lib/services/plugin/renderer-registry.ts`:\n\n```typescript\nimport { cadRendererPlugin } from '@morcad/moraya';\n\nexport const RENDERER_PLUGINS = [\n  // ...existing plugins\n  cadRendererPlugin,\n];\n```\n\n### 3. Add the Tauri command\n\n```rust\n// src-tauri/src/main.rs\n#[tauri::command]\nasync fn read_file_binary(path: String) -\u003e Result\u003cVec\u003cu8\u003e, String\u003e {\n    std::fs::read(\u0026path).map_err(|e| e.to_string())\n}\n```\n\n---\n\n## Development\n\n**Prerequisites:** Node.js 18+, pnpm 10+\n\n```bash\n# Install dependencies\npnpm install\n\n# Build everything\npnpm build\n\n# Build only core\npnpm build:core\n\n# Build Moraya plugin bundle\npnpm build:moraya:bundle\n\n# Watch mode (core + moraya in separate terminals)\npnpm dev:core\npnpm dev:moraya\n\n# Run the vanilla demo\npnpm dev:demo\n```\n\n---\n\n## License\n\nThis project is licensed under the **GNU General Public License v3.0**.\n\nDWG support depends on [`@mlightcad/libredwg-web`](https://github.com/mlightcad/cad-viewer), which is compiled from [LibreDWG](https://www.gnu.org/software/libredwg/) (GPLv3). This license requirement applies to the entire project.\n\nMorCad is distributed as an independent plugin. The host applications (Moraya, Obsidian) retain their own licenses. Users download this plugin voluntarily and separately from the host application.\n\nSee [LICENSE](./LICENSE) for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzouwei%2Fmorcad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzouwei%2Fmorcad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzouwei%2Fmorcad/lists"}