2
$\begingroup$

Using the Cube mesh node under the Mesh Primitives menu, I want to create a cube that has a length of L and (L+1) vertices. Using that cube, I want to instance smaller cubes only on the vertices that are on the edge of the cube.

Basically, it should look like a hollow box frame of 10m sides made of smaller solid cubes of 1m sides. I think I can do it using Grid mesh, but it's getting too complicated.

$\endgroup$
2
  • 2
    $\begingroup$ What do you mean by "...create a cube that has a length of L and (L+1) vertices"? The default cube has an edge length of L=2m. So it should have 3 vertices(points) per edge? Something like this? $\endgroup$
    – Blunder
    Commented May 13, 2022 at 1:43
  • $\begingroup$ @Blunder: yep, i think too that this is what he wants $\endgroup$
    – Chris
    Commented May 13, 2022 at 5:33

3 Answers 3

6
$\begingroup$

One way to discriminate, (on a mesh-primitive cube of any size,) would be to select vertices whose normals have no component reaching a length of 1:

enter image description here

The '1.00' is in the Less Than to illustrate the point. For floating-point safety, it would probably be better to go to '0.95' or something like that.

Or for more complicated cases, where you want to do other stuff too, it might be worth using an Indexed Grid group:

enter image description here

Which can, for example, use a vertex-neighbour count.

$\endgroup$
4
  • 1
    $\begingroup$ very clever...as usual +1 $\endgroup$
    – Chris
    Commented May 13, 2022 at 7:34
  • 1
    $\begingroup$ @Chris Unusual. You guys have been much better and quicker than me at this stuff recently.. gettin' old :D $\endgroup$
    – Robin Betts
    Commented May 13, 2022 at 7:47
  • $\begingroup$ i am not sure whether you are older than me.... ;) $\endgroup$
    – Chris
    Commented May 13, 2022 at 7:48
  • 1
    $\begingroup$ Math Gangster Robin ::sunglasses:: at it again. $\endgroup$
    – Jakemoyo
    Commented May 13, 2022 at 11:02
5
$\begingroup$

for non-mathematic genius you can use this node setup:

enter image description here

enter image description here

$\endgroup$
4
  • 1
    $\begingroup$ Very flexible! :) (Bearing in mind, Einstein wasn't actually that great at arithmetic) $\endgroup$
    – Robin Betts
    Commented May 13, 2022 at 10:13
  • $\begingroup$ thanks mate! i appreciate that ;) $\endgroup$
    – Chris
    Commented May 13, 2022 at 10:14
  • 1
    $\begingroup$ Your solution will work on lots of things that aren't cubes. $\endgroup$
    – Robin Betts
    Commented May 13, 2022 at 10:20
  • 1
    $\begingroup$ Honestly - I didn’t think about that 🙈and I was looking quite a time to that solution….😉 $\endgroup$
    – Chris
    Commented May 13, 2022 at 10:21
0
$\begingroup$

Well this is awkward. I created this question using a guest account and thought that I could have it registered using the email link I received. Now that I have registered it, I cannot seem to be able to upvote or comment on the answers. And this new account seems to be a completely different after registration, so I can't select an answer as a solution.

Anyway, I have been successful thanks to your answers.

The solution posted by @Robin Betts does the job. However, I didn't need the second method for a cuboid. I did it with the first one by passing the length/breadth/height as different parameters. I used vertices=(length+1), but I think length=(vertices-1) would be more intuitive. enter image description here

The solution posted by @Chris has gaps between the cubes, which I believe can be fixed by the Resample Curve node.

Thank you all for helping me out.

$\endgroup$
1
  • $\begingroup$ Thanks for taking the time to get around the bureaucracy! I'm sure, for once, this will qualify as an answer. (Your constructive criticism of the Indexed Grid group: noted. ) $\endgroup$
    – Robin Betts
    Commented May 13, 2022 at 18:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .