Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PolygonSeries #2033

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft

Conversation

VisualMelon
Copy link
Contributor

Fixes #1751 .

Checklist

  • I have included examples or tests
    -> want some interesting/compelling examples
  • I have updated the change log
  • I am listed in the CONTRIBUTORS file
  • I have cleaned up the commit history (use rebase and squash)

Changes proposed in this pull request:

  • Add a PolygonSeries and examples

@oxyplot/admins

@VisualMelon VisualMelon changed the title Add basic polygon series implementation Add PolygonSeries Aug 16, 2023
Comment on lines +94 to +120
// DataPoint cur = outline[0];
// DataPoint prev;
// for (int i = 1; i < outline.Length; i++)
// {
// prev = cur;
// cur = outline[i];

// if (cur.Equals(prev))
// {
// continue;
// }

// var y0 = Math.Min(cur.Y, prev.Y);
// var y1 = Math.Max(cur.Y, prev.Y);

// if (y0 > p.Y || y1 <= p.Y)
// continue;

// var c = (p.Y - prev.Y) / (cur.Y - prev.Y);
// var x = prev.Y + c * (cur.X - prev.Y);

// if (x <= p.X)
// intersectionCount++;
// }

// return intersectionCount % 2 == 0;
//}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea where this code came from or if it works for why it's commented out. Probably don't need it at all (tracker is done in screen space).

@VisualMelon
Copy link
Contributor Author

Outstanding questions:

  • Do we want polygons to have holes in them? If so, how do we want to represent this?
  • Should we have an outline tracker?

Outstanding problems:

  • ToCode crashes (so WPF example browser doesn't work; WinForms does)

@Jonarw
Copy link
Member

Jonarw commented Aug 16, 2023

Do we want polygons to have holes in them? If so, how do we want to represent this?

Our rendering API does not really support this I think... So this may be hard to implement even if we found a good way to represent this. So I would think we could do without for now.

Should we have an outline tracker?

An outline tracker (that could be enabled as an option) could be nice-to-have, but I wouldn't consider it a must from the start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Polygon Series
2 participants