POV-Ray : Newsgroups : povray.newusers : csg woes Server Time
23 Nov 2024 07:29:29 EST (-0500)
  csg woes (Message 1 to 7 of 7)  
From: dick balaska
Subject: csg woes
Date: 28 Apr 2017 03:03:50
Message: <5902e956$1@news.povray.org>
I have a weird simple csg error that I'm missing the solution to.
I'm trying to make a TV with rounded corners for the picture tube.
Seems simple enough.
union {
    difference {
       tvBox
       tvTubeCutout
    }
    rectangle_with_image_to_stick_in_TV
}

but my rounded corners, inside corners for the screen are not working. 
Can someone take a look?


// +a0.3 +w640 +h480 +itvTest.pov +otvTest.png

-- 
dik


Post a reply to this message


Attachments:
Download 'tvtest.pov.txt' (5 KB) Download 'brokentvcorner.png' (3 KB)

Preview of image 'brokentvcorner.png'
brokentvcorner.png


 

From: Stephen
Subject: Re: csg woes
Date: 28 Apr 2017 03:47:00
Message: <5902f374$1@news.povray.org>
On 4/28/2017 8:03 AM, dick balaska wrote:
> #declare TV=
> 	union {
> 		difference {
> 			#if (!ShowCutout)
> 				merge {		// TV box


I can't test properly but changing the above merge to a union mostly 
fixes it.

-- 

Regards
     Stephen


Post a reply to this message


Attachments:
Download 'untitled0000.png' (132 KB)

Preview of image 'untitled0000.png'
untitled0000.png


 

From: Thomas de Groot
Subject: Re: csg woes
Date: 28 Apr 2017 03:52:40
Message: <5902f4c8$1@news.povray.org>
On 28-4-2017 9:03, dick balaska wrote:
> I have a weird simple csg error that I'm missing the solution to.
> I'm trying to make a TV with rounded corners for the picture tube.
> Seems simple enough.
> union {
>    difference {
>       tvBox
>       tvTubeCutout
>    }
>    rectangle_with_image_to_stick_in_TV
> }
>
> but my rounded corners, inside corners for the screen are not working.
> Can someone take a look?
>

Because you are using 'merge'? Replace by 'union' and all will be well.

If not applied on transparent objects, merge should be avoided as it 
also is slower than union.


-- 
Thomas


Post a reply to this message

From: Leroy
Subject: Re: csg woes
Date: 28 Apr 2017 18:55:00
Message: <web.5903c81944077e80f33446ad0@news.povray.org>
dick balaska <dic### [at] buckosoftcom> wrote:
> I have a weird simple csg error that I'm missing the solution to.
> I'm trying to make a TV with rounded corners for the picture tube.
> Seems simple enough.
> union {
>     difference {
>        tvBox
>        tvTubeCutout
>     }
>     rectangle_with_image_to_stick_in_TV
> }
>
> but my rounded corners, inside corners for the screen are not working.
> Can someone take a look?
>
>
> // +a0.3 +w640 +h480 +itvTest.pov +otvTest.png
>
> --
> dik

Is tvTubeCutout longer than tvbox in the direction of the screen shot.
If not, then coincident surfaces might be the trouble.
That can give your weird csg error, depending on object placement and/or camera
placement POV will calc the pixel colors differently.


Post a reply to this message

From: dick balaska
Subject: Re: csg woes
Date: 30 Apr 2017 00:56:40
Message: <59056e88$1@news.povray.org>
Am 2017-04-28 03:52, also sprach Thomas de Groot:
> On 28-4-2017 9:03, dick balaska wrote:
>> I have a weird simple csg error that I'm missing the solution to.
>> I'm trying to make a TV with rounded corners for the picture tube.
>> Seems simple enough.
>> union {
>>    difference {
>>       tvBox
>>       tvTubeCutout
>>    }
>>    rectangle_with_image_to_stick_in_TV
>> }
>>
>> but my rounded corners, inside corners for the screen are not working.
>> Can someone take a look?
>>
>
> Because you are using 'merge'? Replace by 'union' and all will be well.
>
> If not applied on transparent objects, merge should be avoided as it
> also is slower than union.
>
>

Thanks. That was it.  I had switched it from union to merge; I was 
getting weird coincidence errors on the main outer box. They've gone 
away too.
(I think I was doing union {box {color Red} box {color Red}} instead of 
union {box {} box {} color Red}
)

Weird that merge has that issue. I would think it shouldn't matter for 
this application, just be slower.

-- 
dik


Post a reply to this message

From: Thomas de Groot
Subject: Re: csg woes
Date: 30 Apr 2017 02:48:12
Message: <590588ac@news.povray.org>
On 30-4-2017 6:56, dick balaska wrote:
> Am 2017-04-28 03:52, also sprach Thomas de Groot:
>> On 28-4-2017 9:03, dick balaska wrote:
>>> I have a weird simple csg error that I'm missing the solution to.
>>> I'm trying to make a TV with rounded corners for the picture tube.
>>> Seems simple enough.
>>> union {
>>>    difference {
>>>       tvBox
>>>       tvTubeCutout
>>>    }
>>>    rectangle_with_image_to_stick_in_TV
>>> }
>>>
>>> but my rounded corners, inside corners for the screen are not working.
>>> Can someone take a look?
>>>
>>
>> Because you are using 'merge'? Replace by 'union' and all will be well.
>>
>> If not applied on transparent objects, merge should be avoided as it
>> also is slower than union.
>>
>>
>
> Thanks. That was it.  I had switched it from union to merge; I was
> getting weird coincidence errors on the main outer box. They've gone
> away too.
> (I think I was doing union {box {color Red} box {color Red}} instead of
> union {box {} box {} color Red}
> )
>
> Weird that merge has that issue. I would think it shouldn't matter for
> this application, just be slower.
>

I too have been wondering about that. The only difference merge does is 
taking out the internal surfaces of the objects, but works as a union 
otherwise... or so I believe.

-- 
Thomas


Post a reply to this message

From: clipka
Subject: Re: csg woes
Date: 2 May 2017 12:10:36
Message: <5908af7c@news.povray.org>
Am 30.04.2017 um 06:56 schrieb dick balaska:

> Thanks. That was it.  I had switched it from union to merge; I was
> getting weird coincidence errors on the main outer box. They've gone
> away too.
> (I think I was doing union {box {color Red} box {color Red}} instead of
> union {box {} box {} color Red}
> )
> 
> Weird that merge has that issue. I would think it shouldn't matter for
> this application, just be slower.

Not so weird if you understand how merge works internally.

In a union, coincident surfaces "only" compete for texture and interior.

In a merge, coincident surfaces _additionally_ make a mess of the
geometry itself.

The reason is that a merge works by ignoring surfaces of any member that
are found to be inside any of the sibling objects. If a surface is
coincident with that of any sibling, it's more or less pure chance
whether that surface will be judged outside that sibling object (=
visible) or inside it (= invisible).

(The same is true for intersection and difference as well.)


Post a reply to this message

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