POV-Ray : Newsgroups : povray.newusers : figured out my difference {} problem Server Time
25 Nov 2024 22:48:35 EST (-0500)
  figured out my difference {} problem (Message 1 to 2 of 2)  
From: inhahe
Subject: figured out my difference {} problem
Date: 10 Feb 2005 17:43:36
Message: <420be398@news.povray.org>
i figured out the difference {} problem, the surfaces can't overlap
apparently if you want to subtract.

either that or it just doesn't like flat boxes.


Post a reply to this message

From: regdo
Subject: Re: figured out my difference {} problem
Date: 10 Feb 2005 17:57:16
Message: <420be6cc$1@news.povray.org>
inhahe wrote:
> i figured out the difference {} problem, the surfaces can't overlap
> apparently if you want to subtract.
> 
> either that or it just doesn't like flat boxes.
> 
> 
IMHO, you have two things to take into account :
first never use objects that have exactly the same coordinates where 
using them in CSG : you can never know which one will be considered 
visible by POV. Try initializing your Count variable with 0.1, it should 
work better.
Second, difference is between two object (at least, it's easier to 
understand if you use it that way). Try making a union out of the 
objects to remove from the main box, then substract that union from the 
main box, that way :
#declare Union_To_Substract = union {
   #declare Count=-0.9; //to avoid exact overlap of box side
   #while (Count<2) // I'm more used to using < than <=
     box
       {
       <Count, -2.1, -29>  // -2.1 for the same reason as above
       <Count+.01, 2.1, -29>
       pigment {color rgb <1,1,0>}
       inverse
       }
   #declare Count = Count + .2; //the stripes of nothing are 0.1 units
                                //wide, so you have to jump a little
                                //further
   #end
}

difference {
   box { ... }
   union {Union_To_Substract}
}

Does this match your need ?
Regis.


Post a reply to this message

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