Skip to content

Commit

Permalink
Merge branch 'merill-merge'
Browse files Browse the repository at this point in the history
  • Loading branch information
remi durand committed Jun 5, 2021
2 parents d2dc7c3 + be9d6f5 commit 2d8d247
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 59 deletions.
11 changes: 7 additions & 4 deletions BuildLinux.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

export ROOT=`pwd`
export NCORES=`sysctl -n hw.ncpu`
export NCORES=`nproc --all`

while getopts ":ih" opt; do
case ${opt} in
Expand Down Expand Up @@ -43,7 +43,6 @@ echo -n "[1/9] Updating submodules..."
popd
} > $ROOT/build/Build.log # Capture all command output


echo -n "[2/9] Changing date in version..."
{
# change date in version
Expand Down Expand Up @@ -108,12 +107,16 @@ echo -n "[8/9] Building Slic3r..."
} &> $ROOT/build/Build.log # Capture all command output
echo "done"

# Give proper permissions to script
chmod 755 $ROOT/build/src/BuildLinuxImage.sh

echo -n "[9/9] Generating Linux app..."
{
if [[ -n "$BUILD_IMAGE" ]]
then
$ROOT/build/BuildLinuxImage.sh -i
$ROOT/build/src/BuildLinuxImage.sh -i
else
$ROOT/build/BuildLinuxImage.sh
$ROOT/build/src/BuildLinuxImage.sh
fi
} &> $ROOT/build/Build.log # Capture all command output
echo "done"
15 changes: 13 additions & 2 deletions BuildMacOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

export ROOT=`pwd`
export NCORES=`sysctl -n hw.ncpu`
export CMAKE_INSTALLED=`which cmake`

# Check if CMake is installed
if [[ -z "$CMAKE_INSTALLED" ]]
then
echo "Can't find CMake. Either is not installed or not in the PATH. Aborting!"
exit -1
fi

while getopts ":ih" opt; do
case ${opt} in
Expand Down Expand Up @@ -94,9 +102,12 @@ echo -n "[8/9] Building Slic3r..."
} &> $ROOT/build/Build.log # Capture all command output
echo "done"

# Give proper permissions to script
chmod 755 $ROOT/build/src/BuildMacOSImage.sh

if [[ -n "$BUILD_IMAGE" ]]
then
$ROOT/build/BuildMacOSImage.sh -i
$ROOT/build/src/BuildMacOSImage.sh -i
else
$ROOT/build/BuildMacOSImage.sh
$ROOT/build/src/BuildMacOSImage.sh
fi
5 changes: 4 additions & 1 deletion resources/ui_layout/printer_fff.ui
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ group:silent_mode_event:Firmware
setting:gcode_flavor
setting:silent_mode
setting:remaining_times
setting:gcode_precision_xyz
line:Gcode precision
setting:gcode_precision_xyz
setting:gcode_precision_e
end_line
group:Cooling fan
line:Speedup
setting:label$Speedup time:fan_speedup_time
Expand Down
16 changes: 8 additions & 8 deletions src/libslic3r/GCode/GCodeProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
#if ENABLE_VOLUMETRIC_EXTRUSION_PROCESSING
float filament_diameter = (static_cast<size_t>(m_extruder_id) < m_filament_diameters.size()) ? m_filament_diameters[m_extruder_id] : m_filament_diameters.back();
float filament_radius = 0.5f * filament_diameter;
float area_filament_cross_section = static_cast<float>(M_PI) * sqr(filament_radius);
double area_filament_cross_section = M_PI * sqr(filament_radius);
auto absolute_position = [this, area_filament_cross_section](Axis axis, const GCodeReader::GCodeLine& lineG1) {
#else
auto absolute_position = [this](Axis axis, const GCodeReader::GCodeLine& lineG1) {
Expand Down Expand Up @@ -1853,7 +1853,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
m_feedrate = line.f() * MMMIN_TO_MMSEC;

// calculates movement deltas
float max_abs_delta = 0.0f;
double max_abs_delta = 0.0f;
AxisCoords delta_pos;
for (unsigned char a = X; a <= E; ++a) {
delta_pos[a] = m_end_position[a] - m_start_position[a];
Expand All @@ -1869,14 +1869,14 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
type = EMoveType::Travel;

if (type == EMoveType::Extrude) {
float delta_xyz = std::sqrt(sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z]));
double delta_xyz = std::sqrt(sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z]));
#if !ENABLE_VOLUMETRIC_EXTRUSION_PROCESSING
float filament_diameter = (static_cast<size_t>(m_extruder_id) < m_filament_diameters.size()) ? m_filament_diameters[m_extruder_id] : m_filament_diameters.back();
float filament_radius = 0.5f * filament_diameter;
float area_filament_cross_section = static_cast<float>(M_PI) * sqr(filament_radius);
double area_filament_cross_section = static_cast<float>(M_PI) * sqr(filament_radius);
#endif // !ENABLE_VOLUMETRIC_EXTRUSION_PROCESSING
float volume_extruded_filament = area_filament_cross_section * delta_pos[E];
float area_toolpath_cross_section = volume_extruded_filament / delta_xyz;
double volume_extruded_filament = area_filament_cross_section * delta_pos[E];
double area_toolpath_cross_section = volume_extruded_filament / delta_xyz;

// volume extruded filament / tool displacement = area toolpath cross section
m_mm3_per_mm = area_toolpath_cross_section;
Expand Down Expand Up @@ -1977,15 +1977,15 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
block.layer_id = m_layer_id;

// calculates block cruise feedrate
float min_feedrate_factor = 1.0f;
double min_feedrate_factor = 1.0f;
for (unsigned char a = X; a <= E; ++a) {
curr.axis_feedrate[a] = curr.feedrate * delta_pos[a] * inv_distance;
if (a == E)
curr.axis_feedrate[a] *= machine.extrude_factor_override_percentage;

curr.abs_axis_feedrate[a] = std::abs(curr.axis_feedrate[a]);
if (curr.abs_axis_feedrate[a] != 0.0f) {
float axis_max_feedrate = get_axis_max_feedrate(static_cast<PrintEstimatedTimeStatistics::ETimeMode>(i), static_cast<Axis>(a));
double axis_max_feedrate = get_axis_max_feedrate(static_cast<PrintEstimatedTimeStatistics::ETimeMode>(i), static_cast<Axis>(a));
if (axis_max_feedrate != 0.0f)
min_feedrate_factor = std::min(min_feedrate_factor, axis_max_feedrate / curr.abs_axis_feedrate[a]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/GCode/GCodeProcessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace Slic3r {
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING

private:
using AxisCoords = std::array<float, 4>;
using AxisCoords = std::array<double, 4>;
using ExtruderColors = std::vector<unsigned char>;

enum class EUnits : unsigned char
Expand Down
4 changes: 2 additions & 2 deletions src/platform/osx/BuildMacOSImage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ echo -n "[9/9] Generating MacOS app..."
# copy bin and do not let it lower case
cp -f src/@SLIC3R_APP_CMD@ pack/@SLIC3R_APP_KEY@/@[email protected]/Contents/MacOS/@SLIC3R_APP_KEY@
chmod u+x pack/@SLIC3R_APP_KEY@/@[email protected]/Contents/MacOS/@SLIC3R_APP_KEY@
} &> $ROOT/build/MacOS_Build.log # Capture all command output
} &> $ROOT/Build.log # Capture all command output
echo "done"

if [[ -n "$BUILD_IMAGE" ]]
Expand All @@ -58,6 +58,6 @@ echo -n "Creating DMG Image for distribution..."
hdiutil create -ov -fs HFS+ -volname "@SLIC3R_APP_KEY@" -srcfolder "pack/@SLIC3R_APP_KEY@" temp.dmg
hdiutil convert temp.dmg -format UDZO -o @[email protected]
popd
} &> $ROOT/build/MacOS_Build.log # Capture all command output
} &> $ROOT/Build.log # Capture all command output
echo "done"
fi
10 changes: 5 additions & 5 deletions src/platform/unix/BuildLinuxImage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ while getopts ":ih" opt; do
export BUILD_IMAGE="1"
;;
h ) echo "Usage: ./BuildLinuxImage.sh [-i]"
echo " -i: Generate DMG image (optional)"
echo " -i: Generate Appimage (optional)"
exit 0
;;
esac
done

echo -n "[9/9] Generating MacOS app..."
echo -n "[9/9] Generating Linux app..."
{

# create directory and copy into it
Expand All @@ -25,7 +25,7 @@ echo -n "[9/9] Generating MacOS app..."
fi
mkdir package
mkdir package/bin

# copy Resources
cp -Rf ../resources package/resources
cp -f src/@SLIC3R_APP_CMD@ package/bin/@SLIC3R_APP_CMD@
Expand All @@ -34,7 +34,7 @@ echo -n "[9/9] Generating MacOS app..."
echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/@SLIC3R_APP_CMD@" "$@"' >@SLIC3R_APP_CMD@
chmod u+x @SLIC3R_APP_CMD@
tar -cvf ../@[email protected] .
} &> $ROOT/build/MacOS_Build.log # Capture all command output
} &> $ROOT/Build.log # Capture all command output
echo "done"

if [[ -n "$BUILD_IMAGE" ]]
Expand All @@ -43,6 +43,6 @@ echo -n "Creating Appimage for distribution..."
{
chmod +x ../build_appimage.sh
../build_appimage.sh
} &> $ROOT/build/MacOS_Build.log # Capture all command output
} &> $ROOT/Build.log # Capture all command output
echo "done"
fi
Loading

0 comments on commit 2d8d247

Please sign in to comment.