Ted, That sounds like the Open and Close operations in morphology. You may consider that, but need more work to get the line representation.
The uniform scaling would not work since the distance between the line and expanded one depends on the slope of the line. Here is an alternative for expansion: For 2 neighboring line segments expand them same amount find the intersection point You have the expanded shape after you have all intersection points. That may only apply to the shape you specified. The same algorithm could have trouble when extracted for example, the extracted line may be outside of the shape or you will have a self-intersecting shape. Hope that helps, Yang-Ming --- Ted Hill <[EMAIL PROTECTED]> wrote: > Hi Jim, > > Let me try to explain what I mean by > expand/contract: > > If my simple (i.e. no intersections of lines) closed > shape is defined by a > series of lines as defined by an ordered set of x,y > points (first and last > point the same), > > then an expansion would be another simple closed > shape also defined by a set > of lines where each line in the expanded shape is > parallel to a line in the > orig shape and the expanded shape completely > contains the orig shape. > Furthermore, the distance between corresponding > parallel lines in the two > shapes is equal for all parallel line pairs. (So for > example the expanded > shape could be viewed as a margin of constant width > around the original > shape.) > > Similarly the contraction is a shape inside the > original shape, composed of > line segments parallel to the segments of the orig > shape. > > (Not sure about this, but I think) the orig shape > and it's expanded and > contracted forms should all share the same 'center' > point (perhaps the > center of the BoundingBox). > > Your suggestion of applying a transform to the > original is interesting, I'll > give it a try. > > Thanks, > > Ted Hill > > > > ----- Original Message ----- > From: "Jim Bucher" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, November 26, 2002 1:20 PM > Subject: Re: [JAVA2D] General Path > contraction/expansion algorithm (again) > > > > What do you mean by expand and contract? Can't you > just apply a > > transform to the shape? > > > > Ted Hill wrote: > > > Hello, > > > > > > I forgot to mention that the GeneralPath that I > want to expand/contract > is a > > > simple closed shape. > > > > > > Does anyone know of an algorithm that can be > used to 'expand' or > 'contract' > > > a general path? > > > > > =========================================================================== > > 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". __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com =========================================================================== 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".
