Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

vg,vg/draw: primitives for an Ellipse

オープン
#641 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go

調査の方向性

vg/draw から始め、vg.Path と既存の ArcComp および CurveComp プリミティブを調べます。リンクされている Maisonobe の論文を使って、提案されている EArc ジオメトリを理解します。楕円弧が、指定された焦点、角度方向、nil-path の動作をサポートすれば完了です。

索引モデルが issue の本文から書いたものです。

説明

unless I am mistaken, gonum/plot doesn't expose primitives to draw ellipses nor arcs of ellipses.
vg.Path exposes a vg.ArcComp but that's only to draw a circular arc.

one can of course draw an ellipse with a combination of vg.CurveComp (quad or cubic ones), according to that paper:
Drawing an elliptical arc using polylines, quadratic or cubic Bezier curves", L. Maisonobe

An electronic version may be found at:

I've already provided such an implementation for Gio.
I could probably provide one for gonum/plot as well.

I'd propose to put it into vg/draw:

package draw

// EArc adds an elliptical arc to the path. The implied ellipse is defined
// by its focus points f1 and f2.
// The arc starts in the current point and ends angle radians along the ellipse boundary.
// The sign of angle determines the direction; positive being counter-clockwise,
// negative clockwise.
// If path is nil, a new path is created.
func EArc(path *vg.Path, f1, f2 vg.Point, angle float64) { ... }

WDYT?

主要言語
Go
スター
3k
フォーク
202
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

gonum/plot のほかの issue

gonum/plot の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。