POV-Ray : Newsgroups : povray.newusers : don't understand difference {}, help? Server Time
30 Jul 2024 00:29:33 EDT (-0400)
  don't understand difference {}, help? (Message 1 to 2 of 2)  
From: inhahe
Subject: don't understand difference {}, help?
Date: 10 Feb 2005 17:38:45
Message: <420be275@news.povray.org>
I thought I understood difference, by reading the docs, but I can't get it
to work right.

here's my code.
ignore the cylinder for now


cylinder
 {
 <-2, 2, -2>
 <2, -2, 2>
 .5
 pigment {color rgb 1}
 }
light_source
  {
  <0, 0, -30>
  color rgb 1
  parallel
  point_at 0
  }
camera

  {
  //location <0,0,-10>

  location <0,0,-30>


  look_at 0
  }
intersection
  {
  box
    {
    <-2, -2, -29>
    <2, 2, -29>


    pigment {color rgb <1,0,0>}

    }

  #declare Count=-2;
  #while (Count<=2)
    box
      {
      <Count, -2, -29>
      <Count+.01, 2, -29>
      pigment {color rgb <1,1,0>}
      inverse
      }
  #declare Count = Count + .1;
  #end



  }


What I want is a plane (a square actually) with stripes of *nothing* (of
width .01) going through it.  What I get is stripes of yellow (the color of
the objects i'm trying to subtract from the square).

I said difference, but i'm using intersection. that's because when
difference didn't work as i expected i switched to intersection using the
'inverse' keyword, which the docs said is equivalent -- and i get the same
result as when i used difference.


Post a reply to this message

From: Warp
Subject: Re: don't understand difference {}, help?
Date: 10 Feb 2005 19:15:22
Message: <420bf91a@news.povray.org>
Firstly, if you want to substract an object from another, they should not
have councident surfaces. That is, if you want to for example cut a hole
through a box with another box, the cutting box should be slightly
longer in the direction of the hole.

  Secondly, in the resulting object the surfaces which belong to the
cutting object, ie the new surfaces which appear in the original object
due to the cutting, will be textured with the cutting object's texture.
(If you want to keep the texture of the original object in these new
surfaces you have to use cutaway_textures.)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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