Code Monkey home page Code Monkey logo

Comments (12)

strk avatar strk commented on July 17, 2024

\cc @vmora, @mhugo

from sfcgal.

strk avatar strk commented on July 17, 2024

Simplified input still reproducing the robustness issue:

POLYGON((1686350.74365082 5402217.7661505,1684030.810026 5402682.520688,1684000 5402672.31399816,1683763.966259 5402588.179891,1681281.134295 5403807.881624,1683915.838219 5402676.741864,1684000 5402711.41802501,1684020.618162 5402719.913077,1687524.6533522 5404490.5663652,1687854.358551 5403919.598884,1686350.74365082 5402217.7661505))

from sfcgal.

strk avatar strk commented on July 17, 2024

Filed upstream here: CGAL/cgal#123

from sfcgal.

strk avatar strk commented on July 17, 2024

I guess I could implement the polygon translation in SFCGAL, but it'd be best done after pr #85 is merged

from sfcgal.

strk avatar strk commented on July 17, 2024

Translating a Polygon_with_holes_2 is revealing harder than I hoped for. It'd be a pity to clone the input Geometry just for the sake of translating, am I missing an easy way to do that ?

from sfcgal.

drewish avatar drewish commented on July 17, 2024

It's probably not the issue but worth double checking the vertex ordering. I forget which it wants but I was getting back 0,0 points. Reversing the direction fixed that. If you're only getting that one point that's wrong it might be an totally different issue.

from sfcgal.

strk avatar strk commented on July 17, 2024

Single point out, and fixed by augmenting the available bits for computation (shifting to origin)

from sfcgal.

vmora avatar vmora commented on July 17, 2024

It looks like the problematic vertex joins two aligned segments. If it's really the case, then maybe joining aligned ring segment would fix things.

I don't mind gaining precision/robustness by moving vtx near origin, but this alignment, considering the definition of a straight skeleton bugs me a little.

from sfcgal.

strk avatar strk commented on July 17, 2024

from sfcgal.

strk avatar strk commented on July 17, 2024

Here's the HEXWKB format for the offending polygon input as I just found out that parsing it from WKT makes the problem go away:

010300002091080000010000000A00000063022B0A53C139419EFCD3EF4E9B54412DDD5DCF3EB23941C4F352A10E9C54410400000020B23941C08B18140C9C544116E9B9D592A739410DA9B7E75A9B54413B28612281A7394113876CF8279D54413C8595D6CBB1394125B37A2F0D9C54410400000020B23941F9EBC0DA159C544168DD3F9E34B2394184DA6FFA179C5441524F641C54C13941C3874722D79D544163022B0A53C139419EFCD3EF4E9B5441

Any way to have SFCGAL parse WKB for writing the testcase ?

from sfcgal.

strk avatar strk commented on July 17, 2024

about the aligned segments idea, this simple polygon does not trigger the problem:
POLYGON((0 0, 10 0, 10 10, 5 10, 0 10, 0 0))

from sfcgal.

strk avatar strk commented on July 17, 2024

Also passing the input polygon trough ST_Simplify() with a tolerance of 1e-10 does not remove the "almost collinear" vertex. A tolerance of 1e-9 does, fixing the problem.

from sfcgal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.