8000 ICurve implemented by NishantC5 · Pull Request #389 · GSharker/G-Shark · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ICurve implemented #389

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

Merged
merged 2 commits into from
Jan 1, 2023
Merged

ICurve implemented #389

merged 2 commits into from
Jan 1, 2023

Conversation

NishantC5
Copy link
Contributor
@NishantC5 NishantC5 commented Dec 28, 2022

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

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

Description

This PR introduces ICurve interface in order to implement Transform function in NurbsBase. With these changes, one can
make a List<NurbsBase> geometries which can contain any transformable geometry and geometries.Select(c => c.Transform(xForm)).ToList() would execute the Trasnform function of each respective geometry.

Related Tickets & Documents

Closes #383

Added tests?

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

Added to documentation?

  • 📓 docs
  • 🙅 no documentation needed

@d3ssy
Copy link
Collaborator
d3ssy commented Dec 28, 2022

Thank you @NishantC5! Great work.

I have some comments. I think it's fine to have ICurve implemented by all curve-like geometries, but it doesn't seem logical for Plane or Surface to implement ICurve.

The other classes can implement ITransformable on their own.

Alternatively, we can define an IGeometry interface that implements IEquatable and ITransformable and is itself implemented by all geometric objects in the library.

@sonomirco, @cesarecaoduro any thoughts?

@cesarecaoduro
Copy link
Collaborator
cesarecaoduro commented Dec 28, 2022 via email

@sonomirco sonomirco added the minor Pull requests requiring a minor version update according to semantic versioning. label Dec 29, 2022
@sonomirco

Thanks, @NishantC5, for the work!
I agree @d3ssy. It is better to introduce IGeometry instead of having Plane implementing ICurve.

@@ -853,5 +854,11 @@ public override int GetHashCode()

return sBldr.ToString().GetHashCode();
}

public NurbsBase Transform(TransformMatrix t)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@NishantC5, Could you please document this function? Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes sure, I'll get back with the documented code in the next commit.

@NishantC5
Copy link
Contributor Author

Ah yes! It doesn't make sense for plane and surface to implement ICurve! As per the above discussion, I will introduce IGeometry which implements IEquatable and ITransformable and this would be implemented by all the geometry objects. Thanks for the feedback @d3ssy @cesarecaoduro and @sonomirco.

@sonomirco
Copy link
Collaborator

@NishantC5 can we merge this PR?

@NishantC5
Copy link
Contributor Author

@sonomirco yes.

@sonomirco sonomirco merged commit 882dd00 into GSharker:develop Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Pull requests requiring a minor version update according to semantic versioning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transform a group of curves.
4 participants
0