New primitive : tetrahedron (and by extent, other platonic solids)
I am a newbie here and apologise to all if this request is a duplicate - which I don't think.
Pyramid (and beyond)?
Many users already asked the possibilty to use a "pyramid" among the lists of primitives.
It was suggested to use a cone, and slice it. While it might work for an approximate 4-sided primitive, the issue becomes a bit complex because of snapping, when you want to design a regular polyhedron.
Reason for this is: I expected to find a regular tetrahedron (4 triangular faces) among the lists of available primitives, as well as other basic platonic solids such as -- of course aside from the already featured hexahedron (cube - 6 square faces) -- an octahedron (8 triangular faces), a dodecahedron (12 pentagonal faces), and the icosahedron (20 triangular faces).
polyhedron generator? Implementing the dodecahedron might be difficult. Thus, one key feature which I would find interesting for the sake of mathematical simplicity, would be a triangular-faces only polyhedron generator, which happens to be found in most 3D polygonal modeler packages as tesselated sphere generator. I would suggest enabling a limited set of polyhedra to avoid stepping into nightmarish topological issues.
THAT feature would really be helpful because snapping is "Oh my!" far from practical in my opinion when you pursue certain design objectives...
Greetings from Paris... Voila!
Yes, this is interesting. Any convex polyhedron (that certainly includes all the platonic solids) can be constructed as a boolean cluster - an intersection of volumes on one side of the plane of each of its faces. So you can go ahead and do it right now using the trimPlane-out primitive we have in the BooleanTrims section of the library.
You'll have to start with a primary object before trimming it with trim planes (they are all infinite, there is no infinite-plane primary). It doesn't matter what that primary object is, no surface from it will remain in the end. It could be a sphere. Trim planes will be added one by one and then rotated and translated as necessary. The only problem, of course, is knowing the exact position and rotation angle for each plane to create a polyhedron with exactly equal faces.
I suppose the easiest way to do this would be to create a Groboto scene (.gbr) file with just some arbitrarily positioned planes (8 planes for an octahedron, for instance), and then overwrite the numbers in the .gbr file that control their position and rotation angle - with the exact numbers for that platonic solid. gbr files are xml text files, so this should be easy. If you are interested, I can give you info about how to find this data in the .gbr file.
Maybe we can develop this into a method that allows the users to satisfy their needs for creating very specific and peculiar objects, beyond the usual boxes, cylinders and such...
And Groboto has a feature that will make this very convenient for the user - any .gbr file with an object like this can be dropped into the Primitives folder (Documents/Braid Art Labs/Groboto/Primitives on Windows) and it will appear in the library just like any other primitive (under User Primitives).
Last edited by boris; 05-23-2012 at 08:58 AM.
Hello back Boris and many apologies for not being able to respond earlier.
Originally Posted by boris
I follow your suggestion.
I realize now that I follow your suggestion: I really need to have a perfect tetrahedron and positioning by hand is impossible! I propose you to document, set by step, this method for two objects to enable other users to toy up new stuff. I am sure that enabling users to have a finely tuned control mechanism is going to be helpful.
The tetrahedron is a basic, ultra simple shape contained within a cube. In that respect, the cube "vertexes" (coordinates and angles) will greatly ease our way (my guess): 3 vertexes define a plane, etc. basic geometry but we'll need to tweak the numbers.
In all honnesty, this is the first time I'll every go into the code. Hope it does not bite!
Bunch of thanks, really
When do we start?
I thought: why settle for plain (plane) old platonic solids, when you can have the same with spherical faces? Especially since you can make spherical faces as flat as you want, which gets you the plane-based solids too.
So first I created an arbitrary spherical tetrahedron in Groboto. Started with a large sphere in the center of the world (brown wireframe in the pic below), dragged on it with the Bool tool to make it a Primary in a boolean cluster, and pressed E on it to activate it for editing.
Then I dropped into this cluster 4 trim spheres from the BooleanTrims section of the library. I used sphr-inBody trims - with this you get the boolean intersection of the insides of 4 spheres. I moved them in space just to get the rough idea of a curved tetrahedron - the precise positions will be set later, numerically. The 4 trim spheres are shown as blue wireframes. The primary sphere does not affect the actual shape - it should simply be large enough so that the shape is completely enclosed by it.
I saved the .gbr file and opened it in an xml text editor.
It's a small file, easy to find things in it. Here's the snapshot of the Obj section we are interested in. We see here 5 spheres (Obj o="1"). The top sphere is the primary, we don't need to modify it. The other 4 spheres are trims, we need to set their center positions and radiuses.
The center position is hilited in blue - px,py,pz. The radius is the single parameter on the next line, marked with the red comment. All these values are 32-bit floats, encoded as Base64 text. For instance 0.0 is "AAAAAA==". You need some sort of float to Base64 conversion utility.
To make a spherical tetrahedron we place the centers of our 4 spheres at the vertices of the conventional tetrahedron. I chose a tetrahedron with one (top) vertex at x = 0, yTop = 100, z = 0. Then the other 3 vertices will be at the same height y = -yTop/3 (tetrahedron center is in the origin). One of the lower vertices I place at z = 0, x = yTop*2*sqrt(2)/3. The other two are rotated from that +- 120 degress around Y axis, so their x will be -1/2 of the x above, their z will be +- sqrt(3)/2 of the same.
Finally, the radius of each of the 4 trim spheres is set to 150 (this is arbitrary, gives one flavor of the spherical tetrahedron; this could be ajusted later in Groboto). After making these numeric modifications we open the file in Groboto and get this:
A perfectly symmetric curved tetrahedron. Now we can press E on it to activate it for editing:
select the 4 trim spheres and reduce their radius in the Edit panel. As long as all 4 radiuses are changed together, it will remain a perfectly symmetric body. Reducing the radiuses makes its faces flatter, and also reduces the overall size of the object. We can press E to exit the edit mode, select the whole cluster and use Global Scale in the Edit panel to increase the overall size back to normal:
For the sake of rendering efficiency the primary sphere radius should be changed too, so that it is only a bit larger than the boolean object, not many times larger. Here's the link to this gbr file.
For some reason the text editor snapshot above appeared reduced, hard to read. Here it is again:
Well, same thing. But if you right-click the image, copy it and paste somewhere, it appears full-size.
Last edited by boris; 06-05-2012 at 03:02 PM.
Tags for this Thread