29-01-2022, 01:13 PM
yes I am stitching at runtime.
this is the stitching code:
its pretty much pairing up vertices that exist on the same stitched curve on different meshes.
could it be the mesh im generating before stitching causing problems? like its too tight?
this is the stitching code:
Code:
// Sew all sides together:
ObiStitcher stitcher = gameObject.AddComponent<ObiStitcher>();
stitcher.Actor1 = cloths[0];
stitcher.Actor2 = cloths[1];
//Add stitches:
var stencilData = stencil.Generate();
foreach (ShapeData shapeData in stencilData)
{
foreach (CurveData curveData in shapeData)
{
if (curveData.Stitched)
{
int[][] stitches = new int[2][];
for (int i = 0; i < meshData.Length; i++)
{
stitches[i] = meshData[i].VerticesOnCurve(curveData);
}
for (int i = 0; i < stitches[0].Length; i++)
{
Debug.Log(stitches[1].Length);
stitcher.AddStitch(stitches[0][i], stitches[1][i]);
}
}
}
}
stitcher.PushDataToSolver();
cloths[0].maxBending = 0.1f;
cloths[1].maxBending = 0.1f;
could it be the mesh im generating before stitching causing problems? like its too tight?