GSharker / G-Shark

G-Shark is a free and open-source geometry library designed for computational designers and software developers in the Architecture, Engineering, and Construction (AEC) industry.
https://gsharker.github.io/G-Shark/
MIT License
215 stars 37 forks source link

ClosestPoint() implementation for meshes #416

Open iltabe opened 1 year ago

iltabe commented 1 year ago

Discussed in https://github.com/GSharker/G-Shark/discussions/415

Originally posted by **iltabe** May 30, 2023 Hi guys! I know some of you for different reasons! Ciao! For a client I'm building an algorithm that requires some geometrical operations. I've looked into G-Shark and started to use it. It looks promising and does almost everything I need (basic vector, point, plane stuff). Thanks guys for having give birth to this nice project! The only thing I miss is a `mesh.ClosestPoint(Point3 pt)` method... Is it in the todo list by any luck? Thanks! Gianluca

It would be nice to implement some functionality for meshes, especially myMesh.ClosestPoint(Point3 test_point). The behaviour I expect is to get back from the function the real closest point:

  1. on a mesh vertex, if the mesh vertex is the closest point to the test point
  2. on a mesh face boundary (edge) if that is the closest point to the test point
  3. a point inside a mesh face if the length of the line perpendicular to the face (and passing per test_point) is shorter to any other line connecting test_point to the mesh.

Long story short: the closest point! :)

iltabe commented 1 year ago

Hi there!

We found a bit of internal resources to work on this, so we started a first implementation. We will open a PR in the next few days/weeks. Thanks!

d3ssy commented 1 year ago

Excellent! Looking forward to it. Thank you for taking the time to contribute.

On Wed, Jul 5, 2023, 11:07 AM iltabe @.***> wrote:

Hi there!

We found a bit of internal resources to work on this, so we started a first implementation. We will open a PR in the next few days/weeks. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/GSharker/G-Shark/issues/416#issuecomment-1621341085, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPXUISFSLKSHANMG5F2ZE3XOUVENANCNFSM6AAAAAAYW3ZRVI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

iltabe commented 1 year ago

Ciao @d3ssy, The PR regarding mesh closest point is out. Who is the best person to be tagged as reviewer? Thanks!

d3ssy commented 1 year ago

I'll review later today, cheers!

iltabe commented 1 year ago

Cool, thank you!

Il giorno mer 26 lug 2023 alle ore 10:47 Guido Maciocci < @.***> ha scritto:

I'll review later today, cheers!

— Reply to this email directly, view it on GitHub https://github.com/GSharker/G-Shark/issues/416#issuecomment-1651252021, or unsubscribe https://github.com/notifications/unsubscribe-auth/APPLZ2HLAE3JLULGTLIHE73XSDKQVANCNFSM6AAAAAAYW3ZRVI . You are receiving this because you authored the thread.Message ID: @.***>

d3ssy commented 1 year ago

@iltabe Review done! Apologies for the delay. Please reach out if you need any help or further info!