Hi, digging on NURBS library, and noticed something that seems to need some polishing on vl side.
So I have a C# struct, that manages native memory:
public record struct NurbsCurve
{
// some properties
// instance method
public float GetParamByLength(float length)
{
return (float)
LNLibNurbsCurve.GetParamByLength(
NativeCurve,
length,
IntegratorType.INTEGRATOR_GAUSS_LEGENDRE
);
}
}
So, when I add this method from node browser, I get an instant crash, since it tries to use unassigned native memory… Normally you get just an exception that instance was null but in this case vvvv is gone… I’m adding some safety checks obviously. However if I define Class in vl, and try to add method to patch witch is disconnected from instance I don’t have error.
The question is:
Can this be resolved on VL side of things, or maybe C# declaration can be decorated with something?
For classes, you get a null exception, but this is a record, so the memory will always be created. In this case, struct might not be the right data type, as you probably want to pass around a reference to the curve and not copy around the memory all the time.
ROFL, it seem issue I was bumping was just a peak of iceberg, it seems the actual problem I have is that underlying lib throws access violations even if it’s fed with correct parameters, making the whole thing kind of unstable…
Guess I will have to abandon current state and take route to port that thing from scratch, the performance vise when you start to feed it with realtime parameters seems to be also quite slow…