Getting points out of CirculinearDomain2D

Help
Anonymous
2012-05-29
2012-12-12
  • Anonymous - 2012-05-29

    I am having trouble getting the lines or circles out of CirculinearDomain2D obtained as a result of using getBuffer method on a SimplePolygon2D object.

    I can draw the result to a frame buffer with draw method but I have not found how can I get the list of points (or lines and curves) it is made of, which is needed by my application.

    Thanks,

    misan

     
  • David

    David - 2012-05-30

    Hi,

    you firsty need to extract the boundary of the domain (via the getBoundary()) method.
    The boundary is an instance of Curve2D interface, so you can extract points with the getVertices() method.

    You can also iterate on the continuous curves that constitute the boundary (Curve2D.getContinuousCurves()), extract each smooth curves (ContinuousCurve2D.getSmoothPieces()), and test if it is circle arc or line segment.

    Hope this helps ?

    regards,
    David

     
  • Anonymous - 2012-05-30

    Thanks a lot.

    I am sorry I was not able to figure that out by myself.

    Kind regards,

    misan

     
  • David

    David - 2012-05-31

    Hi,

    no problem,
    it's not always easy to undersatnd an API, and I also should write more demos/tutorials…
    regards,
    David

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks