Re: Creating a shape from a set of points



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,
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?
Are you looking for the convex hull? If so, I suggest a web search for
that with the word "java".

Patricia
Patricia,

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
.



Relevant Pages

  • Re: Creating a shape from a set of points
    ... I have a bunch of points ... Polygon is a particularly convenient ... Todd should look at both and decide whether either is what ... home dot woh dot rr dot com slash jbmatthews ...
    (comp.lang.java.programmer)
  • Re: modification of convex hull
    ... polygon X which contains all points of P. ... don't know how to reduce properly it's number of verticies. ... Perhaps you can say why you were disappointed by starting with the convex hull and reducing it. ... did you experiment with different criteria for choosing the edge to eliminate? ...
    (comp.graphics.algorithms)
  • Re: Novice 2D question: How to find points in a convex hull/polygon in a 2D grid (including points
    ... but perhaps a normal polygon rasterizing algorithm can do ... > checks all the points in a set to find the convex hull but I already ... > convex hull that lie on 2D grid points and their maximum number (the ... > with S that should be 0 if it's on the border, ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Arrange points so polygon is not self intersecting
    ... Call your set of points S. Find the convex hull of S. ... form a polygon with non-intersecting sides. ... If the C language implements the type long long int ... typedef long long int2; ...
    (sci.math)
  • Re: Draw a scaled arrow
    ... rotating the arrow head with the mouse cursor, ... Separate the scaling, line ... private static Polygon initPoly() ... home dot woh dot rr dot com slash jbmatthews ...
    (comp.lang.java.programmer)