map2loop-2 icon indicating copy to clipboard operation
map2loop-2 copied to clipboard

[BUG] Only a few contact orientations are calculated

Open markjessell opened this issue 2 years ago • 2 comments

Describe your issue

If I set 'contact_decimate': 0, and 'contact_orientation_decimate': 0 I expect the same number of contact orientations as contacts, but I get 1658 contacts in contacts_clean.csv but only 14 contact orientations in contact_orientations.csv

Minimal reproducing code example

Try with the default dataset included in the notebooks

Error message

No error, but surprising behaviour...

markjessell avatar Sep 09 '23 10:09 markjessell

Hi Mark,

Within the m2l_interpolation code there was an assumption that all LineStrings only contained 1 line segment. With the changes in 1.3.6 to using MultiLineStrings more LineStrings were also merged to have more than a single line segment within each LineString.

I have refactored the offending code (save_contact_vectors) making it more concise and with less repeated code. I tested it against the notebook examples 1 and 3 and the number of contact orientations has improved. I did not check whether they matched exactly however.

While looking through the code there is potential that interpolate_contacts and interpolate_contacts_grid also makes the same assumption so please check the outputs when creating these points to see if it has your expected behaviour.

I have pushed these changes to master and the next release will contain this fix.

RoyThomsonMonash avatar Sep 13 '23 07:09 RoyThomsonMonash

Hi Roy

Thanks for having a look, using the new code I get:

raw_contacts.csv = 817 rows

contact_orientations.csv = 13 rows

for all contact_decimate and contact_orientation_decimate set to 0

I used Verbose.ALL and the interpolations look like a lot of the grids are invalid (red):

@.*** @.***

Which may be due to the issue you mentioned in the last email

Cheers

Mark

From: Roy Thomson @.> Sent: Wednesday, September 13, 2023 3:13 PM To: Loop3D/map2loop-2 @.> Cc: Mark Jessell @.>; Author @.> Subject: Re: [Loop3D/map2loop-2] [BUG] Only a few contact orientations are calculated (Issue #109)

Hi Mark,

Within the m2l_interpolation code there was an assumption that all LineStrings only contained 1 line segment. With the changes in 1.3.6 to using MultiLineStrings more LineStrings were also merged to have more than a single line segment within each LineString.

I have refactored the offending code (save_contact_vectors) making it more concise and with less repeated code. I tested it against the notebook examples 1 and 3 and the number of contact orientations has improved. I did not check whether they matched exactly however.

While looking through the code there is potential that interpolate_contacts and interpolate_contacts_grid also makes the same assumption so please check the outputs when creating these points to see if it has your expected behaviour.

I have pushed these changes to master and the next release will contain this fix.

Reply to this email directly, view it on GitHubhttps://github.com/Loop3D/map2loop-2/issues/109#issuecomment-1717071701, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABUBSYC27KMXHU2I7LPSP3DX2FMF7ANCNFSM6AAAAAA4RLOLYY. You are receiving this because you authored the thread.Message ID: @.@.>>

markjessell avatar Sep 13 '23 09:09 markjessell