f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Add C bindings for the libf3d

Open mwestphal opened this issue 11 months ago • 6 comments

Is your feature request related to a problem? Please describe. Currently, the libf3d has a C++11 API and provides bindings in python and javascript (experimental).

Providing C bindings would open libf3d usage to many other languages, especially Julia and Rust.

Let's see if there is an interest for this. If you have interest, please do not hesitate to comment on this issue.

mwestphal avatar Mar 09 '24 20:03 mwestphal

@mwestphal please assign this to me

kidharb avatar Mar 16 '24 06:03 kidharb

Here's my opinion on this topic:

  • Functions of the form instance.function(arg1, arg2) should look like function(instance, arg1, arg2)
  • Return references should become argument pointers
  • Returned std::vector should become int* size and T* ptr arguments

We should add the bindings directly in the public headers where it's appropriate, it should look like:

#ifdef __cplusplus

/* C++ class definition here*/

extern "C" {
#endif

/* C bindings definition here*/

#ifdef __cplusplus
}
#endif

Meakk avatar Mar 16 '24 20:03 Meakk

I'll work on this!

parkerstafford avatar Mar 31 '24 23:03 parkerstafford

Need any help @parkerstafford ? :)

mwestphal avatar Apr 21 '24 14:04 mwestphal

Hey @parkerstafford , need any help moving forward ?

mwestphal avatar Jul 13 '24 16:07 mwestphal

first version here: https://github.com/f3d-app/f3d/pull/1444

mwestphal avatar Sep 09 '24 18:09 mwestphal