Skip to content

Instantly share code, notes, and snippets.



Created Aug 22, 2019
What would you like to do?
// 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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.