POV-Ray : Newsgroups : povray.general : Problem using difference with height_field Server Time
1 Nov 2024 14:19:35 EDT (-0400)
  Problem using difference with height_field (Message 1 to 9 of 9)  
From: Patrick Dugan
Subject: Problem using difference with height_field
Date: 29 Jun 2000 20:20:34
Message: <395be7d2@news.povray.org>
I have a height_field that I want to "carve" out a cone shape.  Whenever I
use the
difference between the height_field & cone it always looks like a union.  In
fact if I use
a union instead it looks the same.  The z scale of the height_field is
pretty flat but it acts as though there is an invisible clear area above it.
Is there no way I can carve out a cone shape from the height_field?  Below
is a sample of the code....


#declare TableTop =
object {
   height_field {
      tga "MetalGrid.tga"
      smooth
      hierarchy on
      translate <-0.5, -0.5, -0.5>
      pigment{color red 0 green 0 blue 0.4}
      finish {
         reflection 0.1
         crand 0.02
         ambient 0.1
         diffuse 0.63
         phong 0.2
         phong_size 10
      }

      rotate <90,0,180>
   }
   scale <50, 50, 0.017>
   translate <0,0,1>
   hollow
}

#declare NewTop =
difference {
   object {TableTop}
   cone {<0,0,-0.25>, 0.5 <0,0,0.5>, 0 translate <-2,0,1> texture
{Brushed_Aluminum}}
}

object {NewTop}


Post a reply to this message

From: H  E  Day
Subject: Re: Problem using difference with height_field
Date: 29 Jun 2000 20:50:14
Message: <01bfe22c$b0af9a80$4b7889d0@daysix>
| #declare NewTop =
| difference {
|    object {TableTop}
|    cone {<0,0,-0.25>, 0.5 <0,0,0.5>, 0 translate <-2,0,1> texture

You need to put the cone *before* the height_field.  The way differences
work is that the first object is the thing from which all else is
subtracted.

H.E. Day


Post a reply to this message

From: Patrick Dugan
Subject: Re: Problem using difference with height_field
Date: 29 Jun 2000 22:09:44
Message: <395c0168$1@news.povray.org>
I am pretty familiar with the difference command.  The cone is being removed
from the table top.

The table top is the thing from which the cone is being subtracted.  I am
trying to make an effect like someone drilling a hole (cone shape) into the
table top.



"H. E. Day" <Pov### [at] aolcom> wrote in message
news:01bfe22c$b0af9a80$4b7889d0@daysix...
> | #declare NewTop =
> | difference {
> |    object {TableTop}
> |    cone {<0,0,-0.25>, 0.5 <0,0,0.5>, 0 translate <-2,0,1> texture
>
> You need to put the cone *before* the height_field.  The way differences
> work is that the first object is the thing from which all else is
> subtracted.
>
> H.E. Day
>


Post a reply to this message

From: Ken
Subject: Re: Problem using difference with height_field
Date: 29 Jun 2000 22:32:54
Message: <395C05D7.36D917D0@pacbell.net>
Patrick Dugan wrote:
> 
> I am pretty familiar with the difference command.  The cone is being removed
> from the table top.

It is important to remember that a HF object is much like a sheet of
paper. It is considered an infinately thin object. So trying to make
a hole in a HF requires that you provide the hole material for it.
Otherwise all you are really doint is making a cutout in the surface
of the HF itself.

Try the following steps -

1. intersect the cone by the HF - use the open keyword with the cone
   (This step creates the hole material with a top that conforms to
    the irregular features of the surface of the HF object) You might
    also try clipping the cone with the HF if this step does not work
    as described.

#declare Cone =
intersection {
               cone{<...>,.,<...>,. open}
               height_field {}
             }

2. difference the HF with another cone of the same size and location
   - do not use the open keyword with this cone. (This step creates
   the cutout through the HF. You could as easily use an intesection
   for this operation)

#declare HF =
difference {
             height_field {}
             cone {}
           }

3. union the intersected cone with the differenced HF. (This step
   combines your "hole" with the HF object to create the effect
   you are looking for - I hope).

union {
       object{Cone}
       object{HF  }
      }


This might work but I have not verified it.

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Patrick Dugan
Subject: Re: Problem using difference with height_field
Date: 29 Jun 2000 22:58:00
Message: <395c0cb8@news.povray.org>
The method left a hollow cone stuck in the HF.  No hole just stuck in there.
I think I will have to give up.  It sounded like an easy idea and a good
effect, but seems to difficult to implement.  Thanks for the assistance
though!

"Ken" <tyl### [at] pacbellnet> wrote in message
news:395C05D7.36D917D0@pacbell.net...
>
>
> Patrick Dugan wrote:
> >
> > I am pretty familiar with the difference command.  The cone is being
removed
> > from the table top.
>
> It is important to remember that a HF object is much like a sheet of
> paper. It is considered an infinately thin object. So trying to make
> a hole in a HF requires that you provide the hole material for it.
> Otherwise all you are really doint is making a cutout in the surface
> of the HF itself.
>
> Try the following steps -
>
> 1. intersect the cone by the HF - use the open keyword with the cone
>    (This step creates the hole material with a top that conforms to
>     the irregular features of the surface of the HF object) You might
>     also try clipping the cone with the HF if this step does not work
>     as described.
>
> #declare Cone =
> intersection {
>                cone{<...>,.,<...>,. open}
>                height_field {}
>              }
>
> 2. difference the HF with another cone of the same size and location
>    - do not use the open keyword with this cone. (This step creates
>    the cutout through the HF. You could as easily use an intesection
>    for this operation)
>
> #declare HF =
> difference {
>              height_field {}
>              cone {}
>            }
>
> 3. union the intersected cone with the differenced HF. (This step
>    combines your "hole" with the HF object to create the effect
>    you are looking for - I hope).
>
> union {
>        object{Cone}
>        object{HF  }
>       }
>
>
> This might work but I have not verified it.
>
> --
> Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
> http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Ken
Subject: Re: Problem using difference with height_field
Date: 30 Jun 2000 01:26:27
Message: <395C2E86.406B292@pacbell.net>
Patrick Dugan wrote:
> 
> The method left a hollow cone stuck in the HF.  No hole just stuck in there.
> I think I will have to give up.  It sounded like an easy idea and a good
> effect, but seems to difficult to implement.  Thanks for the assistance
> though!

I tried this and it worked fine -

Use this section to create the tests.tga image

/*
camera{location<0,0,-10> look_at 0 orthographic}
light_source{<0,0,-100> rgb 1}


plane{z,0 pigment{rgb 1}normal{bumps 1}}
*/


This is the cone creating a big cone shaped divot in the surface of
the HF object

camera{location<0,2,-2> look_at 0}
light_source{<0,10,-10> rgb 1}


#declare HF =
difference {
             height_field {tga "tests.tga" smooth translate -.5 }
             cone{<0,-1,0>,0,<0,1,0>,.5 open }
           }

object {HF pigment{rgb 1}}


-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Chris Huff
Subject: Re: Problem using difference with height_field
Date: 30 Jun 2000 10:24:37
Message: <chrishuff-CAD9C0.09244130062000@news.povray.org>
In article <395C05D7.36D917D0@pacbell.net>, lin### [at] povrayorg 
wrote:

> It is important to remember that a HF object is much like a sheet of
> paper. It is considered an infinately thin object. So trying to make
> a hole in a HF requires that you provide the hole material for it.

Actually, it is infinitely thick, though it is still classed as a 
"finite solid primitive". All points -y of the surface are "inside". It 
doesn't have visible sides, but you can still see their effect in some 
CSG's.

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Peter Popov
Subject: Re: Problem using difference with height_field
Date: 30 Jun 2000 15:55:33
Message: <6fqplsog9o19vghd9fk81pk9raarslvk7m@4ax.com>
On Thu, 29 Jun 2000 19:20:34 -0500, "Patrick Dugan"
<pat### [at] netinsnet> wrote:

>I have a height_field that I want to "carve" out a cone shape.  

There is a demo file bundled in the POV distribution package called
"hfclip.pov" which you might find worth the time to check out. If I
understood your problem correctly, this demo files has the solution to
it.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Warp
Subject: Re: Problem using difference with height_field
Date: 3 Jul 2000 16:46:21
Message: <3960fb9c@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
: It is important to remember that a HF object is much like a sheet of
: paper. It is considered an infinately thin object.

  Well, strictly speaking this is not so.
  A triangle or a bicubic patch are infinitely thin objects (they have
nointerior). A plane is not considered an infinitely thin object since it
has an interior (a plane is considered by povray as an infinitely large object
which size is a half of the universe).
  In the same way a heighfield has an interior and thus it's not considered
an infinitely thin object, but a "solid" object. The limits of the object
go from 0 to 1 in the x and z directions and from -infinity to the surface
of the HF in the y direction.
  Of course the fact that a HF looks just like a thin surface is confusing,
but we have to remember that although povray only handles surfaces it has
a notion of "interior" and "exterior" of most objects (including the HF).
When an object has "interior" in terms of povray, it is considered "solid",
not just a thin surface without interior (like a triangle).
  The feature of an object having interior and exterior is very important
in CSG.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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