07-27-2023, 11:15 AM
This matter has been resolved.
I have made changes to the code on the Curvy Splines side and also to be able to control it from my code.
Add the following properties to the CGDataRequestShapeRasterization.
Add the following at the beginning of Equals() and GetHashCode() in the same class, respectively
The above is the code on the Curvy Splines side.
In my code, I do the following processing before Refresh() of Generator and set IsChangeShape to true only when TCB or positions is changed.
I understand from your response that the different shape need to be updated even though the TCB parameters and CPs locations have not been changed.
Maybe this hack will generate a mesh with a shape that is not strictly correct.
However, in my case this was sufficient.
This technique may only work in my case, but I leave it here as reference information.
I could not have reached this point without your precise answer.
Thank you very much!
I have made changes to the code on the Curvy Splines side and also to be able to control it from my code.
Add the following properties to the CGDataRequestShapeRasterization.
Code:
public static bool IsChangeShape = true;
Add the following at the beginning of Equals() and GetHashCode() in the same class, respectively
Code:
if (!IsChangeShape)
return base.Equals(obj);
Code:
if (!IsChangeShape)
return base.GetHashCode();
The above is the code on the Curvy Splines side.
In my code, I do the following processing before Refresh() of Generator and set IsChangeShape to true only when TCB or positions is changed.
Code:
bool isAnyChangePosition = false;
for (int cpIdx = 0; cpIdx < shapeCpCount; cpIdx++)
{
Vector3 aPos = s_splineShapeACpPositionBufferList[cpIdx];
Vector3 bPos = s_splineShapeBCpPositionBufferList[cpIdx];
if (!isAnyChangePosition)
isAnyChangePosition = aPos != bPos;
}
CGDataRequestShapeRasterization.IsChangeShape =
s_splineShapeA.Tension != s_splineShapeB.Tension
|| s_splineShapeA.Continuity != s_splineShapeB.Continuity
|| s_splineShapeA.Bias != s_splineShapeB.Bias
|| isAnyChangePosition;
I understand from your response that the different shape need to be updated even though the TCB parameters and CPs locations have not been changed.
Maybe this hack will generate a mesh with a shape that is not strictly correct.
However, in my case this was sufficient.
This technique may only work in my case, but I leave it here as reference information.
I could not have reached this point without your precise answer.
Thank you very much!