5.0 KiB
Win11 打包流程(生成适用于 Win7 的静态版)
-
进入 VS 2022 开发者命令行 打开“x64 Native Tools Command Prompt for VS 2022”(或在 PowerShell 中执行 cmd.exe /k "<VS路径>\vcvars64.bat" 并在新开的 CMD 中操作)。
-
安装/更新 Pixi 静态环境依赖
C:\Users\sladr\.pixi\bin\pixi.exe install -e static -
清理旧的构建目录(可选但推荐)
rmdir /s /q build\win-static -
配置静态工程(目标 Win7)
C:\Users\sladr\.pixi\bin\pixi.exe run -e static cmake ^ -G "Visual Studio 17 2022" -A x64 ^ -S . -B build\win-static ^ -DWIN32_WINNT=0x0601 ^ -DBUILD_STATIC=ON -DBUILD_SHARED_LIBS=OFF ^ -DCMAKE_BUILD_TYPE=Release -
编译 Release 可执行文件
C:\Users\sladr\.pixi\bin\pixi.exe run -e static cmake --build build\win-static --config Release -
(可选)安装到 Pixi 环境 bin
C:\Users\sladr\.pixi\bin\pixi.exe run -e static cmake --install build\win-static --config Release -
产物位置 • 未安装:build\win-static\Release\STP2GLB.exe • 安装后:.pixi\envs\static\Library\bin\STP2GLB.exe
──────────────────────────────────────────
Win7 打包流程(直接在 Win7 上构建)
前提:Win7 SP1 + VS 2019/2022(带 MSVC v142/v143),安装 Pixi,并确保 SDK/工具链支持 VS 构建。
-
使用已配置好的 VS 开发者命令行 启动 Win7 上的 “x64 Native Tools Command Prompt”,保证 cl.exe 和 cmake 可用。
-
安装 Pixi 静态环境依赖
C:\Users\sladr\.pixi\bin\pixi.exe install -e static -
清理旧目录
rmdir /s /q build\win-static -
配置工程(同样指定 Win7)
C:\Users\sladr\.pixi\bin\pixi.exe run -e static cmake ^ -G "Visual Studio 17 2022" -A x64 ^ -S . -B build\win-static ^ -DWIN32_WINNT=0x0601 ^ -DBUILD_STATIC=ON -DBUILD_SHARED_LIBS=OFF ^ -DCMAKE_BUILD_TYPE=Release -
编译 Release
C:\Users\sladr\.pixi\bin\pixi.exe run -e static cmake --build build\win-static --config Release -
(可选)安装
C:\Users\sladr\.pixi\bin\pixi.exe run -e static cmake --install build\win-static --config Release -
产物位置 同 Win11 流程,产物可执行文件位于构建目录或安装后的 Pixi 环境 bin 目录。
──────────────────────────────────────────
注意事项 • 每次变更代码后建议在 Win11 构建并将 STP2GLB.exe 拷贝到 Win7 实机进行实际验证。 • 若在 Win7 上本地构建,需确保 VS 工具链与 Windows SDK 在该机器上完整可用;否则可在 Win11 构建后直接拷贝二进制。
Stp2Glb
Usage
STEP to GLB converter
Usage: STP2GLB.exe [OPTIONS]
Options:
-h,--help Print this help message and exit
--stp REQUIRED STEP filepath
--glb REQUIRED GLB filepath
--lin-defl :FLOAT in [0 - 1] [0.1]
Linear deflection
--ang-defl :FLOAT in [0 - 1] [0.5]
Angular deflection
--rel-defl Relative deflection
--debug Debug mode. More robust but slower
--solid-only Solid only
--max-geometry-num [0] Maximum number of geometries to convert
--filter-names-include Include Filter name. Command separated list
--filter-names-file-include Include Filter name file
--filter-names-exclude Exclude Filter name. Command separated list
--filter-names-file-exclude Exclude Filter name file
--tessellation-timeout [30]
Tessellation timeout
Development
Install Pre-requisites
The pre-requisites build requirements are conda packages handled by using pixi.
Note that on windows the MSVC c++ compiler toolchain is used. So a pre-requisite on windows is that you have installed VS or VS build tools from https://visualstudio.microsoft.com/downloads/?q=build+tools
Building
To build the STP2GLB executable using shared dependencies, run the following command:
pixi run build && pixi run install
To build the STP2GLB executable using static dependencies, run the following command:
pixi run -e static build && pixi run -e static install
Local IDE development
You can use the presets in the CMakePresets.json file (which points to the pixi environment). Just make sure you've
either installed the pixi environment using pixi install or have run any of the build commands above.
Performance metrics
Todo