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

Rough fix for issue96 #9

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

stefannikolei
Copy link
Contributor

@stefannikolei stefannikolei commented Feb 4, 2025

This is just a rough fix for the last test failure of the js generic tests where we have a mismatch in the count of points.

This is also done in the rust version. mod.rs L:116

Do you see a better way how to handle this? Perhaps change the return value of ConnectEdge to Contour[] and then do the ordering?

When this is done only 2 tests of the js test suite are failing. And those faile because of probably some rounding problems

@JimBobSquarePants
Copy link
Member

@stefannikolei I'll have a look at this asap. I've been preoccupied looking at some gnarly ImageSharp issues.

As a side, I've been porting more of the Rust version code into a local branch. There's a bit of difference in that codebase around segment comparing plus some intersection calculation changes. It doesn't fix things yet but it may make a good starting point to getting everything working so will push the branch tomorrow.

@stefannikolei
Copy link
Contributor Author

@JimBobSquarePants I looked further into the remaining failing tests. I get a difference in the connectEdge logic. Our implementation for example return 8 as the nextPos. But the Rust implementation returns 9.

The rust implementation is using an precalculated iteration_map. I think our focus should be on this one.

I will wait for your remaining rust ports and then look further into it.

* Did not add the new SignedArea method. More tests are failing with it
* Did not touch the SegmentComparer. Adding it makes more tests fail

* We now only have 9 Tests failing
@stefannikolei
Copy link
Contributor Author

stefannikolei commented Mar 16, 2025

@JimBobSquarePants I added some of your changes from your rust port into this branch. I Got the tests down to 9 failing tests.

I did not add the changes from the SegmentComparer. This made more tests fail.

Will try to debug some smaller tests to hopefully find the remaining problem(s)

The initial JS Code can not help here.
The Testcases which are failing now are also failing for the JS version

@stefannikolei
Copy link
Contributor Author

@JimBobSquarePants I now have ported the PrecomputeIterationOrder. This brought down the failing tests to 7

@JimBobSquarePants
Copy link
Member

I think I was going in the right direction with the segment comparer changes however I must have missed something. I didn't have the chance yet to port the tests for the comparer for the rust version so I'm sure if we do that, we'd soon find my issue.

@stefannikolei
Copy link
Contributor Author

@JimBobSquarePants I incorporated your changes to the segment comparer. I fixed the Comparer Tests. Now we are down to 6 failing tests

@stefannikolei
Copy link
Contributor Author

Updated the test cases from the rust implementation. Now we are down to 3 failing tests

@JimBobSquarePants
Copy link
Member

Amazing! so close now. Thanks so much for your help!

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.

2 participants