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

Polygon - update to v1.4 #46

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Polygon - update to v1.4 #46

merged 1 commit into from
Feb 15, 2024

Conversation

Hapaxia
Copy link
Owner

@Hapaxia Hapaxia commented Feb 15, 2024

update Polygon to v1.4

adds:

  • vertex color, and tex-coords
  • bounds (local and global)
  • texture (used by tex-coords if set, ignored if not set; always ignored by wireframe)
  • ability to provide points in a reversed direction (i.e. clockwise for outer and anti-clockwise for holes - instead of anti-clockwise for outer and clockwise for holes)
  • ability to get perimeter of polygon (length of all edges; include hole edges)
  • ability to get area of polygon (after triangulation)
  • ability to get if point is inside polygon (after triangulation)
  • ability to get centroid (average of all outer's points; doesn't include hole vertices)
  • ability to get centre of mass (actual centre of mass; based on triangles' areas)
  • ability to get and set (existing) hole start indices/number of holes
  • export vertex positions (the actual vertices forming the polygon boundary, in order)
  • export vertex positions for only the outer boundary (does not include hole vertices)
  • export vertex positions for only the given hole (vertices for the hole)
  • export wireframe position (in pairs for each separate line)
  • constructors (from other Polygon or initializer list of positions) and operator= (from other Polygon)
  • operator[] to provide direct access to vertices (no validity checking). note that these are the vertices of the polygon "blueprint" - the thing you provide - not the actual vertices used to draw the shape.

also fixed:

  • draw() signature: removed "virtual", added "override final" (just code-style update)
  • now tests exception flag before throwing error in trangulation; also moved exception flag into cpp. note that this flag is always set to true.

update Polygon to v1.4

adds:
- vertex color, and tex-coords
- bounds (local and global)
- texture (used by tex-coords if set, ignored if not set; always ignored by wireframe)
- ability to provide points in a reverses direction (i.e. clockwise for outer and anti-clockwise for holes - instead of anti-clockwise for outer and clockwise for holes)
- ability to get perimeter of polygon (length of all edges; include hole edges)
- ability to get area of polygon (after triangulation)
- ability to get if point is inside polygon (after triangulation)
- ability to get centroid (average of all outer's points; doesn't include hole vertices)
- ability to get centre of mass (actual centre of mass; based on triangles' areas)
- ability to get and set (existing) hole start indices/number of holes
- export vertex positions (the actual vertices forming the polygon boundary, in order)
- export vertex positions for only the outer boundary (does not include hole vertices)
- export vertex positions for only the given hole (vertices for the hole)
- export wireframe position (in pairs for each separate line)
- constructors (from other Polygon or initializer list of positions) and operator= (from other Polygon)
- operator[] to provide direct access to vertices (no validity checking). note that these are the vertices of the polygon "blueprint" - the thing you provide - not the actual vertices used to draw the shape.

also fixed:
- draw() signature: removed "virtual", added "override final" (just code-style update)
- now tests exception flag before throwing error in trangulation; also moved exception flag into cpp. note that this flag is always set to true.
@Hapaxia Hapaxia merged commit fcb59ca into master Feb 15, 2024
24 checks passed
@Hapaxia Hapaxia deleted the Polygon_v1-4 branch February 15, 2024 15:35
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.

1 participant