POV-Ray : Newsgroups : povray.newusers : Intersection of Mesh and Box Server Time
23 Nov 2024 17:39:16 EST (-0500)
  Intersection of Mesh and Box (Message 1 to 6 of 6)  
From: Johannes
Subject: Intersection of Mesh and Box
Date: 8 Sep 2012 10:00:00
Message: <web.504b4e1d416e823cffb9b00a0@news.povray.org>
Hello,

I'd like to get an intersection of a cube and an octahedron (mesh).
I use this code:

  intersection {
    mesh2 { //Oktaeder
      vertex_vectors {
        6,
        <0,-1,0>,
        <-1,0,0>,
        <0,0,-1>,
        <1,0,0>,
        <0,0,1>,
        <0,1,0>
      }
      face_indices {
        8,
        <0,1,2>,
        <0,2,3>,
        <0,3,4>,
        <0,4,1>,
        <5,1,2>,
        <5,2,3>,
        <5,3,4>,
        <5,4,1>,
      }
    }
    box {
      <-1,-1,-1>*0.7, <1,1,1>*0.7
    }
    pigment { Red }
    rotate y*20     // Equivalent to "rotate <0,20,0>"
  }

The problem is, that some of the faces (the faces of the cube) are transparent,
although they should have a red surface.

Any help will be appreciated. (I'm not a native speaker)
Johannes


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Intersection of Mesh and Box
Date: 8 Sep 2012 10:17:43
Message: <504b5387$1@news.povray.org>
Johannes wrote:

> The problem is, that some of the faces (the faces of the cube) are transparent,
> although they should have a red surface.

In order for a mesh to be treated as a solid (not a surface),
you need to add an inside_vector statment, e.g. inside_vector y


Post a reply to this message

From: Johannes
Subject: Re: Intersection of Mesh and Box
Date: 8 Sep 2012 15:15:01
Message: <web.504b9824b262974a51b128b30@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> In order for a mesh to be treated as a solid (not a surface),
> you need to add an inside_vector statment, e.g. inside_vector y

Thank you very much!
It worked :D


Post a reply to this message

From: Alain
Subject: Re: Intersection of Mesh and Box
Date: 9 Sep 2012 13:56:53
Message: <504cd865$1@news.povray.org>

> Christian Froeschlin <chr### [at] chrfrde> wrote:
>> In order for a mesh to be treated as a solid (not a surface),
>> you need to add an inside_vector statment, e.g. inside_vector y
>
> Thank you very much!
> It worked :D
>
>
You need to make sure that the inside_vercor is not parallel to any 
face. If that's the case, change it's value slightly,like: <0.01,1,0>


Alain


Post a reply to this message

From: Cousin Ricky
Subject: Re: Intersection of Mesh and Box
Date: 25 Sep 2012 12:30:00
Message: <web.5061db4db262974a85de7b680@news.povray.org>
Alain <kua### [at] videotronca> wrote:
> You need to make sure that the inside_vercor is not parallel to any
> face. If that's the case, change it's value slightly,like: <0.01,1,0>

Is this documented anywhere? It is good to know. (It makes sense, now that I
think about it.)


Post a reply to this message

From: Alain
Subject: Re: Intersection of Mesh and Box
Date: 26 Sep 2012 21:51:24
Message: <5063b11c$1@news.povray.org>

> Alain <kua### [at] videotronca> wrote:
>> You need to make sure that the inside_vercor is not parallel to any
>> face. If that's the case, change it's value slightly,like: <0.01,1,0>
>
> Is this documented anywhere? It is good to know. (It makes sense, now that I
> think about it.)
>
>

I think so.
Also, ther is a mention that if there are artefacts or apparent holes, 
that changing the inside_vector direction by a tiny amount will normaly 
resolve the isue. In some cases, it will switch to another face, but, 
with some luck and findling, it will happen in some area where it don't 
mather: Back side, outside the intersection/difference area, hiden by 
another object,...




Alain


Post a reply to this message

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