Results 1 to 7 of 7
  1. #1
    rashibahal is offline Member
    Join Date
    Jun 2008
    Posts
    4
    Rep Power
    0

    Default To get the points on the perimeter of a Rounded Rectangle

    Hi all
    For some requirement in my project i have made a Rounded Rectangle. Now i want to know how can i calculate to get the points on the perimeter of that rounded rectangle.
    I also have a point of reference which will be helpful to get the perimeter points.
    Plz help me as its very urgent.

    Thanks in advance
    Last edited by rashibahal; 06-11-2008 at 02:52 PM. Reason: Wanted to add more text

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    How did you accomplish the Rectangle? That should have the data for the rectangle already.

  3. #3
    rashibahal is offline Member
    Join Date
    Jun 2008
    Posts
    4
    Rep Power
    0

    Default

    No it does not provide the data to calculate the perimeter. I want to know if some algo or code is available for this. I am using it in a method which does not provide any of the helpful functions. I have to calculate it myself.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Jordan says that, to draw a rectangle you need data, basically coordinates. You say that you don't have those?

  5. #5
    rashibahal is offline Member
    Join Date
    Jun 2008
    Posts
    4
    Rep Power
    0

    Default

    Ok, i misunderstood wht he said. I have the bounds of the figure i.e. the rounded rectangle, which gives me the height, width and the location of that rounded rectangle.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Now you know a fixed location(is that center coordination of the figure?), width and height. Just you want to find the radius of curves, right?

    Seems to me you need a simple functionality find the curve length.

  7. #7
    rashibahal is offline Member
    Join Date
    Jun 2008
    Posts
    4
    Rep Power
    0

    Default

    No, its not so...let me tell u the whole scene.

    I have a Rectangle of draw2d.geometry...which is passed in the graphics.drawRoundedRectangle() method...Hence i get a rounded rectangle figure.
    Now, in some other class i am using an overriden method... i get the access of that same draw2d's Rectangle which i used to pass in the drawRoundedRectangle()..but in the present class i am using an overriden method and i dnt have the graphics object available.

    Now, using that Rectangle...i want to make a method that would get the point exactly on the edge of the rounded rectangle when i would try to connect two such rounded rectangle figures. So, for that purpose i want to know some algo or method that wld get the points on the edge of the rounded rectangle.

Similar Threads

  1. Rectangle Intersection
    By Gwindow in forum Java 2D
    Replies: 1
    Last Post: 04-24-2008, 03:53 PM
  2. help with rectangle class
    By darkgt in forum New To Java
    Replies: 7
    Last Post: 11-14-2007, 06:19 PM
  3. Rectangle expands with applet frame
    By Godzilla in forum New To Java
    Replies: 1
    Last Post: 07-10-2007, 07:14 PM
  4. Rectangle with rounded edges??
    By orchid in forum Java 2D
    Replies: 1
    Last Post: 05-10-2007, 02:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •