GraphiteEditor / GraphiteEditor/Graphite

Stroke alignment on «Solidify Stroke»

Đang mở
#4,494 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Rust
Star
27.3k
Fork
1.3k
Merge trung bình
20 giờ 5 phút
Pull request đã merge (30 ngày)
57

Mô tả

The «Solidify Stroke» assumes that all strokes are `StrokeAlign::Center` [sic] causing it to give the incorrect results for `StrokeAlign::Inside` and `StrokeAlign::Outside`.

The alignment can be set in the properties of the stroke node:
the properties panel showing the inside stroke alignment option

A proper implementation of the algorithm must deal with intersecting bézier paths in the same way as the SVG and vello renderer. An interesting case can be seen here where we have a closed path made of just two intersecting cubic béziers:
A figure of 8 path made by crossing two cubic bézier

If the path is not fully closed, then the centre alignment must be used to match the renderer. Also note that a path can contain multiple contours. These can likely be dealt with individually?

To deal with intersections of paths in an efficient the [`linesweeper` crate](https://docs.rs/linesweeper) can be used since it is already included as a dependency.

The `kurbo::stroke` function only supports centre alignment. I'm not sure if it is within scope to add other alignments to it.

As reported by [@Menxs on discord](https://discord.com/channels/731730685944922173/1134981447539761273/1544038003955990538).

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách xác định phần triển khai Solidify Stroke và cách xử lý StrokeAlign của nó. So sánh hành vi của nó đối với các path mở, đóng, giao nhau và có nhiều contour với SVG và trình kết xuất vello, đồng thời xem xét dependency linesweeper hiện có cùng với kurbo::stroke. Công việc được xem là hoàn tất khi các alignment Inside, Outside và Center cho ra kết quả khớp nhau, trong đó các path mở vẫn giữ alignment Center.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
computer-graphics
Loại issue
Lỗi
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.