POV-Ray : Newsgroups : povray.windows : Difference Bug? Server Time
23 Nov 2024 10:32:11 EST (-0500)
  Difference Bug? (Message 1 to 5 of 5)  
From: scottishrob41
Subject: Difference Bug?
Date: 28 Apr 2008 17:00:00
Message: <web.48163a7957b5834cb643030@news.povray.org>
Howdy Pov-Rayers. I was curious about something I discovered while trying to
create a difference with a cylinder and a hollow box. When I try to use the
cylinder to open a hole in one side of the box, I notice the cylinder is still
visible as if I had just merged them together. I figured out playing around
with it, that the only way to get the cylinder to dissappear and leave the
difference hole in the box is to assign a 'Clear' pigment to the cylinder. Has
anyone else noticed this? Is this to be expected or is it a bug of some sort?
FYI, I am running both version 3.6.1 and the beta 3.7 on a dual core system with
1 gb Ram. Both versions give the same result. I hope someone out there can shed
some light on this. THNX.


Post a reply to this message

From: Warp
Subject: Re: Difference Bug?
Date: 28 Apr 2008 17:04:53
Message: <48163bf4@news.povray.org>
scottishrob41 <sco### [at] gmailcom> wrote:
> Howdy Pov-Rayers. I was curious about something I discovered while trying to
> create a difference with a cylinder and a hollow box. When I try to use the
> cylinder to open a hole in one side of the box, I notice the cylinder is still
> visible as if I had just merged them together. I figured out playing around
> with it, that the only way to get the cylinder to dissappear and leave the
> difference hole in the box is to assign a 'Clear' pigment to the cylinder. Has
> anyone else noticed this?

  No, nobody has ever noticed this before. Thanks for the report.

  Sarcasm aside, you have to think about primitives as if they were solid
objects. That's what "constructive solid geometry" means: Surfaces are treated
as if they enclosed solid objects.
  The 'difference' between a box and a cylinder means that you are removing
the cylinder from the box: This leaves a hole with the shape of the cylinder
in the box, of course. It's like you were carving the box with the cylinder.

  The keyword 'hollow' has absolutely nothing to do with this.

  And the proper way to *cut* a hole on the surface of the box with the
cylinder is to use 'clipped_by'.

-- 
                                                          - Warp


Post a reply to this message

From: Stephen
Subject: Re: Difference Bug?
Date: 28 Apr 2008 17:18:23
Message: <aifc1498ncmivmvq3e44ote5iq33q5thg3@4ax.com>
On 28 Apr 2008 17:04:53 -0400, Warp <war### [at] tagpovrayorg> wrote:

>
>  And the proper way to *cut* a hole on the surface of the box with the
>cylinder is to use 'clipped_by'.

Why do you say that, Warp? 
(I use a modeller and 'clipped_by' is not supported.)
-- 

Regards
     Stephen


Post a reply to this message

From: Aydan
Subject: Re: Difference Bug?
Date: 29 Apr 2008 05:25:00
Message: <web.4816e86d38a208cc1ccf29180@news.povray.org>
"scottishrob41" <sco### [at] gmailcom> wrote:
> Howdy Pov-Rayers. I was curious about something I discovered while trying to
> create a difference with a cylinder and a hollow box. When I try to use the
> cylinder to open a hole in one side of the box, I notice the cylinder is still
> visible as if I had just merged them together. I figured out playing around
> with it, that the only way to get the cylinder to dissappear and leave the
> difference hole in the box is to assign a 'Clear' pigment to the cylinder. Has
> anyone else noticed this? Is this to be expected or is it a bug of some sort?
> FYI, I am running both version 3.6.1 and the beta 3.7 on a dual core system with
> 1 gb Ram. Both versions give the same result. I hope someone out there can shed
> some light on this. THNX.

What you really want to do is to Subtract a slightly smaller box from your box
to make the box actually pysically hollow and then punch a hole into the side
with a cylinder

Something along the lines of:
difference{
  outerbox
  union{
    innerbox
    cylinder
  }
}

Greets
Aydan


Post a reply to this message

From: Alain
Subject: Re: Difference Bug?
Date: 29 Apr 2008 13:13:20
Message: <48175730$1@news.povray.org>
scottishrob41 nous illumina en ce 2008/04/28 16:58 -->
> Howdy Pov-Rayers. I was curious about something I discovered while trying to
> create a difference with a cylinder and a hollow box. When I try to use the
> cylinder to open a hole in one side of the box, I notice the cylinder is still
> visible as if I had just merged them together. I figured out playing around
> with it, that the only way to get the cylinder to dissappear and leave the
> difference hole in the box is to assign a 'Clear' pigment to the cylinder. Has
> anyone else noticed this? Is this to be expected or is it a bug of some sort?
> FYI, I am running both version 3.6.1 and the beta 3.7 on a dual core system with
> 1 gb Ram. Both versions give the same result. I hope someone out there can shed
> some light on this. THNX.
> 
> 

Not a bug, working as expected.

You start with a box. Think of that box as a solid block of some material. When 
you use the difference, it's like you carve that shape out of the first object. 
In your case it's like driling a hole into a solid block.

If you want an infinitely thin shell, using "clipped_by" or assining a clear 
pigment to the carving object is the way to go.

If you want your side to have some thickness, add a second, slightly smaller, 
box to carve out the inside of the big box.
Sample:
difference{
	box{10,-10} // The box itself
	box{9,-9} // the empty space inside the box
	cylinder{8*x,11*x, 8} // A nice big hole in one of the sides
	texture{Some_Texture}
	rotate A_Rotation
	translate Somewhere
	}

A note about the "hollow" key word: it sole and only purpose it to allow an 
object to contain a media and to allow fog to exist inside of it. Nothing else.

-- 
Alain
-------------------------------------------------
OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime


Post a reply to this message

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