Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #11426 > unrolled thread

Topography contours

Started byMalcolm McLean <malcolm.arthur.mclean@gmail.com>
First post2020-11-11 09:26 -0800
Last post2020-11-13 05:22 -0800
Articles 5 — 2 participants

Back to article view | Back to comp.programming


Contents

  Topography contours Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-11-11 09:26 -0800
    Re: Topography contours Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-11-12 15:57 +0000
      Re: Topography contours Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-11-12 08:24 -0800
        Re: Topography contours Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-11-12 17:44 +0000
          Re: Topography contours Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-11-13 05:22 -0800

#11426 — Topography contours

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2020-11-11 09:26 -0800
SubjectTopography contours
Message-ID<599350c8-0ae4-44eb-8a55-f533be181cc0n@googlegroups.com>
If you have a topology in continuous space that you can sample to arbitrary resolution, both in space and in height, what is the best way of producing isomers (contour lines of equal height).

[toc] | [next] | [standalone]


#11431

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2020-11-12 15:57 +0000
Message-ID<87eekyr2jt.fsf@bsb.me.uk>
In reply to#11426
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> If you have a topology in continuous space that you can sample to
> arbitrary resolution, both in space and in height, what is the best
> way of producing isomers (contour lines of equal height).

I've never heard of the called that before.  If you are searching, I
think contour lines will be more successful

There must be established algorithm for this and if you find one, please
post a link.

If you can assume your function is continuous and smooth, I thought you
could use partial derivatives to find the tangent of the contour at a
given point.  You could the move some small step in that direction and
try again.  But to stop errors piling up, you'd have to a search in the
neighbourhood of the end point for a close match to the starting value.

Given that, maybe just a search at each step is the best bet.  If the
function is smooth in relation to the step size you want to take, you
might get away with a binary search of the points on a circle of radius
r (the step size) away from the previous point, with the angles ranging
from -pi to +pi and 0 being "ahead" -- the direction of the last line
segment in the contour.  (It would be easier to describe with a
diagram!)

And you could, of course, make the step size dependent on how smooth
the function is in an particular neighbourhood.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#11432

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2020-11-12 08:24 -0800
Message-ID<6a8b566d-18cf-4ef7-bb1f-4ae41b9ecd8bn@googlegroups.com>
In reply to#11431
On Thursday, 12 November 2020 at 15:57:15 UTC, Ben Bacarisse wrote:
> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> 
> > If you have a topology in continuous space that you can sample to 
> > arbitrary resolution, both in space and in height, what is the best 
> > way of producing isomers (contour lines of equal height).
> I've never heard of the called that before. If you are searching, I 
> think contour lines will be more successful 
> 
> There must be established algorithm for this and if you find one, please 
> post a link. 
> 
> If you can assume your function is continuous and smooth, I thought you 
> could use partial derivatives to find the tangent of the contour at a 
> given point. You could the move some small step in that direction and 
> try again. But to stop errors piling up, you'd have to a search in the 
> neighbourhood of the end point for a close match to the starting value. 
> 
> Given that, maybe just a search at each step is the best bet. If the 
> function is smooth in relation to the step size you want to take, you 
> might get away with a binary search of the points on a circle of radius 
> r (the step size) away from the previous point, with the angles ranging 
> from -pi to +pi and 0 being "ahead" -- the direction of the last line 
> segment in the contour. (It would be easier to describe with a 
> diagram!) 
> 
> And you could, of course, make the step size dependent on how smooth 
> the function is in an particular neighbourhood. 
> 
The function is continuous and smooth, and basically well-behaved (no
sharp spikes or well-like depressions). I can also obtain rough limits
for maximum / minimum. However the contour lines (isomer is the wrong
word, sorry about that) have to be described in vector to a good accuracy.

I also need to obtain them interactively, so ideally under 1/10th of a second
though up to about 10 seconds is tolerable.

A circular search followed by a step is worth trying.

[toc] | [prev] | [next] | [standalone]


#11436

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2020-11-12 17:44 +0000
Message-ID<871rgyqxkx.fsf@bsb.me.uk>
In reply to#11432
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Thursday, 12 November 2020 at 15:57:15 UTC, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> 
>> > If you have a topology in continuous space that you can sample to 
>> > arbitrary resolution, both in space and in height, what is the best 
>> > way of producing isomers (contour lines of equal height).
>> I've never heard of the called that before. If you are searching, I 
>> think contour lines will be more successful 
>> 
>> There must be established algorithm for this and if you find one, please 
>> post a link. 
>> 
>> If you can assume your function is continuous and smooth, I thought you 
>> could use partial derivatives to find the tangent of the contour at a 
>> given point. You could the move some small step in that direction and 
>> try again. But to stop errors piling up, you'd have to a search in the 
>> neighbourhood of the end point for a close match to the starting value. 
>> 
>> Given that, maybe just a search at each step is the best bet. If the 
>> function is smooth in relation to the step size you want to take, you 
>> might get away with a binary search of the points on a circle of radius 
>> r (the step size) away from the previous point, with the angles ranging 
>> from -pi to +pi and 0 being "ahead" -- the direction of the last line 
>> segment in the contour. (It would be easier to describe with a 
>> diagram!) 
>> 
>> And you could, of course, make the step size dependent on how smooth 
>> the function is in an particular neighbourhood. 
>> 
> The function is continuous and smooth, and basically well-behaved (no
> sharp spikes or well-like depressions). I can also obtain rough limits
> for maximum / minimum. However the contour lines (isomer is the wrong
> word, sorry about that) have to be described in vector to a good accuracy.
>
> I also need to obtain them interactively, so ideally under 1/10th of a second
> though up to about 10 seconds is tolerable.

Is the function itself slow to calculate?  How many points do you think
will be needed for good accuracy?

> A circular search followed by a step is worth trying.

If the function is smooth enough, a binary search of the circle should
work and not be too slow.  Since for most of the contour the next step
will be in pretty much the same direction as the last, you don't need to
cut the search angles into equal parts.  I don't know of the speed-up
would be worth it, but it's something I'd try just for fun.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#11439

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2020-11-13 05:22 -0800
Message-ID<5619f751-3b3a-4db6-8bf4-6c383039938cn@googlegroups.com>
In reply to#11436
On Thursday, 12 November 2020 at 17:44:35 UTC, Ben Bacarisse wrote:
> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> 
> > On Thursday, 12 November 2020 at 15:57:15 UTC, Ben Bacarisse wrote: 
> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> >> 
> >> > If you have a topology in continuous space that you can sample to 
> >> > arbitrary resolution, both in space and in height, what is the best 
> >> > way of producing isomers (contour lines of equal height). 
> >> I've never heard of the called that before. If you are searching, I 
> >> think contour lines will be more successful 
> >> 
> >> There must be established algorithm for this and if you find one, please 
> >> post a link. 
> >> 
> >> If you can assume your function is continuous and smooth, I thought you 
> >> could use partial derivatives to find the tangent of the contour at a 
> >> given point. You could the move some small step in that direction and 
> >> try again. But to stop errors piling up, you'd have to a search in the 
> >> neighbourhood of the end point for a close match to the starting value. 
> >> 
> >> Given that, maybe just a search at each step is the best bet. If the 
> >> function is smooth in relation to the step size you want to take, you 
> >> might get away with a binary search of the points on a circle of radius 
> >> r (the step size) away from the previous point, with the angles ranging 
> >> from -pi to +pi and 0 being "ahead" -- the direction of the last line 
> >> segment in the contour. (It would be easier to describe with a 
> >> diagram!) 
> >> 
> >> And you could, of course, make the step size dependent on how smooth 
> >> the function is in an particular neighbourhood. 
> >> 
> > The function is continuous and smooth, and basically well-behaved (no 
> > sharp spikes or well-like depressions). I can also obtain rough limits 
> > for maximum / minimum. However the contour lines (isomer is the wrong 
> > word, sorry about that) have to be described in vector to a good accuracy. 
> > 
> > I also need to obtain them interactively, so ideally under 1/10th of a second 
> > though up to about 10 seconds is tolerable.
> Is the function itself slow to calculate? How many points do you think 
> will be needed for good accuracy?
> > A circular search followed by a step is worth trying.
> If the function is smooth enough, a binary search of the circle should 
> work and not be too slow. Since for most of the contour the next step 
> will be in pretty much the same direction as the last, you don't need to 
> cut the search angles into equal parts. I don't know of the speed-up 
> would be worth it, but it's something I'd try just for fun. 
> 
I want it for Perlin noise, or other similar functions used to shade graphics,
like linear and radial gradients. These functions are reasonably fast to 
calculate.
The idea is to convert the raster effects to vector. A screen is a
notional 72 dots per inch, so we have a concept of "pixel", though of course 
the whole point of vector graphics is that they are scaleable.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web