POV-Ray : Newsgroups : povray.general : HeightFields and differences, clipping etc. Server Time
31 Oct 2024 21:28:40 EDT (-0400)
  HeightFields and differences, clipping etc. (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Patrick Dugan
Subject: HeightFields and differences, clipping etc.
Date: 4 Jan 2000 11:35:10
Message: <3872213e@news.povray.org>
I have trying (somewhat successfully) to "chop" heightfields.  I first used
a bounded_by statement to make the heightfield round (to cut of the corners)
but then trying to remove a "chunk" from the inside is difficult.  When I
tried using the difference statement it never works and whatever the object
is (cube for example) ends up showing up regardless of using difference or
union.  I finally tried using a difference with a cube (with a clear
pigment) which seems to work but according to the Povray docs I shouldn't be
trying a "difference" with a heightfield.  I guess my question is are there
any "easy" ways to remove material from a hieghtfield without going to
convoluted methods??


Post a reply to this message

From: Nieminen Juha
Subject: Re: HeightFields and differences, clipping etc.
Date: 4 Jan 2000 12:11:03
Message: <387229a7@news.povray.org>
Patrick Dugan <pat### [at] usticom> wrote:
: I have trying (somewhat successfully) to "chop" heightfields.  I first used
: a bounded_by statement to make the heightfield round (to cut of the corners)

  Wrong technique. To clip parts of an object away, use the clipped_by block
instead.

-- 
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

From: Chris Huff
Subject: Re: HeightFields and differences, clipping etc.
Date: 4 Jan 2000 12:20:13
Message: <chrishuff_99-E7173F.12201704012000@news.povray.org>
In article <3872213e@news.povray.org>, "Patrick Dugan" 
<pat### [at] usticom> wrote:

> I have trying (somewhat successfully) to "chop" heightfields.  I first 
> used
> a bounded_by statement to make the heightfield round (to cut of the 
> corners)

Don't do that, bounded_by isn't intended to do that and is unreliable. 
Use clipped_by or intersection instead.


> but then trying to remove a "chunk" from the inside is difficult.  When I
> tried using the difference statement it never works and whatever the 
> object
> is (cube for example) ends up showing up regardless of using difference 
> or
> union.  I finally tried using a difference with a cube (with a clear
> pigment) which seems to work but according to the Povray docs I shouldn't 
> be
> trying a "difference" with a heightfield.  I guess my question is are 
> there
> any "easy" ways to remove material from a hieghtfield without going to
> convoluted methods??

CSG operations leave a surface over the areas that are removed or 
created. The workarounds are to use a clear texture on the CSG object or 
to use clipped_by.
To use more than one object with clipped_by, just use a union of the 
clipping objects. The inverse keyword might be useful too.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: HeightFields and differences, clipping etc.
Date: 4 Jan 2000 12:25:07
Message: <chrishuff_99-8EA2F7.12251204012000@news.povray.org>
In article <3872213e@news.povray.org>, "Patrick Dugan" 
<pat### [at] usticom> wrote:

Forgot to answer this in my previous reply:

> according to the Povray docs I shouldn't be trying a "difference"
> with a heightfield.

The height_field object works fine with CSG, where in the POV-Ray manual 
does it say otherwise?

From the manual:
"There are thirteen different solid finite primitive shapes: blob, box, 
cone, cylinder, height field, Julia fractal, lathe, prisms, sphere, 
superellipsoid, surface of revolution, text object and torus. These have 
a well-defined  inside  and can be used in CSG (see section " 
Constructive Solid Geometry "). They are finite and respond to automatic 
bounding. You may specify an interior for these objects."

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Patrick Dugan
Subject: Re: HeightFields and differences, clipping etc.
Date: 4 Jan 2000 17:39:53
Message: <387276b9@news.povray.org>
Now I'll have to find that to make I'm not hallucinating.  I was pretty sure
that the docs mentioned that clipping or differences cannot be performed on
"non" solid objects like height fields, dics, planes, etc.  If a difference
is supposed to work with a height field (like removing a box shape from a
height field) then I cannot get that to function correctly.  I will post
some example code that demonstrates my problem.

"Chris Huff" <chr### [at] yahoocom> wrote in message
news:chrishuff_99-8EA2F7.12251204012000@news.povray.org...
> In article <3872213e@news.povray.org>, "Patrick Dugan"
> <pat### [at] usticom> wrote:
>
> Forgot to answer this in my previous reply:
>
> > according to the Povray docs I shouldn't be trying a "difference"
> > with a heightfield.
>
> The height_field object works fine with CSG, where in the POV-Ray manual
> does it say otherwise?
>
> From the manual:
> "There are thirteen different solid finite primitive shapes: blob, box,
> cone, cylinder, height field, Julia fractal, lathe, prisms, sphere,
> superellipsoid, surface of revolution, text object and torus. These have
> a well-defined  inside  and can be used in CSG (see section "
> Constructive Solid Geometry "). They are finite and respond to automatic
> bounding. You may specify an interior for these objects."
>
> --
> Chris Huff
> e-mail: chr### [at] yahoocom
> Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: HeightFields and differences, clipping etc.
Date: 4 Jan 2000 17:59:50
Message: <chrishuff_99-7565C0.17595604012000@news.povray.org>
In article <387276b9@news.povray.org>, "Patrick Dugan" 
<pat### [at] usticom> wrote:

> Now I'll have to find that to make I'm not hallucinating.  I was pretty 
> sure
> that the docs mentioned that clipping or differences cannot be performed 
> on
> "non" solid objects like height fields, dics, planes, etc.  If a 
> difference
> is supposed to work with a height field (like removing a box shape from a
> height field) then I cannot get that to function correctly.  I will post
> some example code that demonstrates my problem.

Differences and other CSG operations don't work on non-solid objects, 
but a height_field is a solid object, it has a defined inside and 
outside. I think clipping works on both with no problems, but it isn't 
exactly a CSG operation.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Patrick Dugan
Subject: Re: HeightFields and differences, clipping etc.
Date: 4 Jan 2000 18:03:04
Message: <38727c28@news.povray.org>
Here is an example of the "odd" behavior I find.  (Odd to me anyway..)

#version 3.0
global_settings {assumed_gamma 2.2}
light_source {<-100, 100, -500> color White * 1.0}
background {Blue}

camera {
   location <0, 0, -3>
   look_at  <0, 0,  0>
}

#declare RedSheet =
object {
   height_field {
      tga "AnyFile.tga"
      hierarchy off
      pigment {Red}
      translate <-0.5, -0.5, -0.5>
   }
   rotate <90,0,180>
   scale <1, 1, 0.005>
}



#declare RedSheetHole =
object {
   difference {
      object {RedSheet}
      torus {0.24, 0.14 pigment {Green} rotate x * 90}
   }
}

object {RedSheetHole scale 2}

Although I have declared the "RedSheetHole" to be a DIFFERENCE between
the heightfield and the torus, the end result is a union rather than
difference.  I am confused since the syntax I have used "seems" correct to
me.  Please advise...




"Patrick Dugan" <pat### [at] usticom> wrote in message
news:3872213e@news.povray.org...
> I have trying (somewhat successfully) to "chop" heightfields.  I first
used
> a bounded_by statement to make the heightfield round (to cut of the
corners)
> but then trying to remove a "chunk" from the inside is difficult.  When I
> tried using the difference statement it never works and whatever the
object
> is (cube for example) ends up showing up regardless of using difference or
> union.  I finally tried using a difference with a cube (with a clear
> pigment) which seems to work but according to the Povray docs I shouldn't
be
> trying a "difference" with a heightfield.  I guess my question is are
there
> any "easy" ways to remove material from a hieghtfield without going to
> convoluted methods??
>
>


Post a reply to this message

From: Chris Huff
Subject: Re: HeightFields and differences, clipping etc.
Date: 4 Jan 2000 18:17:37
Message: <chrishuff_99-3E3849.18174204012000@news.povray.org>
In article <38727c28@news.povray.org>, "Patrick Dugan" 
<pat### [at] usticom> wrote:


> Although I have declared the "RedSheetHole" to be a DIFFERENCE between
> the heightfield and the torus, the end result is a union rather than
> difference.  I am confused since the syntax I have used "seems" correct 
> to me.  Please advise...

If you use:
object {RedSheetHole scale 2 rotate y*250}
you will see that the "union" of the torus and the height field is 
actually the depression left in the heightfield from the torus. If you 
want a hole to be in this area instead, give the torus a clear texture 
so it is invisible. Or you could use this instead:
#declare RedSheet =
object {
   height_field {
      png "plasma2.png"
      hierarchy off
      pigment {Red}
      translate <-0.5, -0.5, -0.5>
   }
   rotate <90,0,180>
   scale <1, 1, 0.005>
   clipped_by {
      torus {0.24, 0.14 inverse rotate x * 90}
   }
}

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Patrick Dugan
Subject: Re: HeightFields and differences, clipping etc.
Date: 4 Jan 2000 21:11:37
Message: <3872a859@news.povray.org>
But WHY is there a torus depression?  The torus should carve out ONLY where
the intersection of the height field and torus intersect, not have an
"extra" area showing outside of the heightfield.  While a "clear" pigment
works it is still not behaving the way a standard solid object would.

"Chris Huff" <chr### [at] yahoocom> wrote in message
news:chrishuff_99-7565C0.17595604012000@news.povray.org...
> In article <387276b9@news.povray.org>, "Patrick Dugan"
> <pat### [at] usticom> wrote:
>
> > Now I'll have to find that to make I'm not hallucinating.  I was pretty
> > sure
> > that the docs mentioned that clipping or differences cannot be performed
> > on
> > "non" solid objects like height fields, dics, planes, etc.  If a
> > difference
> > is supposed to work with a height field (like removing a box shape from
a
> > height field) then I cannot get that to function correctly.  I will post
> > some example code that demonstrates my problem.
>
> Differences and other CSG operations don't work on non-solid objects,
> but a height_field is a solid object, it has a defined inside and
> outside. I think clipping works on both with no problems, but it isn't
> exactly a CSG operation.
>
> --
> Chris Huff
> e-mail: chr### [at] yahoocom
> Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: HeightFields and differences, clipping etc.
Date: 4 Jan 2000 21:22:09
Message: <chrishuff_99-0B6D7F.21221504012000@news.povray.org>
In article <3872a859@news.povray.org>, "Patrick Dugan" 
<pat### [at] netinsnet> wrote:

> But WHY is there a torus depression?  The torus should carve out ONLY 
> where
> the intersection of the height field and torus intersect, not have an
> "extra" area showing outside of the heightfield.  While a "clear" pigment
> works it is still not behaving the way a standard solid object would.

I am not sure what you mean. It behaves in exactly the same way a 
standard object does. A difference operation leaves the surface of the 
differencing object on the object being differenced.
Don't get confused by the fact that you can see under the top surface of 
the height field, the object is there, there just aren't any surfaces 
around that portion of it. The lower boundaries are set by a cube, while 
the upper boundary is the surface of the height field. This can be seen 
clearly if you fill a height field with media.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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