Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into external_perimeter_…
Browse files Browse the repository at this point in the history
…fan_speed
  • Loading branch information
jschuh committed Oct 17, 2020
2 parents c40da0d + 7b19e75 commit b5d0b39
Show file tree
Hide file tree
Showing 197 changed files with 9,296 additions and 3,279 deletions.
77 changes: 39 additions & 38 deletions deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,53 +152,54 @@ include(MPFR/MPFR.cmake)
include(CGAL/CGAL.cmake)
include(wxWidgets/wxWidgets.cmake)

if (ZLIB_PKG)
if (NOT "${ZLIB_PKG}" STREQUAL "")
add_dependencies(dep_blosc ${ZLIB_PKG})
add_dependencies(dep_openexr ${ZLIB_PKG})
endif ()

if (MSVC)

add_custom_target(deps ALL
DEPENDS
dep_boost
dep_tbb
dep_libcurl
dep_wxWidgets
dep_gtest
dep_cereal
dep_nlopt
# dep_qhull # Experimental
dep_openvdb
dep_OpenCSG
dep_CGAL
${PNG_PKG}
${ZLIB_PKG}
${EXPAT_PKG}
set(_dep_list
dep_boost
dep_tbb
dep_libcurl
dep_wxWidgets
dep_gtest
dep_cereal
dep_nlopt
dep_openvdb
dep_OpenCSG
dep_CGAL
${PNG_PKG}
${ZLIB_PKG}
${EXPAT_PKG}
)

else()

add_custom_target(deps ALL
DEPENDS
dep_boost
dep_tbb
dep_libcurl
dep_wxWidgets
dep_gtest
dep_cereal
dep_nlopt
dep_qhull
dep_openvdb
dep_OpenCSG
dep_CGAL
${PNG_PKG}
${ZLIB_PKG}
${EXPAT_PKG}
# dep_libigl # Not working, static build has different Eigen
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
# Patch the boost::polygon library with a custom one.
ExternalProject_Add(dep_boost_polygon
EXCLUDE_FROM_ALL ON
GIT_REPOSITORY "https://github.com/prusa3d/polygon"
GIT_TAG prusaslicer_gmp
DEPENDS dep_boost
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_BINARY_DIR}/dep_boost_polygon-prefix/src/dep_boost_polygon/include/boost/polygon"
"${DESTDIR}/usr/local/include/boost/polygon"
)
# Only override boost::Polygon Voronoi implementation with Vojtech's GMP hacks on 64bit platforms.
list(APPEND _dep_list "dep_boost_polygon")
endif ()

if (MSVC)
# Experimental
#list(APPEND _dep_list "dep_qhull")
else()
list(APPEND _dep_list "dep_qhull")
# Not working, static build has different Eigen
#list(APPEND _dep_list "dep_libigl")
endif()

add_custom_target(deps ALL DEPENDS ${_dep_list})

# Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands
# because they seem to generate bogus build files (possibly a bug in ExternalProject).
2 changes: 2 additions & 0 deletions deps/deps-macos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ set(DEP_CMAKE_OPTS
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEP_OSX_TARGET}"
"-DCMAKE_CXX_FLAGS=${DEP_WERRORS_SDK}"
"-DCMAKE_C_FLAGS=${DEP_WERRORS_SDK}"
"-DCMAKE_FIND_FRAMEWORK=LAST"
"-DCMAKE_FIND_APPBUNDLE=LAST"
)

include("deps-unix-common.cmake")
Expand Down
Binary file added resources/icons/Pmetal_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions resources/icons/cog_.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions resources/icons/white/dot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions resources/icons/white/drop_to_bed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions resources/icons/white/edit_uni.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions resources/icons/white/eye_closed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions resources/icons/white/eye_open.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions resources/icons/white/lock_closed_f.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/icons/white/search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion resources/shaders/gouraud.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ struct SlopeDetection
uniform vec4 uniform_color;
uniform SlopeDetection slope;

uniform sampler2D environment_tex;
uniform bool use_environment_tex;

varying vec3 clipping_planes_dots;

// x = tainted, y = specular;
Expand All @@ -26,6 +29,7 @@ varying vec3 delta_box_min;
varying vec3 delta_box_max;

varying float world_normal_z;
varying vec3 eye_normal;

vec3 slope_color()
{
Expand All @@ -40,5 +44,8 @@ void main()
vec3 color = slope.actived ? slope_color() : uniform_color.rgb;
// if the fragment is outside the print volume -> use darker color
color = (any(lessThan(delta_box_min, ZERO)) || any(greaterThan(delta_box_max, ZERO))) ? mix(color, ZERO, 0.3333) : color;
gl_FragColor = vec4(vec3(intensity.y, intensity.y, intensity.y) + color * intensity.x, uniform_color.a);
if (use_environment_tex)
gl_FragColor = vec4(0.45 * texture2D(environment_tex, normalize(eye_normal).xy * 0.5 + 0.5).xyz + 0.8 * color * intensity.x, uniform_color.a);
else
gl_FragColor = vec4(vec3(intensity.y) + color * intensity.x, uniform_color.a);
}
9 changes: 5 additions & 4 deletions resources/shaders/gouraud.vs
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,23 @@ varying vec3 delta_box_max;
varying vec3 clipping_planes_dots;

varying float world_normal_z;
varying vec3 eye_normal;

void main()
{
// First transform the normal into camera space and normalize the result.
vec3 normal = normalize(gl_NormalMatrix * gl_Normal);
eye_normal = normalize(gl_NormalMatrix * gl_Normal);

// Compute the cos of the angle between the normal and lights direction. The light is directional so the direction is constant for every vertex.
// Since these two are normalized the cosine is the dot product. We also need to clamp the result to the [0,1] range.
float NdotL = max(dot(normal, LIGHT_TOP_DIR), 0.0);
float NdotL = max(dot(eye_normal, LIGHT_TOP_DIR), 0.0);

intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
vec3 position = (gl_ModelViewMatrix * gl_Vertex).xyz;
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS);
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position), reflect(-LIGHT_TOP_DIR, eye_normal)), 0.0), LIGHT_TOP_SHININESS);

// Perform the same lighting calculation for the 2nd light source (no specular applied).
NdotL = max(dot(normal, LIGHT_FRONT_DIR), 0.0);
NdotL = max(dot(eye_normal, LIGHT_FRONT_DIR), 0.0);
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;

// compute deltas for out of print volume detection (world coordinates)
Expand Down
1 change: 1 addition & 0 deletions sandboxes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
#add_subdirectory(openvdb)
add_subdirectory(meshboolean)
add_subdirectory(opencsg)
#add_subdirectory(aabb-evaluation)
2 changes: 2 additions & 0 deletions sandboxes/aabb-evaluation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_executable(aabb-evaluation aabb-evaluation.cpp)
target_link_libraries(aabb-evaluation libslic3r ${Boost_LIBRARIES} ${TBB_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS})
Loading

0 comments on commit b5d0b39

Please sign in to comment.