Coder Social home page Coder Social logo

Infinite loop in `insertVertex` about cdt HOT 4 CLOSED

artem-ogre avatar artem-ogre commented on September 21, 2024
Infinite loop in `insertVertex`

from cdt.

Comments (4)

Michael2109 avatar Michael2109 commented on September 21, 2024 1

@artem-ogre It was duplicates! My algorithm that generated my polygon includes the end point which is the same as the start point.

Got to say that this library is amazing! Extremely fast and much easier to use then others I've seen.

Thank you for the quick response!

from cdt.

artem-ogre avatar artem-ogre commented on September 21, 2024

Hi, Michael,

Thanks for creating the issue. The reason could be:

  • You have duplicated vertices in your input: you insert a vertex into a triangulation that already contains a point with exactly the same coordinates. You can use CDT::FindDuplicates method to check for duplicates in your input.
  • There is a bug in CDT. To fix this I would need an example of input that reproduces the issue. Perhaps you could break when the problem occurs and dump the content of points?

Provided code looks good to me at a quick glance. Except unless you have some other usages of CustomPoint2D you could use CDT::V2d without providing the getters. Also do you experience this issue on the latest master?

from cdt.

Michael2109 avatar Michael2109 commented on September 21, 2024

Thank you for the quick reply! I'll check for duplicates and if not I'll look into creating some data to reproduce the bug.

Yes I'm using master. I cloned it yesterday.

from cdt.

artem-ogre avatar artem-ogre commented on September 21, 2024

Great! I'm happy that it works and you like it. :)

from cdt.

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.