Constructive geometry
- Ngôn ngữ chính
- Haskell
- Star
- 1.3k
- Fork
- 201
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Additional operations should be added to combine shapes:
```
intersection :: [Picture] -> Picture
difference :: Picture -> Picture -> Picture
```
(Names are debatable.) `intersection` should produce a picture bounded by the intersection of the list. The second should produce a picture containing all areas of the first image that are not also in the second. Note that together with the existing `pictures`, this gives the three basic operations for constructive geometry.
The implementation is a little tricky. Combining two images in this way can be done with globalCompositeOperation (https://developer.mozilla.org/samples/canvas-tutorial/6_1_canvas_composite.html) But getting the resulting shapes to nest correctly will involve using off-screen canvases as temporaries. Since creating a new off-screen canvas is expensive, this should involve determining the minimum number of offscreen canvases needed, and reusing them between frames.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách xác định implementation hiện có của `pictures` và entry point cho việc render canvas, sau đó xem xét cách `globalCompositeOperation` và các canvas ngoài màn hình có thể kết hợp các hình dạng lồng nhau. Xác định số lượng canvas tạm thời có thể tái sử dụng tối thiểu cần thiết cho `intersection` và `difference`; được coi là hoàn tất khi cả hai operation tạo ra các vùng hình học dựng hình được chỉ định mà không tạo canvas không cần thiết ở mỗi frame.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- haskell, javascript
- Lĩnh vực
- computer-graphics
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100