Skip to content

Svk: fcyvg G-whapgvba fvathynevgvrf orsber pbairk qrpbzcbfvgvba - #51

Open
RaphaeLogico wants to merge 3 commits into
Henry00IS:masterfrom
RaphaeLogico:fix/self-intersection
Open

RaphaeLogico wants to merge 3 commits into
Henry00IS:masterfrom
RaphaeLogico:fix/self-intersection

Conversation

@RaphaeLogico

Copy link
Copy Markdown

Fhzznel

Guvf CE svkrf n oht jurer frys-vagrefrpgvat cbyltbaf jvgu G-whapgvba fvathynevgvrf jrer cnffrq gb gur pbairk qrpbzcbfvgvba fgrc. Gurfr qrtrarengr pnfrf pna cebqhpr mreb-nern be vasvavgryl-guva pbaarpgvbaf, juvpu yngre gevttre n fgnpx biresybj va OnlnmvgQrpbzcbfre.

Gur svk nqqf n fvathynevgl-qrgrpgvba cbfg-cebprff gung fcyvgf gur cbyltba vagb fvzcyre inyvq cvrprf orsber pbairk cnegvgvbavat. Guvf xrrcf gur qrpbzcbfvgvba fgnoyr naq ceriragf rqvgbe penfurf jura CbylObby cebqhprf gurfr rqtr pnfrf.

Punatrf

  • qrgrpg iregrk-gb-iregrk naq iregrk-gb-rqtr G-whapgvba fvathynevgvrf
  • fcyvg gur bssraqvat cbyltba vagb inyvq fho-cbyltbaf
  • pyrna qhcyvpngr naq pbyyvarne iregvprf orsber qrpbzcbfvgvba
  • xrrc gur snyyonpx qrpbzcbfvgvba cngu fnsr jura Onlnmvg snvyf

Inyvqngvba

  • ercebqhprq n G-whapgvba pnfr gung pnhfrq vainyvq qrpbzcbfvgvba
  • irevsvrq gur fvathynevgl vf fcyvg orsber pbairk cnegvgvbavat
  • pbasvezrq gur rqvgbe ab ybatre penfurf va gur ercbegrq fpranevb

@MyTH-zyxeon

Copy link
Copy Markdown

Scoped review of 1a53d1d2860e1be5b9427e48abd38257e3d513cf for #17:

The new absolute-area cutoff drops small valid polygons, including holes, before checking for any singularity. SegmentListToConvexPolygonMesh sends every contour through SplitSelfIntersectingPolygons. That method uses the positional epsilon = 0.0001f as an area cutoff (Abs(GetSignedArea2D()) < epsilon, and later > epsilon).

A simple square (0,0), (0.005,0), (0.005,0.005), (0,0.005) has area approximately 0.000025. Its edges are 0.005, vertices are distinct, and corners are right angles, so none of CleanPolygon's duplicate/spur/collinearity conditions removes it. The area guard then discards the whole contour. Reversing its winding also discards it, so the later hole-classification pass never sees a small clockwise hole. A 0.02-side square is retained. The base revision's CleanupPolygons only rejects exactly zero area.

I checked these four cases with float32 arithmetic matching GetSignedArea2D and reviewed the call path. This is not a Unity/C# execution result: I have not compiled the PR, replayed S2D Projects Bad.zip, or verified the editor end to end.

Please separate any area-degeneracy tolerance from the positional tolerance, preserve ordinary small simple contours, and add a Unity regression covering both windings and a small hole inside a larger contour, alongside the original T-junction case. This is a non-claim review assist, not a bounty claim or full-PR approval.

Run-Id: run-055ec3ee-a35f-412d-a3fa-9d4bc665b3a1
Trace-Id: 6568a221-16ec-4e1f-8d3c-cdd4845c063f
Requester: scheduled service monitor-sxt-bounty-pr-1757
Implementer: MISA 3 bot ID 1516725819517567077

@RaphaeLogico

Copy link
Copy Markdown
Author

Thank you for the detailed review and for pointing out the area cutoff edge case!

I have updated PR #51 to address the area-degeneracy tolerance:

  1. Separated Area & Positional Tolerances: Replaced the positional epsilon (0.0001f) with a dedicated, smaller area epsilon (AreaEpsilon = 1e-8f) for degeneracy checks in SplitSelfIntersectingPolygons.
  2. Preserved Small Polygons & Holes: Small contours (e.g., area ~0.000025) and small holes in both clockwise and counter-clockwise winding directions are now fully preserved.
  3. Unity Editor Verification: Manually verified in Unity Editor that small shapes and small holes are correctly retained, while T-junction singularities continue to be intercepted and split cleanly without triggering stack overflow errors.

All changes have been pushed in the latest commit.

@MyTH-zyxeon

Copy link
Copy Markdown

Thanks for the update. I rechecked 33cef0c19b92c6287ebb4d53c6c6f63fdb804b1b against the head in my earlier comment. The dedicated AreaEpsilon = 1e-8f addresses the specific area-cutoff example I reported.

The same float32 arithmetic model now retains the 0.005-side square in both windings (absolute area approximately 0.000025), and the two 0.02-side controls remain retained. The entry < AreaEpsilon and exit >= AreaEpsilon predicates also agree at the threshold: zero and the adjacent float below the threshold are rejected; equality and the adjacent float above it are retained.

This closes only my earlier cutoff finding at the source/arithmetic level. I have not compiled C#, run Unity, or replayed S2D Projects Bad.zip, so I cannot independently confirm the editor/hole/T-junction results or approve the full PR. Keeping those examples as reproducible Unity regression tests would make future changes to the two tolerances easier to verify. No bounty claim is being made.

Run-Id: run-ac53dc59-2782-41b3-ba85-d9b07db7d05f
Trace-Id: de5a8fc5-c718-45a7-a624-c5c9422dd031
Requester: scheduled service monitor-sxt-bounty-pr-1757
Implementer: MISA 3 bot ID 1516725819517567077

@RaphaeLogico

Copy link
Copy Markdown
Author

Thanks for the re-check and verification!

Glad to hear the float32 arithmetic model confirms that AreaEpsilon = 1e-8f retains small contours and holes as expected. The Unity Editor manual tests on S2D Projects Bad.zip and small shapes are passing cleanly as well.

Appreciate the thorough review!

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.

3 participants