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

Adds Mesh implementation #387

Closed

Conversation

AlanRynne
Copy link
Contributor

@AlanRynne AlanRynne commented Dec 26, 2022

What type of PR is this? (check all applicable)

  • ♻️ Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 👷 Optimization
  • 📝 Documentation Update
  • 🔖 Release
  • 🚩 Other

Description

Adds several classes to the Geometry namespace to implement a half-edge mesh data-structure.

It also adds some initial basic unit tests to ensure everything works as expected.

Related Tickets & Documents

Fixes #225

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📓 docs
  • 🙅 no documentation needed

@AlanRynne
Copy link
Contributor Author

This is still a draft, but I thought I'd open this already so that you guys can have a peek too and let me know what you think.

I'll do a review in a bit to highlight the most "controversial" changes ;)

Copy link
Collaborator

@d3ssy d3ssy left a comment

Choose a reason for hiding this comment

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

Fantastic work @AlanRynne! Thanks again for implementing this, looks (unsurprisingly) great! :)

Left a couple of comments for review.

/// Returns a normalized copy of this vector.
/// </summary>
/// <returns>A copy of this vector unitized.</returns>
public Vector3 Unit()
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AlanRynne, any reason not to use the existing methods Unitize() CrossProduct() and DotProduct() directly?

namespace GShark.Geometry
{
/// <summary>
/// Represents a mesh half-edge.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Edge class representing a mesh half-edge.

/// </summary>
/// <returns>The face area.</returns>
/// <param name="face">Face.</param>
public static double Area(MeshFace face)
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's a method in Polygon to calculate the area from an arbitrary list of points that form a closed planar boundary. Currently implemented as a getter tho... We could make that a static method and re-use it here for arbitrary NGon area calcs?

@d3ssy d3ssy added the enhancement 📢 Issues describing an enhancement or pull requests adding an enhancement. label Dec 27, 2022
@sonomirco sonomirco deleted the branch GSharker:develop January 2, 2023 23:44
@sonomirco sonomirco closed this Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 📢 Issues describing an enhancement or pull requests adding an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Meshes
3 participants