// AngelCAD code, showing use of function pointer
funcdef double CALLBACK(int i);
solid@ object(CALLBACK@ f,int i)
{
return sphere(f(i));
}
// ====
double myfunc(int i) { return i*i; }
shape@ main_shape()
{
return object(myfunc,5);
}
void main()
{
shape@ obj = main_shape();
obj.write_xcsg(GetInputFullPath(),secant_tolerance:-1.0);
}
Created
August 22, 2019 12:56
-
-
Save arnholm/7061458777913e5795585eee46fcb664 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment