POV-Ray : Newsgroups : povray.general : QUESTION: union and difference not working properly? Server Time
1 Nov 2024 05:22:00 EDT (-0400)
  QUESTION: union and difference not working properly? (Message 1 to 2 of 2)  
From: Sven Littkowski
Subject: QUESTION: union and difference not working properly?
Date: 13 Sep 2013 04:26:13
Message: <5232cc25$1@news.povray.org>
Hi,

here's something strange: I have the following source code of a union
and a difference. But when using them, the 2nd element of each is being
ignored. What do I do wrong?

//--- UNION ----------------------------

#declare Country = plane
{
 y, 0.0
 pigment { color White }
}

#declare Plan = box
{
 < -5.0, 0.0, -1.0 > < 20.0, 0.0001, 15.0 >
 pigment
 {
  checker
  color White
  color OrangeRed+Red
 }
}

#declare Land = union
{
 object { Country }
 object { Plan }
}

------

But when using them without "union", they show up...

object { Country }
object { Plan }


//--- DIFFERENCE ----------------------------

#declare Cylinder_OverAll = cylinder
{
 < 7.5, -1.0, 0.0 > < 7.5, -1.0, 10.0 > 7.5
 scale < 1.0, 0.5, 1.0 >
 }

#declare Cylinder_DivisionInside = cylinder
{
 < 7.5, -1.0, 0.0 > < 7.5, -1.0, 10.0 > 7.25
 scale < 1.0, 0.5, 1.01 >
}

#declare Roof = difference
{
 object { Cylinder_OverAll }
 object { Cylinder_DivisionInside scale < 1.0, 1.0, 2.0 > }
 pigment { color White }
 finish { Dull }
}


Post a reply to this message

From: Thomas de Groot
Subject: Re: QUESTION: union and difference not working properly?
Date: 13 Sep 2013 07:06:10
Message: <5232f1a2$1@news.povray.org>
On 13-9-2013 10:25, Sven Littkowski wrote:
> Hi,
>
> here's something strange: I have the following source code of a union
> and a difference. But when using them, the 2nd element of each is being
> ignored. What do I do wrong?
>
> //--- UNION ----------------------------
>
> #declare Country = plane
> {
>   y, 0.0
>   pigment { color White }
> }
>
> #declare Plan = box
> {
>   < -5.0, 0.0, -1.0 > < 20.0, 0.0001, 15.0 >
>   pigment
>   {
>    checker
>    color White
>    color OrangeRed+Red
>   }
> }
>
> #declare Land = union
> {
>   object { Country }
>   object { Plan }
> }
>

This is a *declare* statement. In order to view it write:

object {Land}

Alternatively, you can also just write:

union {
  object { Country }
  object { Plan }
}

> ------
>
> But when using them without "union", they show up...
>
> object { Country }
> object { Plan }
>
>
> //--- DIFFERENCE ----------------------------
>
> #declare Cylinder_OverAll = cylinder
> {
>   < 7.5, -1.0, 0.0 > < 7.5, -1.0, 10.0 > 7.5
>   scale < 1.0, 0.5, 1.0 >
>   }
>
> #declare Cylinder_DivisionInside = cylinder
> {
>   < 7.5, -1.0, 0.0 > < 7.5, -1.0, 10.0 > 7.25
>   scale < 1.0, 0.5, 1.01 >
> }
>
> #declare Roof = difference
> {
>   object { Cylinder_OverAll }
>   object { Cylinder_DivisionInside scale < 1.0, 1.0, 2.0 > }
>   pigment { color White }
>   finish { Dull }
> }

Same thing here:

object {Roof}


Thomas


Post a reply to this message

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