Procedurally generating shapes given a face count? (Editable meshes)

Hey folks!

I’m looking to procedurally generate shapes using a constructor function that only takes the number of sides it should consider. So for example, an input of 4 would make a tetrahedron, 5 would be pyramid, 6 is a cube, etc.

That being said I don’t even know where to start since I’m a bit lost when it comes to making an editable mesh. I’ve read the documentation as well as some examples, but when I try to procedurally generate something myself I don’t get anything desirable.

How should I approach this? Any code snippets would be mega helpful.

Thanks!

1 Like

What is the code that you were using to generate shapes?

Unfortunately the few different attempts are all lost now since they didn’t save :sweat_smile: