discuss@lists.openscad.org

OpenSCAD general discussion

View all threads

concave-hull (topography)

BL
Bryan Lee
Fri, Aug 26, 2022 7:17 AM

I am trying to make a topographic model.
(Think one of those things that shows how high the mountains are.)

My model needs to show the peaks and the valleys.

I have vector curves that represent elevations.  (I hand traced these from an old map.)
I can import these as a grey-scale PNG of elevations, or as multiple SVGs
that create 2D polygons and extrude them.

However, I want the sides to be sloped, like a real mountain.  NOT have
vertical sides like extrusions.

If this were just a single convex mountain, I could do a hull() around the
multiple elevation levels.

But hull() will create a "flat" area between mountain peeks, and it will
not show the valleys.

Does anyone have suggestions for an algorithm that will work similar to
hull(), but that will curve the surface into concave areas?

I am trying to make a topographic model. (Think one of those things that shows how high the mountains are.) My model needs to show the peaks and the valleys. I have vector curves that represent elevations. (I hand traced these from an old map.) I can import these as a grey-scale PNG of elevations, or as multiple SVGs that create 2D polygons and extrude them. However, I want the sides to be sloped, like a real mountain. NOT have vertical sides like extrusions. If this were just a single convex mountain, I could do a hull() around the multiple elevation levels. But hull() will create a "flat" area between mountain peeks, and it will not show the valleys. Does anyone have suggestions for an algorithm that will work similar to hull(), but that will curve the surface into concave areas?
MM
Michael Möller
Fri, Aug 26, 2022 7:38 AM

And the surface() doesn't work, because ...?

Michael, fra mobilen

fre. 26. aug. 2022 09.19 skrev Bryan Lee leebc11@acm.org:

I am trying to make a topographic model.
(Think one of those things that shows how high the mountains are.)

My model needs to show the peaks and the valleys.

I have vector curves that represent elevations.  (I hand traced these from
an old map.)
I can import these as a grey-scale PNG of elevations, or as multiple SVGs
that create 2D polygons and extrude them.

However, I want the sides to be sloped, like a real mountain.  NOT have
vertical sides like extrusions.

If this were just a single convex mountain, I could do a hull() around the
multiple elevation levels.

But hull() will create a "flat" area between mountain peeks, and it will
not show the valleys.

Does anyone have suggestions for an algorithm that will work similar to
hull(), but that will curve the surface into concave areas?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

And the surface() doesn't work, because ...? Michael, fra mobilen fre. 26. aug. 2022 09.19 skrev Bryan Lee <leebc11@acm.org>: > I am trying to make a topographic model. > (Think one of those things that shows how high the mountains are.) > > My model needs to show the peaks and the valleys. > > I have vector curves that represent elevations. (I hand traced these from > an old map.) > I can import these as a grey-scale PNG of elevations, or as multiple SVGs > that create 2D polygons and extrude them. > > However, I want the sides to be sloped, like a real mountain. NOT have > vertical sides like extrusions. > > If this were just a single convex mountain, I could do a hull() around the > multiple elevation levels. > > But hull() will create a "flat" area between mountain peeks, and it will > not show the valleys. > > Does anyone have suggestions for an algorithm that will work similar to > hull(), but that will curve the surface into concave areas? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
W
Whosawhatsis
Fri, Aug 26, 2022 9:00 AM

Off the top of my head, what if you break up your map into a grid of squares, and do a convex hull for all of the contour layers in each square? The size of the squares would determine the smallest concave feature you can have.

You might implement this by extruding each contour to its appropriate elevation and unioning those. Then you could loop over X and Y coordinates creating a grid of tall cubes. Intersect your unioned extruded contours with each cube, hull the result, then union them all back together.

Alternatively, you could try doing the intersection with squares in 2D before extruding. I imagine that method would result in a bit more code, but could be substantially faster to run.
On Aug 26, 2022, 00:19 -0700, Bryan Lee leebc11@acm.org, wrote:

I am trying to make a topographic model.
(Think one of those things that shows how high the mountains are.)

My model needs to show the peaks and the valleys.

I have vector curves that represent elevations. (I hand traced these from an old map.)
I can import these as a grey-scale PNG of elevations, or as multiple SVGs
that create 2D polygons and extrude them.

However, I want the sides to be sloped, like a real mountain. NOT have
vertical sides like extrusions.

If this were just a single convex mountain, I could do a hull() around the
multiple elevation levels.

But hull() will create a "flat" area between mountain peeks, and it will
not show the valleys.

Does anyone have suggestions for an algorithm that will work similar to
hull(), but that will curve the surface into concave areas?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Off the top of my head, what if you break up your map into a grid of squares, and do a convex hull for all of the contour layers in each square? The size of the squares would determine the smallest concave feature you can have. You might implement this by extruding each contour to its appropriate elevation and unioning those. Then you could loop over X and Y coordinates creating a grid of tall cubes. Intersect your unioned extruded contours with each cube, hull the result, then union them all back together. Alternatively, you could try doing the intersection with squares in 2D before extruding. I imagine that method would result in a bit more code, but could be substantially faster to run. On Aug 26, 2022, 00:19 -0700, Bryan Lee <leebc11@acm.org>, wrote: > I am trying to make a topographic model. > (Think one of those things that shows how high the mountains are.) > > My model needs to show the peaks and the valleys. > > I have vector curves that represent elevations. (I hand traced these from an old map.) > I can import these as a grey-scale PNG of elevations, or as multiple SVGs > that create 2D polygons and extrude them. > > However, I want the sides to be sloped, like a real mountain. NOT have > vertical sides like extrusions. > > If this were just a single convex mountain, I could do a hull() around the > multiple elevation levels. > > But hull() will create a "flat" area between mountain peeks, and it will > not show the valleys. > > Does anyone have suggestions for an algorithm that will work similar to > hull(), but that will curve the surface into concave areas? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
BL
Bryan Lee
Fri, Aug 26, 2022 10:17 AM

Surface() does exactly what I need!

Not sure I've used it, so I'd forgotten.

Thank you Michael Möller!

Thus Michael Möller hast written on Fri, Aug 26, 2022 at 09:38:40AM +0200, and, according to prophecy, it shall come to pass that:

And the surface() doesn't work, because ...?

Michael, fra mobilen

fre. 26. aug. 2022 09.19 skrev Bryan Lee leebc11@acm.org:

 I am trying to make a topographic model.
 (Think one of those things that shows how high the mountains are.)

 My model needs to show the peaks and the valleys.

 I have vector curves that represent elevations.  (I hand traced these from
 an old map.)
 I can import these as a grey-scale PNG of elevations, or as multiple SVGs
 that create 2D polygons and extrude them.

 However, I want the sides to be sloped, like a real mountain.  NOT have
 vertical sides like extrusions.

 If this were just a single convex mountain, I could do a hull() around the
 multiple elevation levels. 

 But hull() will create a "flat" area between mountain peeks, and it will
 not show the valleys.

 Does anyone have suggestions for an algorithm that will work similar to
 hull(), but that will curve the surface into concave areas?
 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org

OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Surface() does exactly what I need! Not sure I've used it, so I'd forgotten. Thank you Michael Möller! Thus Michael Möller hast written on Fri, Aug 26, 2022 at 09:38:40AM +0200, and, according to prophecy, it shall come to pass that: > And the surface() doesn't work, because ...? > > Michael, fra mobilen > > fre. 26. aug. 2022 09.19 skrev Bryan Lee <leebc11@acm.org>: > > I am trying to make a topographic model. > (Think one of those things that shows how high the mountains are.) > > My model needs to show the peaks and the valleys. > > I have vector curves that represent elevations.  (I hand traced these from > an old map.) > I can import these as a grey-scale PNG of elevations, or as multiple SVGs > that create 2D polygons and extrude them. > > However, I want the sides to be sloped, like a real mountain.  NOT have > vertical sides like extrusions. > > If this were just a single convex mountain, I could do a hull() around the > multiple elevation levels.  > > But hull() will create a "flat" area between mountain peeks, and it will > not show the valleys. > > Does anyone have suggestions for an algorithm that will work similar to > hull(), but that will curve the surface into concave areas? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Raymond West
Fri, Aug 26, 2022 10:34 AM

I've seen software (other than openscad) that does that,and iirc i used
some to produce g-code for machining relief maps, but i can't remember
much about it.

If you search the internet, for 'converting a stack of polygons into a
polyhedron' or 'generating an stl file from a stack of polyhedrons'  or
similar, you will find a number of solutions, which may be helpful e.g.
https://stackoverflow.com/questions/60066405/create-a-stl-file-from-a-collection-of-points

If you want to keep it all within openscad, then maybe easiest to get
the contour points on a grid, size depending on the precision you want,
then plot thin cubes between them, or something. I think 'surface' needs
a grid.

A rough and ready look at it, depending on the resolution of your
points, would be to plot  a sphere at each point location.

Or convert your polygons to a point cloud (you've got the x,y,z points,
just needs formatting I guess,) and Meshlab will produce an stl from a
point cloud.

Best of luck,

Ray

On 26/08/2022 08:17, Bryan Lee wrote:

I am trying to make a topographic model.
(Think one of those things that shows how high the mountains are.)

My model needs to show the peaks and the valleys.

I have vector curves that represent elevations.  (I hand traced these from an old map.)
I can import these as a grey-scale PNG of elevations, or as multiple SVGs
that create 2D polygons and extrude them.

However, I want the sides to be sloped, like a real mountain.  NOT have
vertical sides like extrusions.

If this were just a single convex mountain, I could do a hull() around the
multiple elevation levels.

But hull() will create a "flat" area between mountain peeks, and it will
not show the valleys.

Does anyone have suggestions for an algorithm that will work similar to
hull(), but that will curve the surface into concave areas?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I've seen software (other than openscad) that does that,and iirc i used some to produce g-code for machining relief maps, but i can't remember much about it. If you search the internet, for 'converting a stack of polygons into a polyhedron' or 'generating an stl file from a stack of polyhedrons'  or similar, you will find a number of solutions, which may be helpful e.g. https://stackoverflow.com/questions/60066405/create-a-stl-file-from-a-collection-of-points If you want to keep it all within openscad, then maybe easiest to get the contour points on a grid, size depending on the precision you want, then plot thin cubes between them, or something. I think 'surface' needs a grid. A rough and ready look at it, depending on the resolution of your points, would be to plot  a sphere at each point location. Or convert your polygons to a point cloud (you've got the x,y,z points, just needs formatting I guess,) and Meshlab will produce an stl from a point cloud. Best of luck, Ray On 26/08/2022 08:17, Bryan Lee wrote: > I am trying to make a topographic model. > (Think one of those things that shows how high the mountains are.) > > My model needs to show the peaks and the valleys. > > I have vector curves that represent elevations. (I hand traced these from an old map.) > I can import these as a grey-scale PNG of elevations, or as multiple SVGs > that create 2D polygons and extrude them. > > However, I want the sides to be sloped, like a real mountain. NOT have > vertical sides like extrusions. > > If this were just a single convex mountain, I could do a hull() around the > multiple elevation levels. > > But hull() will create a "flat" area between mountain peeks, and it will > not show the valleys. > > Does anyone have suggestions for an algorithm that will work similar to > hull(), but that will curve the surface into concave areas? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
AC
A. Craig West
Fri, Aug 26, 2022 1:20 PM

I've written code that turns a stack of polygons into a polyhedron, but it
requires all of the polygons to have the same number of points

On Fri, 26 Aug 2022, 04:35 Raymond West, raywest@raywest.com wrote:

I've seen software (other than openscad) that does that,and iirc i used
some to produce g-code for machining relief maps, but i can't remember
much about it.

If you search the internet, for 'converting a stack of polygons into a
polyhedron' or 'generating an stl file from a stack of polyhedrons'  or
similar, you will find a number of solutions, which may be helpful e.g.

https://stackoverflow.com/questions/60066405/create-a-stl-file-from-a-collection-of-points

If you want to keep it all within openscad, then maybe easiest to get
the contour points on a grid, size depending on the precision you want,
then plot thin cubes between them, or something. I think 'surface' needs
a grid.

A rough and ready look at it, depending on the resolution of your
points, would be to plot  a sphere at each point location.

Or convert your polygons to a point cloud (you've got the x,y,z points,
just needs formatting I guess,) and Meshlab will produce an stl from a
point cloud.

Best of luck,

Ray

On 26/08/2022 08:17, Bryan Lee wrote:

I am trying to make a topographic model.
(Think one of those things that shows how high the mountains are.)

My model needs to show the peaks and the valleys.

I have vector curves that represent elevations.  (I hand traced these

from an old map.)

I can import these as a grey-scale PNG of elevations, or as multiple SVGs
that create 2D polygons and extrude them.

However, I want the sides to be sloped, like a real mountain.  NOT have
vertical sides like extrusions.

If this were just a single convex mountain, I could do a hull() around

the

multiple elevation levels.

But hull() will create a "flat" area between mountain peeks, and it will
not show the valleys.

Does anyone have suggestions for an algorithm that will work similar to
hull(), but that will curve the surface into concave areas?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I've written code that turns a stack of polygons into a polyhedron, but it requires all of the polygons to have the same number of points On Fri, 26 Aug 2022, 04:35 Raymond West, <raywest@raywest.com> wrote: > I've seen software (other than openscad) that does that,and iirc i used > some to produce g-code for machining relief maps, but i can't remember > much about it. > > If you search the internet, for 'converting a stack of polygons into a > polyhedron' or 'generating an stl file from a stack of polyhedrons' or > similar, you will find a number of solutions, which may be helpful e.g. > > https://stackoverflow.com/questions/60066405/create-a-stl-file-from-a-collection-of-points > > If you want to keep it all within openscad, then maybe easiest to get > the contour points on a grid, size depending on the precision you want, > then plot thin cubes between them, or something. I think 'surface' needs > a grid. > > A rough and ready look at it, depending on the resolution of your > points, would be to plot a sphere at each point location. > > Or convert your polygons to a point cloud (you've got the x,y,z points, > just needs formatting I guess,) and Meshlab will produce an stl from a > point cloud. > > Best of luck, > > Ray > > On 26/08/2022 08:17, Bryan Lee wrote: > > I am trying to make a topographic model. > > (Think one of those things that shows how high the mountains are.) > > > > My model needs to show the peaks and the valleys. > > > > I have vector curves that represent elevations. (I hand traced these > from an old map.) > > I can import these as a grey-scale PNG of elevations, or as multiple SVGs > > that create 2D polygons and extrude them. > > > > However, I want the sides to be sloped, like a real mountain. NOT have > > vertical sides like extrusions. > > > > If this were just a single convex mountain, I could do a hull() around > the > > multiple elevation levels. > > > > But hull() will create a "flat" area between mountain peeks, and it will > > not show the valleys. > > > > Does anyone have suggestions for an algorithm that will work similar to > > hull(), but that will curve the surface into concave areas? > > _______________________________________________ > > OpenSCAD mailing list > > To unsubscribe send an email to discuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AM
Adrian Mariano
Fri, Aug 26, 2022 8:31 PM

I've written code that takes a stack of polygons and produces a polyhedron
with no restriction on the vertex counts of the polyhedra.  But getting
good results can be pretty slow if you have a lot of vertices.  I also
envisioned the problem as featuring multiple disconnected elevation lines,
so one polygon might need to connect to two polygons at some point, which
my code won't do.

For the curious, the code I'm talking about is the BOSL2 skin() module:

https://github.com/revarbat/BOSL2/wiki/skin.scad#functionmodule-skin

On Fri, Aug 26, 2022 at 3:35 PM A. Craig West acraigwest@gmail.com wrote:

I've written code that turns a stack of polygons into a polyhedron, but it
requires all of the polygons to have the same number of points

On Fri, 26 Aug 2022, 04:35 Raymond West, raywest@raywest.com wrote:

I've seen software (other than openscad) that does that,and iirc i used
some to produce g-code for machining relief maps, but i can't remember
much about it.

If you search the internet, for 'converting a stack of polygons into a
polyhedron' or 'generating an stl file from a stack of polyhedrons'  or
similar, you will find a number of solutions, which may be helpful e.g.

https://stackoverflow.com/questions/60066405/create-a-stl-file-from-a-collection-of-points

If you want to keep it all within openscad, then maybe easiest to get
the contour points on a grid, size depending on the precision you want,
then plot thin cubes between them, or something. I think 'surface' needs
a grid.

A rough and ready look at it, depending on the resolution of your
points, would be to plot  a sphere at each point location.

Or convert your polygons to a point cloud (you've got the x,y,z points,
just needs formatting I guess,) and Meshlab will produce an stl from a
point cloud.

Best of luck,

Ray

On 26/08/2022 08:17, Bryan Lee wrote:

I am trying to make a topographic model.
(Think one of those things that shows how high the mountains are.)

My model needs to show the peaks and the valleys.

I have vector curves that represent elevations.  (I hand traced these

from an old map.)

I can import these as a grey-scale PNG of elevations, or as multiple

SVGs

that create 2D polygons and extrude them.

However, I want the sides to be sloped, like a real mountain.  NOT have
vertical sides like extrusions.

If this were just a single convex mountain, I could do a hull() around

the

multiple elevation levels.

But hull() will create a "flat" area between mountain peeks, and it will
not show the valleys.

Does anyone have suggestions for an algorithm that will work similar to
hull(), but that will curve the surface into concave areas?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I've written code that takes a stack of polygons and produces a polyhedron with no restriction on the vertex counts of the polyhedra. But getting good results can be pretty slow if you have a lot of vertices. I also envisioned the problem as featuring multiple disconnected elevation lines, so one polygon might need to connect to two polygons at some point, which my code won't do. For the curious, the code I'm talking about is the BOSL2 skin() module: https://github.com/revarbat/BOSL2/wiki/skin.scad#functionmodule-skin On Fri, Aug 26, 2022 at 3:35 PM A. Craig West <acraigwest@gmail.com> wrote: > I've written code that turns a stack of polygons into a polyhedron, but it > requires all of the polygons to have the same number of points > > On Fri, 26 Aug 2022, 04:35 Raymond West, <raywest@raywest.com> wrote: > >> I've seen software (other than openscad) that does that,and iirc i used >> some to produce g-code for machining relief maps, but i can't remember >> much about it. >> >> If you search the internet, for 'converting a stack of polygons into a >> polyhedron' or 'generating an stl file from a stack of polyhedrons' or >> similar, you will find a number of solutions, which may be helpful e.g. >> >> https://stackoverflow.com/questions/60066405/create-a-stl-file-from-a-collection-of-points >> >> If you want to keep it all within openscad, then maybe easiest to get >> the contour points on a grid, size depending on the precision you want, >> then plot thin cubes between them, or something. I think 'surface' needs >> a grid. >> >> A rough and ready look at it, depending on the resolution of your >> points, would be to plot a sphere at each point location. >> >> Or convert your polygons to a point cloud (you've got the x,y,z points, >> just needs formatting I guess,) and Meshlab will produce an stl from a >> point cloud. >> >> Best of luck, >> >> Ray >> >> On 26/08/2022 08:17, Bryan Lee wrote: >> > I am trying to make a topographic model. >> > (Think one of those things that shows how high the mountains are.) >> > >> > My model needs to show the peaks and the valleys. >> > >> > I have vector curves that represent elevations. (I hand traced these >> from an old map.) >> > I can import these as a grey-scale PNG of elevations, or as multiple >> SVGs >> > that create 2D polygons and extrude them. >> > >> > However, I want the sides to be sloped, like a real mountain. NOT have >> > vertical sides like extrusions. >> > >> > If this were just a single convex mountain, I could do a hull() around >> the >> > multiple elevation levels. >> > >> > But hull() will create a "flat" area between mountain peeks, and it will >> > not show the valleys. >> > >> > Does anyone have suggestions for an algorithm that will work similar to >> > hull(), but that will curve the surface into concave areas? >> > _______________________________________________ >> > OpenSCAD mailing list >> > To unsubscribe send an email to discuss-leave@lists.openscad.org >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Sat, Aug 27, 2022 12:14 AM

I wrote a concave hull function sometime back in openscad, but it's not
even close to perfect.
I remember reading few articles.
Will check and forward to you in case you can use them to write a good
algorithm.
Concave hull has a lot of application in case it could be done

On Fri, 26 Aug, 2022, 12:50 pm Bryan Lee, leebc11@acm.org wrote:

I am trying to make a topographic model.
(Think one of those things that shows how high the mountains are.)

My model needs to show the peaks and the valleys.

I have vector curves that represent elevations.  (I hand traced these from
an old map.)
I can import these as a grey-scale PNG of elevations, or as multiple SVGs
that create 2D polygons and extrude them.

However, I want the sides to be sloped, like a real mountain.  NOT have
vertical sides like extrusions.

If this were just a single convex mountain, I could do a hull() around the
multiple elevation levels.

But hull() will create a "flat" area between mountain peeks, and it will
not show the valleys.

Does anyone have suggestions for an algorithm that will work similar to
hull(), but that will curve the surface into concave areas?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I wrote a concave hull function sometime back in openscad, but it's not even close to perfect. I remember reading few articles. Will check and forward to you in case you can use them to write a good algorithm. Concave hull has a lot of application in case it could be done On Fri, 26 Aug, 2022, 12:50 pm Bryan Lee, <leebc11@acm.org> wrote: > I am trying to make a topographic model. > (Think one of those things that shows how high the mountains are.) > > My model needs to show the peaks and the valleys. > > I have vector curves that represent elevations. (I hand traced these from > an old map.) > I can import these as a grey-scale PNG of elevations, or as multiple SVGs > that create 2D polygons and extrude them. > > However, I want the sides to be sloped, like a real mountain. NOT have > vertical sides like extrusions. > > If this were just a single convex mountain, I could do a hull() around the > multiple elevation levels. > > But hull() will create a "flat" area between mountain peeks, and it will > not show the valleys. > > Does anyone have suggestions for an algorithm that will work similar to > hull(), but that will curve the surface into concave areas? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
JB
Jordan Brown
Sat, Aug 27, 2022 1:26 AM

With the ignorance of one who had never tried it, I was thinking that
this "triangularize a contour map" problem couldn't be too hard.

But then I realized that it was even less obvious than I thought how to
connect two adjacent contour lines.  Simple concentric mountains seem
straightforward enough.  However, two peaks can make for cases that I
don't even know how to start on.

    1111111111111111111111111111111111111
    1                                   1
    1     2222222          22222222     1
    1     2     2          2      2     1
    1     2222222          22222222     1
    1                                   1
    1111111111111111111111111111111111111

I keep thinking about doing something with USGS 3D Elevation Program
files.  They are even already conveniently in grayscale image format. 
Unfortunately, they are also, shall we say, kind of big.  The 1x1 degree
tile for my area in Southern California is 437M, a 10Kx10K pixel image. 
(Each pixel is about 10 meters.)  I tried a couple of general-purpose
image editor/viewers, and they couldn't handle it.  Maybe ImageMagick,
but I'll have to read up on how to do it.  GIMP came closet, loading it
but then for some reason showing everything but water as 100% white.

The JPEG is a reasonable size, but is too low-resolution for the kind of
model I want to make:

https://prd-tnm.s3.amazonaws.com/StagedProducts/Elevation/13/TIFF/current/n35w119/USGS_13_n35w119.jpg

Here's the full directory:

https://prd-tnm.s3.amazonaws.com/index.html?prefix=StagedProducts/Elevation/13/TIFF/current/

Note that the directory names are latitude/longitude, but unobviously
they refer to the high end of the range so n35w119 refers to latitude
34.000-34.999 and longitude 118.000-118.999.

Unfortunately, as you might guess from the name, it seems that the USGS
only stocks data for the US.  (Which doesn't make any sense, since I'm
sure it's derived from satellites and they fly over most or all of the
world.)

With the ignorance of one who had never tried it, I was thinking that this "triangularize a contour map" problem couldn't be too hard. But then I realized that it was even less obvious than I thought how to connect two adjacent contour lines.  Simple concentric mountains seem straightforward enough.  However, two peaks can make for cases that I don't even know how to start on. 1111111111111111111111111111111111111 1 1 1 2222222 22222222 1 1 2 2 2 2 1 1 2222222 22222222 1 1 1 1111111111111111111111111111111111111 I keep thinking about doing something with USGS 3D Elevation Program files.  They are even already conveniently in grayscale image format.  Unfortunately, they are also, shall we say, kind of big.  The 1x1 degree tile for my area in Southern California is 437M, a 10Kx10K pixel image.  (Each pixel is about 10 meters.)  I tried a couple of general-purpose image editor/viewers, and they couldn't handle it.  Maybe ImageMagick, but I'll have to read up on how to do it.  GIMP came closet, loading it but then for some reason showing everything but water as 100% white. The JPEG is a reasonable size, but is too low-resolution for the kind of model I want to make: https://prd-tnm.s3.amazonaws.com/StagedProducts/Elevation/13/TIFF/current/n35w119/USGS_13_n35w119.jpg Here's the full directory: https://prd-tnm.s3.amazonaws.com/index.html?prefix=StagedProducts/Elevation/13/TIFF/current/ Note that the directory names are latitude/longitude, but unobviously they refer to the high end of the range so n35w119 refers to latitude 34.000-34.999 and longitude 118.000-118.999. Unfortunately, as you might guess from the name, it seems that the USGS only stocks data for the US.  (Which doesn't make any sense, since I'm sure it's derived from satellites and they fly over most or all of the world.)
SP
Sanjeev Prabhakar
Sat, Aug 27, 2022 3:20 AM

This maybe a good read

On Fri, 26 Aug 2022, 12:50 Bryan Lee, leebc11@acm.org wrote:

I am trying to make a topographic model.
(Think one of those things that shows how high the mountains are.)

My model needs to show the peaks and the valleys.

I have vector curves that represent elevations.  (I hand traced these from
an old map.)
I can import these as a grey-scale PNG of elevations, or as multiple SVGs
that create 2D polygons and extrude them.

However, I want the sides to be sloped, like a real mountain.  NOT have
vertical sides like extrusions.

If this were just a single convex mountain, I could do a hull() around the
multiple elevation levels.

But hull() will create a "flat" area between mountain peeks, and it will
not show the valleys.

Does anyone have suggestions for an algorithm that will work similar to
hull(), but that will curve the surface into concave areas?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

This maybe a good read On Fri, 26 Aug 2022, 12:50 Bryan Lee, <leebc11@acm.org> wrote: > I am trying to make a topographic model. > (Think one of those things that shows how high the mountains are.) > > My model needs to show the peaks and the valleys. > > I have vector curves that represent elevations. (I hand traced these from > an old map.) > I can import these as a grey-scale PNG of elevations, or as multiple SVGs > that create 2D polygons and extrude them. > > However, I want the sides to be sloped, like a real mountain. NOT have > vertical sides like extrusions. > > If this were just a single convex mountain, I could do a hull() around the > multiple elevation levels. > > But hull() will create a "flat" area between mountain peeks, and it will > not show the valleys. > > Does anyone have suggestions for an algorithm that will work similar to > hull(), but that will curve the surface into concave areas? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >