Files
Aislo/B07_DesignDetail/openwebcad
eomsangdonandClaude Fable 5 17e14a25ed fix(B07): 편집이 사라지지 않게 하고 확정한 도면을 잠근다
사용자 편의성 점검 15건 중 반영 확정분 12건.

편집 손실 방지
- CAD에 미저장 표시(drawingDirty)를 두고, 도면을 바꾸기 전에 묻는다.
  전에는 그은 선이 경고 없이 사라졌다(실측: 캔버스 서명이 원본과 동일).
- 도면 전환을 겹쳐 눌러도 늦게 온 응답이 화면을 덮지 않게 가드를 뒀다.
- 도면층 삭제·객체 이동을 되돌리기에 실어 Ctrl+Z로 돌아오게 했다.

확정한 도면은 읽기 전용
- runCommand 한 곳에서 보는 명령만 통과시킨다(허용 명시 방식).
- 도면을 실을 때 앞 도면의 그리기 도구를 내린다 — 켜 둔 도구가 확정본에도
  계속 그렸다.
- 확정 버튼 자리를 [현재 도면 확정] / [수정]으로 가른다. 확정 해제는 [수정]
  한 곳뿐 — 되돌리기·색 고르기로 확정이 풀리던 경로를 없앴다.

그 밖
- 잠금 도면층(도각·등고선·계류)은 마우스가 스쳐도 하이라이트하지 않는다.
- 준비 중 도면 7종도 빈 도각으로 열린다(눌리지 않는 회색 버튼 제거).
- 도면층 행이 잘리지 않게 패널을 300px로 넓히고 이름을 줄여 담는다.
- 기본 그리기 색을 검정으로 — 흰 종이에 흰 선이라 안 보였다.
- 색 고르는 동안 변경 통지가 연발하지 않는다.
- 수량표는 앞 단계 산출물이라 도면에서 고치지 못하게 막고 안내한다.
- 자동백업 칸을 도면별로 나눈다 — 되살리면 다른 도면에 붙었다.
- 횡단 장 id를 시작 측점 기준으로 바꿔 구간이 달라져도 옛 확정이 안 붙는다.
- 회사 도각 저장 전에 좌표를 검사하고, 기본 도각으로 되돌리기를 연다.
- 횡단 파일이 없어도 나머지 도면 목록은 남는다.
- 불러오는 중·실패를 화면에 표시한다.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-01 19:05:22 +09:00
..

Aislo B08 2D Drawing

This directory is maintained as part of the Aislo project and is not connected to an upstream Git repository. It provides the independent browser-based 2D drawing workspace used only by the B08 page.

The drawing engine is based on OpenWebCAD by Bert Verhelst and retains its MIT license notice in LICENSE.md and public/THIRD_PARTY_LICENSES.txt.

Aislo integration boundary

  • Business drawings enter the iframe only as same-origin JSON messages with type aislo:b08:load-drawing.
  • Browser-side DXF/DWG parsing is intentionally excluded.
  • DXF, DWG and PDF input/output are separate future modules and require a new dependency-license review before implementation.

Original project description

This is a React-based canvas drawing application that allows users to draw various shapes, such as lines, rectangles, and circles, on a fullscreen canvas. The application also includes features for selecting and erasing shapes, as well as exporting the drawing as an SVG file.

demo.gif

DEMO: https://bertyhell.github.io/openwebcad

Features

  • Fullscreen canvas with a black background
  • Drawing tools: Line, Rectangle, Circle, measurements
  • Zoom and pan
  • Eraser tool to delete segments
  • Undo and redo
  • Choose angle guides
  • Draw with snap points for
    • endpoints
    • midpoints
    • intersections
    • circle centers
    • circle quadrants
  • Selection tool to highlight and modify shapes
    • Use CTRL to toggle selection
    • Use shift to add to the current selection
    • drag left, to select by intersecting
    • drag right, to select by containing
  • Move
  • Rotate
  • Scale
  • Align shapes to each other
  • Array copy linear
  • Array copy radial
  • Import images into the drawing
  • Import SVG files
  • Export to PDF
  • Export drawing as an SVG file
  • Export drawing as an PNG file
  • Save and load drawings from/to json files
  • Select line color and thickness
  • Eraser tool to delete segments

Possible future feature ideas (TODO) in order of likelihood

  • Eraser tool to delete segments
    • Max distance to delete
  • Layers for drawing shapes in different layers that can be toggled on or off
  • Mirror
  • Offset
  • Add text
  • Ellipses
  • Regular polygons (pentagon, hexagon, etc)
  • Combine lines into a polygon
  • Explode polygons into lines
  • Polygon circumference
  • Polygon area
  • Chamfer, Round corners
  • Draw with snap points for
    • circle tangents
    • nearest point on line
    • prioritize certain snap points over others (eg: midpoint over nearest)
  • Edit existing lines and circles by dragging endpoints/middle points
  • Hatching and fill areas
  • gradient fills
  • Import DXF files
  • Import DWG files
  • Export to DWG
  • Export to DXF
  • Export drawing to ASCII code

Maintenance

  • replace react with webcomponents (Lit)

Technologies Used

  • TypeScript
  • JavaScript
  • React
  • NPM
  • HTML canvas
  • SVG
  • SCSS
  • Tailwind CSS

Demo

Visit https://bertyhell.github.io/openwebcad

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>
    
  2. Install dependencies:

    npm install
    

Usage

Start the development server: sh npm dev

Open your browser and navigate to http://localhost:5173

Development

Available Scripts

  • npm dev: Runs the app in development mode.
  • npm run build: Builds the app for production.
  • npm preview: Runs the production build in a local server.

Project Structure

  • src/: Contains the source code of the application.
  • docs/: Contains the github pages site.
  • public/: Contains assets that need to be accessible from the url. Like favicon.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

License

This project is licensed under the MIT License.