Re: Creating a shape from a set of points
- From: "John B. Matthews" <nospam@xxxxxxxxxx>
- Date: Thu, 05 Jun 2008 20:01:46 -0400
In article
<7009b179-1518-40e3-8582-81c5c5069c42@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Todd <todd.heidenthal@xxxxxxxx> wrote:
On Jun 5, 3:14 pm, Patricia Shanahan <p...@xxxxxxx> wrote:
John B. Matthews wrote:
In article
<9ba81c26-151b-42f0-99c5-a214dafac...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Todd <todd.heident...@xxxxxxxx> wrote:
On Jun 5, 1:21 pm, Patricia Shanahan <p...@xxxxxxx> wrote:
Todd wrote:
Hello,Are you looking for the convex hull? If so, I suggest a web search for
I have a bunch of points (defined in 2-D space, i.e., x-y coordinates)
that have a well-defined range that is easy to determine visually. I
need to determine the boundary of the input set of points and then
later test if a new point falls inside or outside of the boundary.
Is there any API, graphical or not, that takes a bunch of points and
creates a bounded shape, ignoring the points internal to the bounds?
Or does someone have some hints as to how I can use the methods of an
API to reduce my point set to just the boundary points?
that with the word "java".
PatriciaPatricia,
I had never heard that term before, however, I believe that may be the
key!!
Thanks tremendously,
Todd
This is a worthy pursuit, but you might also consider getBounds2D() or
contains() in the Shape interface. Polygon is a particularly convenient
implementation.
getBounds2D() returns a Rectangle2D. The convex hull is usually not
rectangular. Todd should look at both and decide whether either is what
is really needed.
Patricia
Patricia,
You are correct, I need a more tightly-fit boundary. So far, my
research
on the convex hull indicates that for open shapes like the letter C or
U
will result in boundary points closing the opening of shape.
Are you familiar with any algorithms that do not close the openings?
Thanks,
Todd
You should consider contains(). Shape's definition of "insideness"
applies specifically to Polygon. The Polygon doesn't have to be convex,
but it is assumed to be simple and closed. Is your polygon is like a "U"
(open) or the outline of a "U" (closed).
John
--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
.
- Follow-Ups:
- Re: Creating a shape from a set of points
- From: Todd
- Re: Creating a shape from a set of points
- References:
- Creating a shape from a set of points
- From: Todd
- Re: Creating a shape from a set of points
- From: Todd
- Re: Creating a shape from a set of points
- From: John B. Matthews
- Re: Creating a shape from a set of points
- From: Todd
- Creating a shape from a set of points
- Prev by Date: Re: StringBuilder vs. Manually Building Strings
- Next by Date: Re: StringBuilder vs. Manually Building Strings
- Previous by thread: Re: Creating a shape from a set of points
- Next by thread: Re: Creating a shape from a set of points
- Index(es):
Relevant Pages
|