L3odr0id e5e8a3c5e4 Update README.md | 2 éve | |
---|---|---|
src | 2 éve | |
.gitignore | 2 éve | |
Cargo.lock | 2 éve | |
Cargo.toml | 2 éve | |
LICENSE | 2 éve | |
README.md | 2 éve | |
cbindgen.toml | 2 éve | |
makefile | 2 éve |
3D object shape recognition tools for WASM, which not only has the same functionality to pass3d, but also it's compatible to Substrate. Now, it's used as a part of 3Dpass network Node.
calc
see the source, the exported functions have bindable types. Also make sure to annotate your exported functions with #[no_mangle]
and pub extern
so the function names can be matched from Dart. See working bindable function example.makefile
copied from brickpop's example. So follow his instruction.
$ANDROID_NDK_HOME
points to the NDK base folder/Users/brickpop/Library/Android/sdk/ndk-bundle
on MacOS/home/brickpop/dev/android/ndk-bundle
on Linuxrust
folder:make
to see the available actionsmake init
to install the Rust targetsmake all
to build the libraries and the .h
fileCargo.toml
target/aarch64-linux-android/release/libexample.so
target/armv7-linux-androideabi/release/libexample.so
target/i686-linux-android/release/libexample.so
target/x86_64-linux-android/release/libexample.so
target/universal/release/libexample.a
target/bindings.h
threedpass/packages/calc/android
:
src
└── main
└── jniLibs
├── arm64-v8a
│ └── libexample.so -> p3d/target/aarch64-linux-android/release/libexample.so
├── armeabi-v7a
│ └── libexample.so@ -> p3d/target/armv7-linux-androideabi/release/libexample.so
├── x86
│ └── libexample.so@ -> p3d/target/i686-linux-android/release/libexample.so
└── x86_64
└── libexample.so@ -> p3d/target/x86_64-linux-android/release/libexample.so
p3d/target/aarch64-apple-ios/release/libcalc.a
into threedpass/packages/calc/ios
p3d/target/bindings.h
to threedpass/rust/target/bindings.h
.ffigen
section in threedpass/packages/calc/pubspec.yaml
.
To use ffigen install llvm
On MacOS:
brew install llvm
On Linux:
sudo apt-get install -y clang libclang-dev
Write path to llvm for your system in pubspec.yaml.
llvm-path:
- /usr/local/opt/llvm/bin # For MacOS. Set path for your system
And generate lib/generated/bindings.dart
:
flutter pub run ffigen
p3d/target/bindings.h
to threedpass/packages/calc/ios/Classes/CalcPlugin.h
. In ios/Classes/SwiftCalcPlugin.swift
call your functions, so the compiler won't remove them.