Documnet Navigation
Use this template to compare 3D print profiles from different slicers. Current slicer programs the template can use:
- Slic3r
- Simplify3D
- PrusaSlicer
If the slicer used is one of the above, you can use this template as is. But - if not, before using ensure that:
- The slicer program exports gcode with the print settings commented out in the sliced gcode file.
- The slicer exports it's printing profiles as human readable data.
If one of the two conditions above is met, this template can be used as is if the assignment character in the exported gcode is a =
character, and the slicer exports 3D print profiles as either an ini
, fff
, or xml
file. Also, if ini
files are used for exporting printer profiles, the assignment character needs to be a =
character to use as is. For best results configure for the slicer. In most cases a line for the slicer can be added to the config file config/slicerPrograms.json
. If needed, a script file may be needed if an assignment character other than the =
character is used to assign values to the print profile properties.
To add a new profile input the name of the slicer (with no space) as the property, and the assignment character as the value in config/slicerPrograms.json
. If needed, modify the assignment character (use scripts/Simplify3D.php
as a guide) and add a custom php script file in the scripts
folder using the property name from config/slicerPrograms.json
as the php file name. For instance the property value of "Simplify3D" : "--,--" has a script file named Simplify3D.php. For the property "Simplify3D" --,-- was used as the value for the assignment character instead of , (actual assignment character) as some properties used a comma character in the value.
If adding a script file you'll have to modify it so that the assignment character can split the property name from the property value for the 3D printing progile. In the case of Simplify3D
:
- New lines are temporarily replaced with a marker.
- The marker is formatted so that when the new lines are added back the properties and values can be extracted using the first
,
as the assignment operator. - The first assignment character
,
is replaced with--,--
after the new lines are added back.- This is used so that commas in the propety value are not used to split an unwanted property value pair.
- The first three lines, and the last line are deleted.
Add gcode
, ini
, fff
, and xml
files to the parse folder. File names can contain space, or be numerical. If using numerical files, only use numbers for the file names, ensure that they are in sequential order, and do not duplicate a numeric file e.g. 1.gcode and 1.ini.
If files are not in order and sequential they will be parsed - but not in numeric order. They will be parsed in the order they were output from the terminal using the script file scripts/file_count.php
.
NOTE - for Windows 10 or later, additional packages are needed.
This can be used in codespaces, or cloned/downloaded locally, then used with localhost:PORT
. The below snippet (copy/paste) should suffice in either case:
php -S localhost:8000
- NOTE - see wikipedia article List of TCP and UDP port numbers for an explanation of localhost port number i.e. localhost:
8000
. - NOTE - will be a bit buggy in GitHub Codespaces.
Once the app starts:
- Select the top dropdown to select folder nested in parse i.e.
parse/gcode
.- If print profiles to compare are in root of
parse
no need to select from top dropdown.
- If print profiles to compare are in root of
- From the bottom 4 dropdown select the print profile to view.
- To compare profiles select more than one and click Show Difference.
- NOTE - this will only work if the files were derived from same slicer and same number of properties.
On recent Mac OS and Linux like machines all the packages needed to start a localhost should be installed. On Windows - some additional installs will be needed:
cygwin
php
git
- optionalchocolatey
- optional
The below will be needed to get a localhost up and running on Windows.
-
Windows 10 or later.
-
Cygwin packages for Windows. To install either:
- Visit the cygwin site for installation instructions.
- Or copy/paste below into terminal:
winget install Cygwin.Cygwin
- PHP installed on Windows. To install either:
- Visit the php site for installation instructions.
- Or follow the steps below:
- ONE - install chocolatey:
winget install Chocolatey.Chocolatey
- TWO - from an elevated shell (comman line as admin) run:
choco install php
- THREE - start a new terminal and ensure php was installed:
php --version
- If something like
PHP 8.1.0 (cli) (built: Nov 23 2021 21:46:10) (NTS Visual C++ 2019 x64)
appears, then you should be good to go.
- Clone the repo using
git
(if it is installed go to step 5), or download the zip file for this template repo.- If git is NOT installed:
- Visit the git for windows site for installation instructions.
- Or follow the steps below:
winget install Microsoft.Git
- Start a new terminal and ensure git was installed:
git --version
- If something like
git version 2.46.0.windows.1
appears, then you should be good to go.
- If git is installed:
- NOTE - if installed using above instructions, start a new terminal.
- Copy/paste below to download this template repo:
git clone https://github.com/jhauga/compare-3dprint-profiles.git
- Navigate to where this template repo was downloaded and start a local host.
cd compare-3dprint-profiles
php -S localhost:8000