Hey~All. I hope to create a function to generate this geometric shape parametrically. The input parameters would be the radius, radian or included angle, and height that I’ve marked. It seems that the existing geometric shape creation functions can’t achieve this. I’m at a loss.
CreateCylinder almost meets my needs. But, I only need one center.
Lathe nearly does it, but I don’t know how to cap the shape:
Like @Evgeni_Popov , I couldn’t figure out how to cap Lathe or use CreateCylinder to create this kind of shape.
Is this the intersection of two orthogonal wedges of a sphere? If so, I’ve got some code based on CSG2 that will create it. I’ll post after I clean it up. A single wedge is shown in this video.
Here’s a single wedge (animated to test the speed of CSG2).
You don’t really need to copy my full spherical wedge code. Just use my getExtruded() (with “r” large enough to cover your cylinder) and rotate it to match your cylinder orientation, convert both extruded and your cylinder mesh to CSG2, then CSG2 intersect() and set vertices of your shape to the result. That last step is lines 119-122 of the playground I posted.
looks like a part of pizza
https://playground.babylonjs.com/#WSYBUT#2
That’s the first time I’ve seen creating a solid from arrays of edge points, calling CreateRibbon for each face, then merging face meshes! Thank you for the playground.
Solids seem to have lots of names for each shape . They seem to be based on how they are constructed from other named solids.
Based on the angle of the curved face to the plane and the angles of the flat faces to that vertical, it might have different names. “A cylindrical wedge, also called a cylindrical hoof or cylindrical ungula, is a wedge cut from a cylinder by slicing with a plane that intersects the base of the cylinder.”
In a cylindrical wedge, the curved face’s vertical is at a right angle to the plane of base of the cylinder, and the pointy side is a line (a diameter of the cylinder).
To construct the shape in question, start with a cylindrical wedge, cut with a second wedge orthogonal to the first (“double”), then “mirror” that shape along the “base,” resulting in the vertical having the same angle to each larger face.
That’s why I would call it a mirrored double cylindrical wedge. If the facing is curved horizontally and vertically (as cut from a sphere), I would call it a double spherical wedge.