MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: determining boundary of a region in n-dimensional euclidean space

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117315] Re: determining boundary of a region in n-dimensional euclidean space
  • From: Fred Klingener <gigabitbucket at BrockEng.com>
  • Date: Tue, 15 Mar 2011 06:02:51 -0500 (EST)
  • References: <ilabtt$1su$1@smc.vnet.net>

Nabeel,

I might be misunderstanding the details of your task, but I've usually
been able to cast my (3D) region specifications in a way that'll fit
into one of Mathematica's 3D surface functions. I try first for
RegionPlot3D, and I'll illustrate with an example from the doc center.

rp3D = RegionPlot3D[x^2 + y^3 - z^2 > 0, {x, -2, 2}, {y, -2, 2}, {z,
-2, 2},
  Mesh -> None]

rp3D is a Graphics3D. The first argument of that is a GraphicsComplex,
and the first argument of that is a list of all the surface nodes.

You can extract all the region's surface nodes by brute force or by
picking off the first argument of the GraphicsComplex.

Graphics3D[
Point[
Cases[
rp3D
, GraphicsComplex[pt__, ___] :> pt
, Infinity]
  ]
 ]

If you want to strip off the bounding planes, you can do that in one
ugly  Cases or in a couple of DeleteCases.

If, for some reason, you want only the mesh lines, you can form

rp3DMesh =
 RegionPlot3D[x^2 + y^3 - z^2 > 0, {x, -2, 2}, {y, -2, 2}, {z, -2,
2},
  PlotStyle -> None]

and separate out their structure by first applying Normal[] to
rp3DMesh to resolve the GraphicsComplex to graphics primitives:

Graphics3D[
Cases[
rp3DMesh // Normal
, _Line
, Infinity]
]

It' s sort of a stunt, but you can work out ways to do 3D picking by
extracting the surface Polygons and applying Mouseovers or Tooltips to
each. Go back to the meshless example.

rp3D = RegionPlot3D[x^2 + y^3 - z^2 > 0, {x, -2, 2}, {y, -2, 2}, {z,
-2, 2},
  Mesh -> None]

It helps me to see what's going on if I strip out the vertex shading
and don't show the edges of the polygons:

Graphics3D[{
  EdgeForm[None]
  , faces = Cases[rp3D // Normal
    , Polygon[p__, ___] :> Polygon[p]
    , Infinity]
  }]

Here's a first cut at applying a Tooltip to each Polygon. The
following shows the mean coordinates of a polygon's nodes at the mouse
cursor. Bigger tricks could be done with Mouseover.

Graphics3D[{
  EdgeForm[None]
  , Tooltip[#, Mean[#[[1]]]] & /@ faces
  }
 ]

AFAIK, there's a lot to be gained if you can cast your region's
specification or get your dataset to fit one of Mathematica's
functions.

Hth,
Fred Klingener




On Mar 10, 7:16 am, Nabeel Butt <nabeel.b... at gmail.com> wrote:
> Dear Mathematica lovers ,
>                 A simple but interesting question which w=
ould help me in my
> research.I have written mathematica programs which help me define a regio=
n
> in terms of numerical points in that space.Visualising the boundary if th=
e
> region is not difficult since it is just a simple plotting task.I am howe=
ver
> interested in determining a smooth functional equation for the boundary o=
f
> the region or even the set of points on boundary.Does there exist
> Mathematica programs or built-in functions that could effectively deal wi=
th
> this kind of problem.
>                Thanks in advance !
>         I have uploaded the file on web and the link is :http://w=
ww.megaupload.com/?d=EYOAPU9Q
>                   Nabeel
>
> --
> "We have not succeeded in answering all our problems.The answers we have
> found only serve to raise a whole set of new questions.In some ways we fe=
el
> that we are as confused as ever,but we believe we are confused on a highe=
r
> level and about more important things."
> "Maybe one day we get to see all the beauty present in this world"
>
> Nabeel Butt
> UWO,London
> Ontario, Canada



  • Prev by Date: Re: $MaxNumber
  • Next by Date: Re: Joining points of ListPlot
  • Previous by thread: Re: determining boundary of a region in n-dimensional euclidean space
  • Next by thread: Re: determining boundary of a region in n-dimensional euclidean space