Promote Polygon out of experimental and use it for the polygons of paths
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with the Polygon class in src/experimental/geometry/shapes/polygon.dart, especially its constructor and _initializeEdges(), and read how Path.toPolygons(), PathComponent.polygons and convexPieces() use vertex lists today. Done means edges are computed lazily or on demand, the caller's list is never mutated, Polygon is exported from package:flame/geometry.dart, and the polygon-returning APIs return Polygon before 2.0. Because this changes public API, agree the design with maintainers before writing code.
索引モデルが issue の本文から書いたものです。
説明
Problem
There are two ways of representing a polygon in Flame today:
- The
Polygonshape insrc/experimental/geometry/shapes/polygon.dart, which is only exported frompackage:flame/experimental.dart. - Plain vertex lists (
List<Vector2>), which most of the stable API uses:PolygonComponent,PathComponent.polygons,Path.toPolygons()andconvexPieces()(the last two are added in #4097).
Since Polygon is experimental and has some performance issues, the stable APIs can't return it. That's why Path.toPolygons() returns List<List<Vector2>>, which is confusing given its name (see the discussion in #4097).
Issues with the current Polygon
- The constructor eagerly creates an edge vector for every vertex in
_initializeEdges(). In #4097, returningPolygonfromtoPolygons()cost about 2% more time but roughly twice the memory. - When
convexisn't given, the constructor may reverse the vertex list that is passed in, in place, which is surprising for the caller. - It lives in
experimental, so the core extensions and components can't depend on it.
Proposal
- Make
Polygoncheap to construct: computeedgeslazily (or drop the cached list and compute edges on demand), and avoid mutating the caller's list. - Promote
Polygonout ofexperimentalintopackage:flame/geometry.dart. - Before 2.0 stable, change the APIs that return polygons as vertex lists to return
Polygoninstead, while they're still only in dev releases:Path.toPolygons()PathComponent.polygons(released inflame-v2.0.0-dev.0)convexPieces(), which could returnList<Polygon>(withconvex: true)
Consumers that need plain lists, like the forge2d Polygon shape, would read .vertices.
- 主要言語
- Dart
- スター
- 10.8k
- フォーク
- 1.1k
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 50
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
flame-engine/flame のほかの issue
-
flame_tiled: tileset image in a subfolder of an external .tsx resolves to the wrong path対応中かも @ufrshubham が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
flame-engine/flame#4117 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
flame-engine/flame#4063 ·
メンテナーはふだん 1 日以内に返信
-
TextComponent shadows are not affected by OpacityEffect対応中かも @spydon が 38 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
flame-engine/flame#4013 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
flame-engine/flame#4012 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
flame-engine/flame#3974 · コメント 6 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
flame-engine/flame の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AimesSoft/NipaPlay-Reload#1021 ·
メンテナーはふだん 1 日以内に返信
-
enhancement triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
fluttercommunity/plus_plugins#4004 ·
メンテナーはふだん 1 日以内に返信
-
agent:ready bug P2 · 中 健壮性 区域: 启动与合规 待验证 隐私与合规
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
ASDW51/DanmuFloat#106 ·
メンテナーはふだん 1 日以内に返信
-
c: proposal p: go_router package team-ecosystem
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
flutter/flutter#194542 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100