Use the Area class to either subtract or intersect the original shape with/from the outline created with BasicStroke.createStrokedShape(). Intersection will produce the inside part, subtract will produce the outside part.
As far as non-convex polygons, you will probably find lots of cases where for a very convoluted self-intersecting or self-touching polygon and a very wide outline width there will be lots of visual anomalies which make the result look wrong because some part of the path overlapped in a way that wasn't intuitive. I believe the results will be correct, they just might be surprising (as with many things in geometry... ;-)
...jim
--On Tuesday, November 26, 2002 12:11 AM +0100 Ram�n Talavera <[EMAIL PROTECTED]> wrote:
For an outside border that is quite easy, the mask way works fine. For an outside border things change, as I have to scale the main Polygon and draw it again to have the outside borderline: Problem: the polygon center, if it is a regular polygon the center of mass works fine, but if the polygon is non-convex then there are problems and many borders dissapear.�Any ideas? I can post images if you wish :). Thanks, Ram�n Talavera ----- Original Message ----- From: "Dave Kavanagh" <[EMAIL PROTECTED]> To: "Ram�n Talavera" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, November 25, 2002 11:12 PM Subject: Re: [JAVA2D] STROKE_CONTROL I don't think there is a flag you can set or something easy like that. You could double the stroke width and set up a clip to either mask off the inside or the outside of the shape you wish to outline. David Quoting Ram�n Talavera <[EMAIL PROTECTED]>: > I am trying to draw a 2D polygon with a border stroke with a width > of 2.0, but I want those 2.0 to go completely inside the polygon > borderline, I mean, > normally half the line width goes outside and the other half goes > inside, but > I want to have it completely outside or completely inside, anyone > know how I > can get this effect? > > Thanks in advance, > Ram�n Talavera ===================================================================== ====== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
==========================================================================To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
