Cura是Ultimaker发展的一个开源软件,用于3D打印机印前处理、模型切片和打印输出的软件。Cura可以支持中国目前绝大部分的3D打印机。最新的版本采用了PyQT5对界面进行了重构,这里介绍从源码编译Cura的过程,掌握源码对于软件定制和完善打印能力具有重要的意义。
Cura在Linux上的版本总是下载不了,准备自己从源码进行编译。
下面是从https://github.com/ultimaker上下载的编译脚本。原始的脚本有一些问题,自己做了一些修改,如下:
#!/bin/bash
# This is a script which get the latest git repo and build them.
#
# Tested under ubuntu 15.04, lower versions don't have PyQT 5.2.1 which is required by cura
#cd ~
mkdir dev
cd dev
sudo apt-get install -y git cmake cmake-gui autoconf libtool python3-setuptools curl python3-pyqt5.* python3-numpy qml-module-qtquick-controls
git clone https://github.com/Ultimaker/Cura.git
git clone https://github.com/Ultimaker/Uranium.git
git clone https://github.com/Ultimaker/CuraEngine.git
git clone https://github.com/Ultimaker/libArcus
git clone https://github.com/Ultimaker/protobuf.git
echo Build protobuf...
cd protobuf
./autogen.sh
./configure
make -j4
sudo make install
sudo ldconfig
cd python
python3 setup.py build
sudo python3 setup.py install
cd ../..
pwd
echo Build libArcus...
cd libArcus
mkdir build
cd build
cmake .. -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages
make -j4
sudo make install
cd ../..
pwd
echo Build CureEngine...
cd CuraEngine
mkdir build
cd build
cmake ..
make -j4
cd ../..
pwd
echo Build Uranium
cd Uranium
mkdir build
cd build
cmake .. -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages -DURANIUM_PLUGINS_DIR=/usr/lib/python3.4/dist-packages
sudo make install
cd ../..
pwd
echo Build Final...
cp -rv Uranium/resources/* Cura/resources/
sudo ln -s $PWD/CuraEngine/build/CuraEngine /usr/bin/CuraEngine
cd Cura
python3 cura_app.py
pwd
运行了很长时间,但结果不太妙啊。
编译结果出错:
QWidget: Must construct a QApplication before a QWidget
./ubuntu-15.04-build-script.sh: 行 62: 29168 已放弃 (核心已转储) python3 cura_app.py
嗯,这可是最新的开发代码呀!出点错是很正常的。
到https://github.com/ultimaker/Cura上去创建了个issue,提交上去,看谁能解决这个问题。
有可能Python运行环境冲突。准备明天搞一个独立的镜像,自己先重新编译一遍,确认下是啥问题。
Linux系统入门教程:在Linux中安装兄弟牌打印机:http://www.linuxdiyf.com/linux/12947.html