I tried the following, but am finding the last point seems to insist on being a peak even though its curvature is correctly set:
Code: Select all
local mesh = moho:Mesh()
local v = LM.Vector2:new_local()
v.x = -0.02
v.y = -0.02
mesh:AddLonePoint(v, 0)
v.x = -0.02
v.y = 0.02
mesh:AppendPoint(v, 0)
v.x = 0.02
v.y = 0.02
mesh:AppendPoint(v, 0)
v.x = 0.02
v.y = -0.02
mesh:AppendPoint(v, 0)
v.x = -0.02
v.y = -0.02
mesh:AppendPoint(v, 0)
mesh:WeldPoints(0, mesh:CountPoints() - 1, 0)
local curv = 0.391379 -- 0.391379 is the magic number for a circle
mesh:Point(0):SetCurvature(curv,0)
mesh:Point(1):SetCurvature(curv,0)
mesh:Point(2):SetCurvature(curv,0)
mesh:Point(3):SetCurvature(curv,0)
mesh:SelectAll()
local shapeid = moho:CreateShape(true,false,0)
local shape = mesh:Shape(shapeid)
When I looked at the curve in Moho, one of the bezier handles of the last point, where it joins the first point, is not extended unlike all the other curves.

Thank you.