2

it's my first post in this community. English is not my mother language, so if there's any inappropriate word, let me know and I would fix it. Thanks!

Here's my question, I am making a cube with mountain landscape in geometry node with some limitations.

  1. The landscape or the mountain surface only reveal on one face (personally set on top face)
  2. The cube size can be adjusted (total height, length, width)

The main problem I am facing is that I don't know how to use the edge of the landscape I already created, and extend on one certain face and close it. So I can control the height of the object.

Here's some screenshots show my current geometry node.enter image description here

enter image description here

Here's the completion that I expect. enter image description here

Wish someone can help me answer this question!

Hao-Wei.H
  • 31
  • 2

3 Answers3

4

You could start with a Mesh Primitive > Grid, then Mesh > Extrude it, and displace only the provided 'Top' selection.

enter image description here

Of course, the parameters exposed to the modifier are up to you.

enter image description here

To guarantee square subdivisions, the interface to grid construction is arranged as follows:

enter image description here

... which snaps the size to a whole number of squares, and subdivides accordingly. 'Resolution' is then measured in squares per Blender Unit. (1/Res is a Divide node, Sx*R+1 and Sy*R+1are Multiply Add nodes)

Robin Betts
  • 76,260
  • 8
  • 77
  • 190
3

if you start with a default cube and you add this geometry node setup:

enter image description here

enter image description here

you will get this:

enter image description here

First i split the edges so i can separate the top face, subdivide that top face for the "mountain building" and give a noise modifier for z-randomness (creates the mountains). With the multiply add vector node i mask only the x and y values and set the z values to 1 so that the cube will be closed, but only for x and y values which are either 1 or -1.

Chris
  • 59,454
  • 6
  • 30
  • 84
0

I was wondering how to produce n-gons on sides...

The Clamp Index node:

Basically if a side has 4 vertices, at first consider their indices to be:

0, 1, 2, 3

Now spawn an n-gon with two more vertices, and consider their indices to be:

-1, 0, 1, 2, 3, 4

Now clamp the additional vertices to the former range:

0, 0, 1, 2, 3, 3

If you clamp, output a 1; 1; 0 vector, which, multiplied by coordinates, will set Z to 0. If you don't clamp, output a 1; 1; 1 vector, which, multiplied by coordinates, will not change them.

Finally sample the positions taking advantage of deterministic vertex indexing in the Grid node: One side has the first indices, the opposite has the last indices, and perpendicular edges go in stride increments of a row length. Sometimes you need to reverse the order of indices to get the correct normal (aim for counter-clockwise winding).

Markus von Broady
  • 36,563
  • 3
  • 30
  • 99
  • BTW, you probably don't want the n-gons. If you want to save on geometry, remember you're only saving half-1 faces internally/on export, due to triangulation. You may want to resign from Merge By Distance... – Markus von Broady Jun 13 '22 at 18:10
  • 1
    Wow! that's a clean method! Thanks a lot for sharing your knowledge! Wish u have a nice day! @MarkusvonBroady – Hao-Wei.H Jun 14 '22 at 03:09
  • @Hao-Wei.H just keep in mind usually you actually want the topology generated by Robin Betts' or Chris' answer. – Markus von Broady Jun 14 '22 at 08:39