GraphiteEditor / GraphiteEditor/Graphite
Stroke alignment on «Solidify Stroke»
- 主要言語
- Rust
- スター
- 27.2k
- フォーク
- 1.3k
- 平均マージ
- 20時間 5分
- マージ済み PR(30日)
- 57
説明
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:
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:
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).
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず Solidify Stroke の実装と StrokeAlign の処理箇所を特定します。開いたパス、閉じたパス、交差するパス、および複数の輪郭を持つパスに対する挙動を SVG および vello レンダラーと比較し、利用可能な linesweeper 依存関係を kurbo::stroke と併せて確認します。Inside、Outside、Center の各アラインメントで一致する結果が生成され、開いたパスでは Center アラインメントが維持されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust
- 領域
- computer-graphics
- issue の種類
- バグ
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100