Merge pull request #1 from Yuandian-aml/codex/check-for-chinese-characters

docs: normalize Platform compile guide and READMEs; clarify Clipper distance comment
This commit is contained in:
yuan dian 2026-02-28 16:17:08 +08:00 committed by GitHub
commit 89ddb3f370
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 86 additions and 84 deletions

View file

@ -1,79 +1,79 @@
# 1Android Platform
**Android compilation** depends on the NDK toolchain. Currently, version r25c is recommended. Download link: https://github.com/android/ndk/wiki/Unsupported-Downloads
## NDK toolchain configuration
- Verify whether the ndk-build compilation environment exists:
Execute: ndk-build -v. If there is a version information prompt, it is successful. If not, refer to the following steps to configure the ndk-build compilation environment
- Download android-ndk-r25c
https://dl.google.com/android/repository/android-ndk-r25c-linux.zip
- Unzip and get the path /xxxx/android-ndk-r25c
- Set environment variables
- Edit bash.bashrc file
sudo vi ~/.bashrc
Add at the end of the file: export PATH=/xxxx/android-ndk-r25c:$PATH
- Update environment variables
source ~/.bashrc
- Check whether the environment has been successfully added
ndk-build --version shows version information
# 2Linux Platform
**Linux compilation** toolchain dependency: **gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf**, download link: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads/
## Linux toolchain configuration
1. Configure the cmake compilation environment:
1. Verify whether there is a cmake environment:
cmake --version shows the cmake version is successful. If cmake does not exist, perform the following steps to configure the cmake environment
2. Install cmake
pip3 install cmake==3.16.3
3. Verify that the installation is successful
cmake --version
Displaying the cmake version is successful
2. Configure the compilation toolchain
1. Download the toolchain
32-bithttps://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads/ link
gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.xz
64-bit: There is currently no 64-bit version, and it will not be added for the time being. If some customers use the corresponding version and did not add the toolchain path in time, please give feedback.
2.arm-none-linux-gnueabihf install
a.Unzip it and place it in the folder you need
tar -xvJf ***.tar.xz
b.Edit the bash.bashrc file
sudo vi ~/.bashrc
c.Add environment variables
export PATH=path_to/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin:$PATH
d.update environment variables
source ~/.bashrc
e.Check if the environment is successfully joined
# 1 Android Platform
**Android compilation** depends on the NDK toolchain. Currently, version r25c is recommended. Download link: https://github.com/android/ndk/wiki/Unsupported-Downloads
## NDK toolchain configuration
- Verify whether the ndk-build compilation environment exists:
Execute: ndk-build -v. If there is a version information prompt, it is successful. If not, refer to the following steps to configure the ndk-build compilation environment
- Download android-ndk-r25c
https://dl.google.com/android/repository/android-ndk-r25c-linux.zip
- Unzip and get the path /xxxx/android-ndk-r25c
- Set environment variables
- Edit bash.bashrc file
sudo vi ~/.bashrc
Add at the end of the file: export PATH=/xxxx/android-ndk-r25c:$PATH
- Update environment variables
source ~/.bashrc
- Check whether the environment has been successfully added
ndk-build --version shows version information
# 2 Linux Platform
**Linux compilation** toolchain dependency: **gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf**, download link: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads/
## Linux toolchain configuration
1. Configure the cmake compilation environment:
1. Verify whether there is a cmake environment:
cmake --version shows the cmake version is successful. If cmake does not exist, perform the following steps to configure the cmake environment
2. Install cmake
pip3 install cmake==3.16.3
3. Verify that the installation is successful
cmake --version
Displaying the cmake version is successful
2. Configure the compilation toolchain
1. Download the toolchain
32-bithttps://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads/ link
gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.xz
64-bit: There is currently no 64-bit version, and it will not be added for the time being. If some customers use the corresponding version and did not add the toolchain path in time, please give feedback.
2.arm-none-linux-gnueabihf install
a.Unzip it and place it in the folder you need
tar -xvJf ***.tar.xz
b.Edit the bash.bashrc file
sudo vi ~/.bashrc
c.Add environment variables
export PATH=path_to/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin:$PATH
d.update environment variables
source ~/.bashrc
e.Check if the environment is successfully joined
Execuearm-none-linux-gnueabihf-gcc -vView gcc 32bit version

View file

@ -4108,10 +4108,12 @@ inline double DistanceSqrd(const IntPoint &pt1, const IntPoint &pt2) {
double DistanceFromLineSqrd(const IntPoint &pt, const IntPoint &ln1,
const IntPoint &ln2) {
// The equation of a line in general form (Ax + By + C = 0)
// given 2 points (x锟?y锟? & (x锟?y锟? is ...
//(y锟?- y锟?x + (x锟?- x锟?y + (y锟?- y锟?x锟?- (x锟?- x锟?y锟?= 0
// A = (y锟?- y锟?; B = (x锟?- x锟?; C = (y锟?- y锟?x锟?- (x锟?- x锟?y锟? // perpendicular distance of point (x锟?y锟? = (Ax锟?+ By锟?+ C)/Sqrt(A锟?+ B锟?
// The equation of a line in general form is Ax + By + C = 0.
// Given two points (x1, y1) and (x2, y2):
// (y1 - y2)x + (x2 - x1)y + (y2x1 - x2y1) = 0
// so A = (y1 - y2), B = (x2 - x1), C = (y2x1 - x2y1).
// The perpendicular distance of point (x, y) is
// (Ax + By + C) / sqrt(A^2 + B^2).
// see http://en.wikipedia.org/wiki/Perpendicular_distance
double A = double(ln1.Y - ln2.Y);
double B = double(ln2.X - ln1.X);
@ -4376,4 +4378,4 @@ std::ostream &operator<<(std::ostream &s, const Paths &p) {
}
//------------------------------------------------------------------------------
} // ClipperLib namespace
} // ClipperLib namespace

View file

@ -60,7 +60,7 @@ example
| ----------------- | ------------------------------------------------------------ |
| model_path | onnx model path |
| adla_toolkit_path | path to adla_toolkit |
| target_platform | Specify target platform. for A311D2 : PRODUCT_PID0XA003。for S905X5: PRODUCT_PID0XA005 |
| target_platform | Specify target platform. For A311D2: PRODUCT_PID0XA003. For S905X5: PRODUCT_PID0XA005 |