Skip to content

Android Version of CuraEngine - Cura切片引擎的Android版本

License

Notifications You must be signed in to change notification settings

alexwoo1900/curaengine4android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README: ENGLISH | 简体中文

CuraEngine for Android

License

If you know nothing about CuraEngine, please read it's document first.

This project can tell you how to run CuraEngine on Android.

Demo

CuraEngine for Android

Quick Start

Environment

  • Android Studio Arctic Fox | 2021.3 Patch 2
  • AVD
    • 1080 x 2340: xhdpi
    • Android 10.0 (Google APIs)

Stage

  • Download the latest release and extract the package into ce4a
  • Create a new C++ project in Android Studio
    • New Project -> Native C++
      • Language: Kotlin
      • Minimum SDK: Android 6.0
    • Initialize Android environment (automatic)
    • Setup your AVD
      • Copy ce4a\com.example.myapplication into /mnt/sdcard/android/data in AVD
  • Replace ~\AndroidStudioProjects\{PROJECT}\app\src with ce4a\src
  • Replace ~\AndroidStudioProjects\{PROJECT}\app\build.gradle with ce4a\build.gradle
  • Build and run

PS. If you met any problems during building stage, delete ~\AndroidStudioProjects\{PROJECT}\app\.cxx and retry.

Customization

To simplify the demo, I hardcored all engine variables into the function.
You can rewrite more flexible engine running functions, or just replace the parameters in Java_com_example_myapplication_MainActivity_runCuraEngine with your own words.

What's included

CuraEngine source code

We cannot use the source code of CuraEngine directly in Android Studio because CuraEngine was originally designed for the PC platform.
Although we no longer have to write the underlying migration code for CuraEngine (Android Studio support C++ code), but we still need to fix some problems caused by architectural differences, like #1142.

The source code of CuraEngine in this project is a revised version, which has fixed several bugs including #1142.

Build Script

If you just use the engine as its, you don't have to modify any files.
I have removed all unnecessary dependency libraries to allow developers to run the demo as soon as possible.
If you need Arcus or OpenMP, just download the code, put them into your project and add some configurations to your CmakeLists.txt

Kotlin Demo

I have made a very simple application page to visually show developers the availability of CuraEngine.
It's written in Kotlin and C++, and both are natively supported by Android Studio.
Especially the C++ part of the code can let you know how to extract information from CuraEngine and interacts with frontend.

About

Android Version of CuraEngine - Cura切片引擎的Android版本

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages