I often use cylinder meshes for stuff, but one thing that would be really useful is if cylinder meshes would stretch on their x and z axis so if your part is 2x2x1 the cylinder will be more like an oval rather than shrinking to 1x2x1 which is its current behavior.
This is the current behavior. What I would like is if the cylinder mesh stretched so that it fills up the whole box and looks like an oval from the top.
It would be really nice (as currently no such mesh exists), but I don’t think having CylinderMesh do it would be the best, as it would break a number of models. I think a new SpecialMesh type would be better.
I have been wanting this for a long time. Sphere meshes already do this, why can’t cylinder meshes? I say make the change and let the consequences be damned! The number of people who have weirdly-sized parts with cylinder meshes probably isn’t all that high.
Ugh, it’s bad enough that the Sphere mesh is a special mesh, but cylinders too? One thing I like about cylinder meshes is how easy it is to use: just double-click on it in the Basic Objects menu. With a sphere, you have to insert a SpecialMesh and then find it in the hierarchy and change the type from ‘Head’ to ‘Sphere’.
Green is BasePart.Shape Ball/Cylinder (Balls have their own collision box, and cylinders do too now.)
Blue is SpecialMesh.MeshType Sphere (They squish and stretch automatically)
Red is SpecialMesh.MeshType FileMesh (with the ID from Tom's Beans - Roblox, so http://www.roblox.com/asset/?id=103919751)
This is a union, but it’s a cylinder that can be compressed/stretched without the little rings at the ends:
Now with box physics, we shouldn’t have any issues with performance either.
Here’s some plugin code to generate one (Base ellipse creation code by @AxisAngle ;)):
function drawFilledCylinder(centerCFrame,xRadius,yRadius,height,sides)
local Model=Instance.new("Model",game.Workspace)
local LastPoint=Vector3.new(xRadius,0,0)
for i=1,sides do
local Angle=i*2*math.pi/sides
local CurrentPoint=Vector3.new(xRadius*math.cos(Angle),0,yRadius*math.sin(Angle))
local Part=Instance.new("Part",Model)
Part.Anchored=true
Part.FormFactor="Custom"
local Dist=(CurrentPoint-LastPoint).magnitude
Part.Size=Vector3.new(math.min(xRadius,yRadius),height,Dist)
Part.CFrame=centerCFrame*CFrame.new(LastPoint,CurrentPoint)*CFrame.new(math.min(xRadius,yRadius)/2,0,-Dist/2)
LastPoint=CurrentPoint
end
return Model
end
_G.createCylinder = function(x,y,z,sides)
sides = sides or 16
local p = (workspace.CurrentCamera.CoordinateFrame * CFrame.new(0,0,-10)).p
local cylinder = drawFilledCylinder(CFrame.new(p),x/2,y/2,z,sides)
local success,error = pcall(function()
plugin:Union(cylinder:GetChildren())
end)
if success then
cylinder:GetChildren()[1].Parent = workspace
cylinder:Destroy()
else
error("Could not union parts. Try manually?")
end
end
Maybe malformed cylinders are something for @M0RGOTH’s CSG primitives plugin?
Nice, gets rid of the lip. Can’t union in an online game though, and can’t stretch and squish it online/in studio once it’s made (see pic.)
Both workarounds have pros and cons depending on what you’re doing q_q Unless someone finds a FileMesh from like the MeshDB person that doesn’t have a lip.
Yeah it wasn’t meant to be a complete solution. Just something you can do in studio to avoid the weird edges at the top of that cylinderish mesh you found.