POV-Ray : Newsgroups : povray.general : constructing solid mesh from surface mesh Server Time
29 Jul 2024 16:20:52 EDT (-0400)
  constructing solid mesh from surface mesh (Message 11 to 13 of 13)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Warp
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 11:56:35
Message: <4e284c33@news.povray.org>
Roman Reiner <lim### [at] gmxde> wrote:
> "kiwon" <nomail@nomail> wrote:
> > If I put *inside_vector y* (because the surface's average normal direction is y

> That's not how inside_vector works.

> It simply defines the specified point to be *inside* the object, thus
> determining its inside and outside.

  Nope. inside_vector defines a *direction*, not a point.

  When determining if a point is inside the mesh or not, a ray will be
shot in that specified direction from that point, and the number of
intersections with the mesh counted. (If the count is odd, then the point
is determined to be inside.)

  For closed meshes in theory there's little significance on which direction
you choose. Basically any direction would work equally well. There are certain
pathological circumstances where the chosen direction becomes crucial, though.
For example, if you have a triange that's exactly on the xy plane, choosing
an inside_vector x (or any other vector that's on the xy plane) can cause
the insideness calculations to fail for points on that plane. While this is
quite unlikely to happen and show visible effects, in theory it can happen.
That's why you should try to choose a direction that is not tangential to
any of the triangles, if possible.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 12:01:39
Message: <4e284d63@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   For closed meshes in theory there's little significance on which direction
> you choose.

  I forgot to mention the other situation, ie. open meshes: In this case
the chosen direction is *very* crucial, as it determines which direction
the endless "interior" of the open mesh will face. For example, if you have
a "heightfield" built up as a mesh, placed on the xz plane, you want its
interior to be below it, ie. pointing to the negative y direction. In that
case you would use "inside_vector y" (which means that interior testing
rays are shot right up).

  (Solid open meshes can often be useful in conjunction with csg, and
perhaps sometimes even on their own, even though in this case you have
to take into account that the "interior" of the mesh will extend to
infinity at the opposite direction of the inside_vector.)

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 21:32:16
Message: <4e28d320$1@news.povray.org>

> Dear POV-Ray users,
>
> when there is only a surface mesh, is there any way to construct a solid
> (volumetric) mesh covered by other solid object boundary such as box?
>
> This codes are what I'm just trying, but doesn't seem to work:
>
>    #declare mysurface = mesh2 {
>      ... surface data
>    }
>
>    #declare myvolume = union {
>      box {0, 1 clipped_by {mysurface}}
>      mysurface
>    }
>
> Thanks
>
> Tested in Persistence of Vision(tm) Ray Tracer Version 3.7.0.RC3
> Issued: Parse Error: Illegal texture or patch in clip, bound or object pattern.
>
>
>

I see absolutely no logical to use that kind of construction.

clipped_by cuts a hole in your box and leave it open. You then plug it 
with your mysurface object.
If mysurface don't cover exactly the wanted opening, there will be bits 
of the parent object sticking or bits of the mesh protuding around.

If you use this:
intersection{
  box{0, 1}
  object{mysurface}
  texture{...}
}

With a mysurface that have a proper inside_vector, you will have the 
same result.

Also, mysurface can now be defined with a texture if you want to, or 
need it (like when using an UV maped texture)


Alain


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.