POV-Ray : Newsgroups : povray.general : Height field to topographic map? Server Time
19 Nov 2024 09:49:44 EST (-0500)
  Height field to topographic map? (Message 1 to 8 of 8)  
From: Mark Wagner
Subject: Height field to topographic map?
Date: 5 Mar 2002 01:36:07
Message: <3c846757@news.povray.org>
I'm looking for a program that will take a heightfield image that I've
created and turn it into a contour map.  I've found GRASS, but it seems a
bit overkill for the job, and it's a 17 MB download.

--
Mark


Post a reply to this message

From: Vahur Krouverk
Subject: Re: Height field to topographic map?
Date: 5 Mar 2002 02:57:07
Message: <3C847AC6.1CE3D8AF@comtrade.ee>
Mark Wagner wrote:
> 
> I'm looking for a program that will take a heightfield image that I've
> created and turn it into a contour map.  I've found GRASS, but it seems a
> bit overkill for the job, and it's a 17 MB download.
> 
Won't POV-Ray be suitable? if you render heightfield orthographically
from top and create texture map accordingly to height?


Post a reply to this message

From: Ron Parker
Subject: Re: Height field to topographic map?
Date: 5 Mar 2002 10:14:11
Message: <slrna89o64.nvb.ron.parker@fwi.com>
On Tue, 05 Mar 2002 09:59:02 +0200, Vahur Krouverk wrote:
> Mark Wagner wrote:
>> 
>> I'm looking for a program that will take a heightfield image that I've
>> created and turn it into a contour map.  I've found GRASS, but it seems a
>> bit overkill for the job, and it's a 17 MB download.
>> 
> Won't POV-Ray be suitable? if you render heightfield orthographically
> from top and create texture map accordingly to height?

That technique has a tendency to make fat contour lines where the slope is 
gentle.

I once wrote a program to do contour lines.  Unfortunately, it belongs to 
my former employer, so I can't help with actual code.  As I recall, gnuplot
is able to do such a thing, though I don't remember off the top of my head
how it's done.

--
#macro R(L P)sphere{L __}cylinder{L P __}#end#macro P(_1)union{R(z+_ z)R(-z _-z)
R(_-z*3_+z)torus{1__ clipped_by{plane{_ 0}}}translate z+_1}#end#macro S(_)9-(_1-
_)*(_1-_)#end#macro Z(_1 _ __)union{P(_)P(-_)R(y-z-1_)translate.1*_1-y*8pigment{
rgb<S(7)S(5)S(3)>}}#if(_1)Z(_1-__,_,__)#end#end Z(10x*-2,.2)camera{rotate x*90}


Post a reply to this message

From: Ron Parker
Subject: Re: Height field to topographic map?
Date: 5 Mar 2002 10:14:45
Message: <slrna89o76.nvb.ron.parker@fwi.com>
On Tue, 5 Mar 2002 01:37:26 -0500, Mark Wagner wrote:
> I'm looking for a program that will take a heightfield image that I've
> created and turn it into a contour map.  I've found GRASS, but it seems a
> bit overkill for the job, and it's a 17 MB download.

Mark, I have GRASS installed if you'd like me to see what I can do.

-- 
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}


Post a reply to this message

From:
Subject: Re: Height field to topographic map?
Date: 5 Mar 2002 10:34:15
Message: <gto98ukig343fjl30p0jtub1dp1sij6ecr@4ax.com>
On 5 Mar 2002 10:14:11 -0500, Ron Parker <ron### [at] povrayorg> wrote:
> That technique has a tendency to make fat contour lines where the slope is 
> gentle.

With contignous* trace you can sample heighfield from two sides and produce
(white with ambient 1) spheres at every intersection. High resolution of this
sampling can produce smooth image. Just hide heigh_field itself.

*) saying "contignous trace" I mean trace from start point to end point with
restart from intersection point after each intersection

ABX


Post a reply to this message

From: Ron Parker
Subject: Re: Height field to topographic map?
Date: 5 Mar 2002 11:12:29
Message: <slrna89rje.o1p.ron.parker@fwi.com>
On 5 Mar 2002 10:14:11 -0500, Ron Parker wrote:
> On Tue, 05 Mar 2002 09:59:02 +0200, Vahur Krouverk wrote:
>> Mark Wagner wrote:
>>> 
>>> I'm looking for a program that will take a heightfield image that I've
>>> created and turn it into a contour map.  I've found GRASS, but it seems a
>>> bit overkill for the job, and it's a 17 MB download.
>>> 
>> Won't POV-Ray be suitable? if you render heightfield orthographically
>> from top and create texture map accordingly to height?
> 
> That technique has a tendency to make fat contour lines where the slope is 
> gentle.

I had a great thought on this: just use the slope pattern to select a 
suitably narrow or wide gradient pattern!  It'd be ugly code, but it'd 
kinda work.

--
#macro R(L P)sphere{L __}cylinder{L P __}#end#macro P(_1)union{R(z+_ z)R(-z _-z)
R(_-z*3_+z)torus{1__ clipped_by{plane{_ 0}}}translate z+_1}#end#macro S(_)9-(_1-
_)*(_1-_)#end#macro Z(_1 _ __)union{P(_)P(-_)R(y-z-1_)translate.1*_1-y*8pigment{
rgb<S(7)S(5)S(3)>}}#if(_1)Z(_1-__,_,__)#end#end Z(10x*-2,.2)camera{rotate x*90}


Post a reply to this message

From: Vahur Krouverk
Subject: Re: Height field to topographic map?
Date: 6 Mar 2002 04:54:18
Message: <3C85E748.2F64862B@comtrade.ee>
Ron Parker wrote:
> 
> On Tue, 05 Mar 2002 09:59:02 +0200, Vahur Krouverk wrote:
> > Mark Wagner wrote:
> >>
> >> I'm looking for a program that will take a heightfield image that I've
> >> created and turn it into a contour map.  I've found GRASS, but it seems a
> >> bit overkill for the job, and it's a 17 MB download.
> >>
> > Won't POV-Ray be suitable? if you render heightfield orthographically
> > from top and create texture map accordingly to height?
> 
> That technique has a tendency to make fat contour lines where the slope is
> gentle.

Yes, if one wants to have nice contour lines. But I believe, that by
using derivative of slope it could be possible to make line width more
or less constant. For calculating derivative normal of height field
could be suitable and with shader its implementation could be quite easy
(probably easier than with slope map, at least for me). Lack of
transformation to/from screen coordinates probably will be limiting
factor here, but with some adjusting of input parameters it could be
hacked around. Unfortunately I don't have time right now, but I do feel
challenge here and on next free moment try to implement it.


Post a reply to this message

From: Mark Wagner
Subject: Re: Height field to topographic map?
Date: 6 Mar 2002 23:25:08
Message: <3c86eba4$1@news.povray.org>
Ron Parker wrote in message ...
>On 5 Mar 2002 10:14:11 -0500, Ron Parker wrote:
>> On Tue, 05 Mar 2002 09:59:02 +0200, Vahur Krouverk wrote:
>>> Mark Wagner wrote:
>>>>
>>>> I'm looking for a program that will take a heightfield image that I've
>>>> created and turn it into a contour map.  I've found GRASS, but it seems
a
>>>> bit overkill for the job, and it's a 17 MB download.
>>>>
>>> Won't POV-Ray be suitable? if you render heightfield orthographically
>>> from top and create texture map accordingly to height?
>>
>> That technique has a tendency to make fat contour lines where the slope
is
>> gentle.
>
>I had a great thought on this: just use the slope pattern to select a
>suitably narrow or wide gradient pattern!  It'd be ugly code, but it'd
>kinda work.

This looks like the most interesting way of doing this.  Should I happen to
have any spare time in the near future, I'll try it.

--
Mark


Post a reply to this message

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