# Technical Documentation: bambulab/BambuStudio

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/bambulab/BambuStudio)

### Overview (README.md)

# BambuStudio
Bambu Studio is a cutting-edge, feature-rich slicing software.  
It contains project-based workflows, systematically optimized slicing algorithms, and an easy-to-use graphic interface, bringing users an incredibly smooth printing experience.

Prebuilt Windows, macOS 64-bit and Linux releases are available through the [github releases page](https://github.com/bambulab/BambuStudio/releases/).

Bambu Studio is based on [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research, which is from [Slic3r](https://github.com/Slic3r/Slic3r) by Alessandro Ranellucci and the RepRap community.

See the [wiki](https://github.com/bambulab/BambuStudio/wiki) and the [documentation directory](https://github.com/bambulab/BambuStudio/tree/master/doc) for more information.

# What are Bambu Studio's main features?
Key features are:
- Basic slicing features & GCode viewer
- Multiple plates management
- Remote control & monitoring
- Auto-arrange objects
- Auto-orient objects
- Hybrid/Tree/Normal support types, Customized support
- multi-material printing and rich painting tools
- multi-platform (Win/Mac/Linux) support
- Global/Object/Part level slicing parameters

Other major features are:
- Advanced cooling logic controlling fan speed and dynamic print speed
- Auto brim according to mechanical analysis
- Support arc path(G2/G3)
- Support STEP format
- Assembly & explosion view
- Flushing transition-filament into infill/object during filament change

# How to compile
Following platforms are currently supported to compile:
- Windows 64-bit, [Compile Guide](https://github.com/bambulab/BambuStudio/wiki/Windows-Compile-Guide)
- Mac 64-bit, [Compile Guide](https://github.com/bambulab/BambuStudio/wiki/Mac-Compile-Guide)
- Linux, [Compile Guide](https://github.com/bambulab/BambuStudio/wiki/Linux-Compile-Guide)
  - currently we only provide linux appimages on [github releases](https://github.com/bambulab/BambuStudio/releases) for Ubuntu/Fedora, and a [flathub version](https://flathub.org/apps/com.bambulab.BambuStudio) can be used for all the linux platforms

# Report issue
You can add an issue to the [github tracker](https://github.com/bambulab/BambuStudio/issues) if **it isn't already present.**

# License
Bambu Studio is licensed under the GNU Affero General Public License, version 3. Bambu Studio is based on PrusaSlicer by PrusaResearch.

PrusaSlicer is licensed under the GNU Affero General Public License, version 3. PrusaSlicer is owned by Prusa Research. PrusaSlicer is originally based on Slic3r by Alessandro Ranellucci.

Slic3r is licensed under the GNU Affero General Public License, version 3. Slic3r was created by Alessandro Ranellucci with the help of many other contributors.

The GNU Affero General Public License, version 3 ensures that if you use any part of this software in any way (even behind a web server), your software must be released under the same license.

The bambu networking plugin is based on non-free libraries. It is optional to the Bambu Studio and provides extended networking functionalities for users.
By default, after installing Bambu Studio without the networking plugin, you can initiate printing through the SD card after slicing is completed.

---

### Doc How To Build   Linux Et Al (`doc/How to build - Linux et al.md`)

# Building Bambu Studio on UNIX/Linux

Currently Linux version is not verified, you can try it referring to [PrusaSlicer's linux building guide](https://github.com/prusa3d/PrusaSlicer/blob/master/doc/How%20to%20build%20-%20Linux%20et%20al.md)

---

### Doc How To Build   Mac OS (`doc/How to build - Mac OS.md`)

# Building Bambu Studio on MacOS

## Environment setup

Install Following tools:

- Xcode from app store
- Cmake
- git
- gettext

Cmake, git, gettext can be installed from brew(brew install cmake git gettext)

## Building the dependencies

You need to build the dependencies of BambuStudio first. (Only needs for the first time)

Suppose you download the codes into `/Users/_username_/work/projects/BambuStudio`.

Create a directory to store the built dependencies: `/Users/_username_/work/projects/BambuStudio_dep`.
**(Please make sure to replace the username with the one on your computer)**

Then:

```shell
cd BambuStudio/deps
mkdir build
cd build
```

Next, for arm64 architecture:
```shell
cmake ../ -DDESTDIR="/Users/username/work/projects/BambuStudio_dep" -DOPENSSL_ARCH="darwin64-arm64-cc"
make
```

Or, for x86 architeccture:
```shell
cmake ../ -DDESTDIR="/Users/username/work/projects/BambuStudio_dep" -DOPENSSL_ARCH="darwin64-x86_64-cc"
make -jN
```
(N can be a number between 1 and the max cpu number)  

## Building Bambu Studio

Create a directory to store the installed files at `/Users/username/work/projects/BambuStudio/install_dir`:

```shell
cd BambuStudio
mkdir install_dir
mkdir build
cd build
```

To build using CMake:

```shell
cmake ..  -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="/Users/username/work/projects/BambuStudio_dep/usr/local" -DCMAKE_INSTALL_PREFIX="../install_dir" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MACOSX_RPATH=ON -DCMAKE_INSTALL_RPATH="/Users/username/work/projects/BambuStudio_dep/usr/local" -DCMAKE_MACOSX_BUNDLE=on
cmake --build . --target install --config Release -jN
```

To build for use with XCode:

```shell
cmake .. -GXcode -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="/Users/username/work/projects/BambuStudio_dep/usr/local" -DCMAKE_INSTALL_PREFIX="../install_dir" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MACOSX_RPATH=ON -DCMAKE_INSTALL_RPATH="/Users/username/work/projects/BambuStudio_dep/usr/local" -DCMAKE_MACOSX_BUNDLE=on
```

---

### Doc How To Build   Windows (`doc/How to build - Windows.md`)

# Building Bambu Studio on Windows

## Environment setup
Install Following tools:
- Visual Studio Community 2019 from [visualstudio.microsoft.com/vs/](https://visualstudio.microsoft.com/vs/) (Older versions are not supported as Bambu Studio requires support for C++17, and newer versions should also be ok);
- Cmake from [cmake.org](https://cmake.org/download/)
- Git from [gitforwindows.org](https://gitforwindows.org/) 
- Perl from [strawberryperl](https://strawberryperl.com/)

## building the deps
Suppose you download the codes into D:/work/Projects/BambuStudio  
create a directory to store the dependence built: D:/work/Projects/BambuStudio_dep

`cd BambuStudio/deps`  
`mkdir build;cd build`  
`cmake ../ -G "Visual Studio 16 2019" -DDESTDIR="D:/work/Projects/BambuStudio_dep" -DCMAKE_BUILD_TYPE=Release`  
`msbuild /m ALL_BUILD.vcxproj`  

It takes "00:14:27.37" to finish it on my machine (11th Gen Intel(R) Core(TM) i9-11900 @2.50GHz   2.50 GHz, with 32.0 GB DDR)

## building the Bambu Studio
create a directory to store the installed files at D:/work/Projects/BambuStudio/install_dir  
`cd BambuStudio`  
`mkdir install_dir`  
`mkdir build;cd build`  

set -DWIN10SDK_PATH to your windows sdk path(for example: C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0) in below command:  
`cmake .. -G "Visual Studio 16 2019" -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="D:/work/Projects/BambuStudio_dep/usr/local" -DCMAKE_INSTALL_PREFIX="../install_dir" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0"` 

then build it using command  
`cmake --build . --target install --config Release`  

or building it under the Visual Studio 2019  
(set the BambuStudio_app_gui as start project)

---

### Doc Localization Guide (`doc/Localization_guide.md`)

# Localization and translation guide

The purpose of this guide is to describe how to contribute to the Bambu Studio translations. We use GNUgettext for extracting string resources from the project and PoEdit for editing translations.

Those can be downloaded here: 
-    https://sourceforge.net/directory/os:windows/?q=gnu+gettext GNUgettext package contains a set of tools to extract strings from the source code and to create the translation Catalog.
-    https://poedit.net PoEdit provides good interface for the translators.

After GNUgettext is installed, it is recommended to add the path to gettext/bin to PATH variable.

Full manual for GNUgettext can be seen here: http://www.gnu.org/software/gettext/manual/gettext.html


### Scenario 1. How do I add a translation or fix an existing translation
1. Get PO-file 'BambuStudio_xx.pot' from corresponding sub-folder here:
https://github.com/bambulab/BambuStudio/tree/master/bbl/i18n
2. Open this file in PoEdit as "Edit a translation"
3. Apply your corrections to the translation
4. Push changed BambuStudio_xx.po into the original folder
5. copy BambuStudio_xx.mo into resources/i18n/xx and rename it to BambuStudio.mo, then push the changed file.

### Scenario 2. How do I add a new language support
1. Get file BambuStudio.pot here :
https://github.com/bambulab/BambuStudio/tree/master/bbl/i18n
2. Open it in PoEdit for "Create new translation"
3. Select Translation Language (for example French).
4. As a result you will have fr.po - the file containing translation to French.
Notice. When the translation is complete you need to:
    - Rename the file to BambuStudio_fr.po
    - Click "Save file" button. BambuStudio_fr.mo will be created immediately
    - Bambu_Studio_fr.po needs to be copied into the sub-folder fr of https://github.com/bambulab/BambuStudio/tree/master/bbl/i18n, and be pushed
	- copy BambuStudio_xx.mo into resources/i18n/xx and rename it to BambuStudio.mo, then push the changed file.
( name of folder "fr" means "French" - the translation language). 

### Scenario 3. How do I add a new text resource when implementing a feature to Bambu Studio
Each string resource in Bambu Studio available for translation needs to be explicitly marked using L() macro like this:
```C++
auto msg = L("This message to be localized")
```
To get translated text use one of needed macro/function (`_(s)` or `_CHB(s)` ).
If you add new file resource, add it to the list of files containing macro `L()`

### Scenario 4. How do I use GNUgettext to localize my own application taking Bambu Studio as an example

1.  For convenience create a list of files with this macro `L(s)`. We have 
https://github.com/bambulab/BambuStudio/blob/master/bbl/i18n/list.txt.

2.  Create template file(*.POT) with GNUgettext command:
    ```
        xgettext --keyword=L --add-comments=TRN --from-code=UTF-8 --debug -o BambuStudio.pot -f list.txt
    ```

    Use flag `--from-code=UTF-8` to specify that the source strings are in UTF-8 encoding
    Use flag `--debug` to correctly extract formatted strings(used %d, %s etc.)

3.  Create PO- and MO-files for your project as described above.

4.  To merge old PO-file with strings from created new POT-file use command:
    ```
        msgmerge -N -o new.po old.po new.pot
    ```
    Use option `-N` to not using fuzzy matching when an exact match is not found.

5.  To concatenate old PO-file with strings from new PO-file use command:
    ```
        msgcat -o new.po old.po
    ```

6.  Create an English translation catalog with command:
    ```    
        msgen -o new.po old.po
    ```
    Notice, in this Catalog it will be totally same strings for initial text and translated.

When you have Catalog to translation open POT or PO file in PoEdit and start translating.


## General guidelines for Bambu Studio translators


- We recommend using *PoEdit* application for translation (as described above). It will help you eliminate most punctuation errors and will show you strings with "random" translations (if the fuzzy parameter was used).

- To check how the translated text looks on the UI elements, test it :) If you use *PoEdit*, all you need to do is save the file. At this point, a MO file will be created. Rename it Bambu Studio.mo, and you can run Bambu Studio (see above).

- If you see an encoding error (garbage characters instead of Unicode) somewhere in Bambu Studio, report it. It is likely not a problem of your translation, but a bug in the software.

- See on which UI elements the translated phrase will be used. Especially if it's a button, it is very important to decide on the translation and not write alternative translations in parentheses, as this will significantly increase the width of the button, which is sometimes highly undesirable:



- If you decide to use autocorrect or any batch processing tool, the output requires very careful proofreading. It is very easy to make it do changes that break things big time.

- **Any formatting parts of the phrases must remain unchanged.** For example, you should not change `%1%` to `%1 %`, you should not change `%%` to `%` (for percent sign) and similar. This will lead to application crashes.

- Please pay attention to spaces, line breaks (\n) and punctuation marks. **Don't add extra line breaks.** This is especially important for parameter names.

- Description of the parameters should not contain units of measurement. For example, "Enable fan if layer print time is less than ~~n seconds~~"

- For units of measurement, use the international system of units. Use "s" instead of "sec".

- If the phrase doesn't have a dot at the end, don't add it. And if it does, then don't forget to :)

- It is useful to stick to the same terminology in the application (especially with basic terms such as "filament" and similar). Stay consistent. Otherwise it will confuse users.

---

### Doc Release Notes Cn (`doc/release_notes_cn.md`)

**新功能**
1. 3D文字工具
2. 对象和拷贝间的数据共享
3. 参数表格
4. 用户指南
5. 支持Arachne特性

**改进**
1. 支持导出通用的3mf格式，兼容其他切片软件
2. 优化混合支撑和树状支撑的生成速度
3. 支持不停靠工具头的延迟摄影
4. 支持纹理PEI热床
5. 支持导入和导出预设
6. 支持随机位置的接缝设置
7. 支持匈牙利语
8. 一些关键问题修复

详细信息请查看：https://github.com/bambulab/BambuStudio/releases

---

### Doc Release Notes En (`doc/release_notes_en.md`)

**New Features**
1. 3D text tool
2. Shared data between an object and its copies
3. Parameter table
4. User manual
5. Arachne feature

**Improvements**
1. Added support for exporting generic 3mf that is compatible with other slicers
2. Optimized the performance of hybrid and tree support
3. Added traditional timelapse mode
4. Added support for Textured PEI plate
5. Added support for export/import preset
6. Added random seam position
7. Added Magyar translations
8. Fixed some known bugs

For details, please check https://github.com/bambulab/BambuStudio/releases

---

--- METRICS ---
- Files Extracted: 7
- Estimated Token Budget: ~3582 tokens
- Canonical Reference: https://codewiki.google/github.com/bambulab/BambuStudio
