java.awt.geom.Area questions

Discussion in 'Java' started by Chantal, Jan 26, 2006.

  1. Chantal

    Chantal Guest

    Hello Guys,

    I'm doing a subtract between 2 areas.

    The result is perfect.

    But when I iterate the path of the area each point where a clipping
    (intersection of the 2 areas) has been done are doubled !
    See sample below :
    Area path after subtract :
    x: 84.31491088867188, y: 51.65852737426758
    x: 83.0599209678765, y: 83.39109768273006
    x: 83.05992096787645, y: 83.39109768273006 //doubled
    x: 143.85569763183594, y: 67.90008544921875
    x: 161.66199908938066, y: 137.78241618833025
    x: 161.66199908938097, y: 137.78241618833025 //doubled
    x: 205.93727111816406, y: 139.53346252441406
    x: 209.21726989746094, y: 56.59829330444336
    x: 84.31491088867188, y: 51.65852737426758

    Do you know why ?

    After when I redo a subtract on this area with another area, the result
    is WEIRD !
    When I "path" the area, I only get the second point and this time 4
    times !
    x: 83.05992096787656, y: 83.39109768273003
    x: 83.05992096787645, y: 83.39109768273006
    x: 83.0599209678765, y: 83.39109768273006
    x: 83.0599209678765, y: 83.39109768273003

    I have to say that the second subtract don't hide totally the area and
    about 45% of area is still visible.

    So my question is :
    Do i have to first "rebuild" my area by removing the "doubled" points
    before do another subtract ?

    Thanks in advance,

    Chantal.
    Chantal, Jan 26, 2006
    #1
    1. Advertising

  2. Chantal

    Chantal Guest

    I finally solved my problem by rebuilding my area without similar
    points. I just keep each point unique by removing "doublons".

    Cheers,

    Chantal
    Chantal, Jan 26, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Mark Bram
    Replies:
    2
    Views:
    5,938
    Robert Mark Bram
    Dec 11, 2003
  2. Richard A. DeVenezia

    java.awt.geom.Area

    Richard A. DeVenezia, Jan 12, 2004, in forum: Java
    Replies:
    0
    Views:
    407
    Richard A. DeVenezia
    Jan 12, 2004
  3. Mark
    Replies:
    1
    Views:
    572
    Larry Barowski
    Jun 27, 2005
  4. morc

    Simple java.awt questions

    morc, Feb 27, 2006, in forum: Java
    Replies:
    4
    Views:
    944
    Knute Johnson
    Feb 28, 2006
  5. hotadvice
    Replies:
    14
    Views:
    691
    hotadvice
    Oct 2, 2007
Loading...

Share This Page