Merge remote-tracking branch 'PRIVATE/master' into ys_cut

This commit is contained in:
YuSanka 2022-09-08 13:32:14 +02:00
commit 484eae7a1c
229 changed files with 25931 additions and 20729 deletions
CMakeLists.txt
deps/OCCT
doc
resources
sandboxes/aabb-evaluation
src

View file

@ -27,7 +27,6 @@ option(SLIC3R_STATIC "Compile PrusaSlicer with static libraries (Boost, TBB,
option(SLIC3R_GUI "Compile PrusaSlicer with GUI components (OpenGL, wxWidgets)" 1)
option(SLIC3R_FHS "Assume PrusaSlicer is to be installed in a FHS directory structure" 0)
option(SLIC3R_WX_STABLE "Build against wxWidgets stable (3.0) as oppsed to dev (3.1) on Linux" 0)
option(SLIC3R_PROFILE "Compile PrusaSlicer with an invasive Shiny profiler" 0)
option(SLIC3R_PCH "Use precompiled headers" 1)
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
@ -336,25 +335,6 @@ add_definitions(-DwxUSE_UNICODE -D_UNICODE -DUNICODE -DWXINTL_NO_GETTEXT_MACRO)
# Disable unsafe implicit wxString to const char* / std::string and vice versa. This implicit conversion breaks the UTF-8 encoding quite often.
add_definitions(-DwxNO_UNSAFE_WXSTRING_CONV)
if (SLIC3R_PROFILE)
message("PrusaSlicer will be built with a Shiny invasive profiler")
add_definitions(-DSLIC3R_PROFILE)
endif ()
# Disable optimization even with debugging on.
if (0)
message(STATUS "Perl compiled without optimization. Disabling optimization for the PrusaSlicer build.")
message("Old CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
message("Old CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELEASE}")
message("Old CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASE "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
set(CMAKE_C_FLAGS_RELEASE "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
set(CMAKE_CXX_FLAGS "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
set(CMAKE_C_FLAGS "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
endif()
# Find and configure boost
if(SLIC3R_STATIC)
# Use static boost libraries.

View file

@ -3,6 +3,7 @@ prusaslicer_add_cmake_project(OCCT
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_2.zip
URL_HASH SHA256=c696b923593e8c18d059709717dbf155b3e72fdd283c8522047a790ec3a432c5
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/occt_toolkit.cmake ./adm/cmake/
CMAKE_ARGS
-DINSTALL_DIR_LAYOUT=Unix # LMBBS
-DBUILD_LIBRARY_TYPE=Static
@ -20,3 +21,7 @@ prusaslicer_add_cmake_project(OCCT
-DBUILD_MODULE_ModelingData=OFF
-DBUILD_MODULE_Visualization=OFF
)
if (MSVC)
add_debug_dep(dep_OCCT)
endif ()

453
deps/OCCT/occt_toolkit.cmake vendored Normal file
View file

@ -0,0 +1,453 @@
# script for each OCCT toolkit
# filling some variables by default values(src) or using custom(tools, samples)
set (RELATIVE_SOURCES_DIR "${RELATIVE_DIR}")
if ("${RELATIVE_SOURCES_DIR}" STREQUAL "")
#if it is not defined, use default directory
set (RELATIVE_SOURCES_DIR "src")
endif()
set (OCC_MODULES_LIST "${MODULES_LIST}")
if ("${OCC_MODULES_LIST}" STREQUAL "")
set (OCC_MODULES_LIST ${OCCT_MODULES})
endif()
set (OCC_TARGET_FOLDER "${TARGET_FOLDER}")
if ("${OCC_TARGET_FOLDER}" STREQUAL "")
set (OCC_TARGET_FOLDER "Modules")
endif()
set (OCCT_TOOLKITS_NAME_SUFFIX "${TOOLKITS_NAME_SUFFIX}")
if ("${OCCT_TOOLKITS_NAME_SUFFIX}" STREQUAL "")
set (OCCT_TOOLKITS_NAME_SUFFIX "TOOLKITS")
endif()
# parse PACKAGES file
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
if ("${USED_PACKAGES}" STREQUAL "")
set (USED_PACKAGES ${PROJECT_NAME})
endif()
if (USE_QT)
# Qt dependencies
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/qt_macro)
FIND_QT_PACKAGE(PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
include_directories("${PROJECT_INCLUDES}")
endif(USE_QT)
set (PRECOMPILED_DEFS)
if (NOT BUILD_SHARED_LIBS)
list (APPEND PRECOMPILED_DEFS "-DOCCT_NO_PLUGINS")
if (WIN32 AND NOT EXECUTABLE_PROJECT)
list (APPEND PRECOMPILED_DEFS "-DOCCT_STATIC_BUILD")
endif()
endif()
# Get all used packages from toolkit
UNSET(RESOURCE_FILES)
foreach (OCCT_PACKAGE ${USED_PACKAGES})
#remove part after "/" in the OCCT_PACKAGE variable if exists
string (FIND "${OCCT_PACKAGE}" "/" _index)
if (_index GREATER -1)
math (EXPR _index "${_index}")
string (SUBSTRING "${OCCT_PACKAGE}" 0 ${_index} OCCT_PACKAGE_NAME)
else()
set (OCCT_PACKAGE_NAME "${OCCT_PACKAGE}")
endif()
if (WIN32)
list (APPEND PRECOMPILED_DEFS "-D__${OCCT_PACKAGE_NAME}_DLL")
endif()
set (SOURCE_FILES)
set (HEADER_FILES)
# Generate Flex and Bison files
if (${BUILD_YACCLEX})
# flex files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
# bison files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]yacc" SOURCE_FILES_BISON)
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
if (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0)
list (SORT SOURCE_FILES_FLEX)
list (SORT SOURCE_FILES_BISON)
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
if (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL})
# Note: files are generated in original source directory (not in patch!)
set (FLEX_BISON_TARGET_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}")
# choose appropriate extension for generated files: "cxx" if source file contains
# instruction to generate C++ code, "c" otherwise
set (BISON_OUTPUT_FILE_EXT "c")
set (FLEX_OUTPUT_FILE_EXT "c")
file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT)
foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT})
string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE})
if (CXX_BISON_LANGUAGE_FOUND)
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
file (STRINGS "${CURRENT_FLEX_FILE}" FILE_FLEX_CONTENT)
foreach (FILE_FLEX_CONTENT_LINE ${FILE_FLEX_CONTENT})
string (REGEX MATCH "%option c\\+\\+" CXX_FLEX_LANGUAGE_FOUND ${FILE_FLEX_CONTENT_LINE})
if (CXX_FLEX_LANGUAGE_FOUND)
set (FLEX_OUTPUT_FILE_EXT "cxx")
# install copy of FlexLexer.h locally to allow further building without flex
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${FLEX_BISON_TARGET_DIR}/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
endif()
endif()
endforeach()
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.${FLEX_OUTPUT_FILE_EXT})
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} "${FLEX_BISON_TARGET_DIR}/${BISON_OUTPUT_FILE}"
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/=")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} "${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}"
COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})
endif()
endforeach()
endif()
endif()
# header files
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
else()
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
endif()
list (APPEND HEADER_FILES ${HEADER_FILES_M} ${HEADER_FILES_LXX} ${SOURCE_FILES_GXX})
list (APPEND SOURCE_FILES ${SOURCE_FILES_C})
if(APPLE)
list (APPEND SOURCE_FILES ${SOURCE_FILES_M})
endif()
foreach(HEADER_FILE ${HEADER_FILES})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
list (APPEND USED_INCFILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
else()
list (APPEND USED_INCFILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
endif()
endforeach()
foreach(SOURCE_FILE ${SOURCE_FILES})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
list (APPEND USED_SRCFILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
else()
list (APPEND USED_SRCFILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
endif()
endforeach()
if (USE_QT)
FIND_AND_INSTALL_QT_RESOURCES (${OCCT_PACKAGE} RESOURCE_FILES)
#message("Qt Resource files are: ${QT_RESOURCE_FILES} in ${OCCT_PACKAGE}")
endif(USE_QT)
#message("Resource files are: ${RESOURCE_FILES} in ${OCCT_PACKAGE}")
foreach(RESOURCE_FILE ${RESOURCE_FILES})
SOURCE_GROUP ("Resource Files\\${OCCT_PACKAGE_NAME}" FILES "${RESOURCE_FILE}")
endforeach()
endforeach()
string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
set (USED_RCFILE "")
if (MSVC)
set (USED_RCFILE "${CMAKE_BINARY_DIR}/resources/${PROJECT_NAME}.rc")
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in")
configure_file("${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
else()
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
endif()
endif()
set (CURRENT_MODULE)
foreach (OCCT_MODULE ${OCC_MODULES_LIST})
list (FIND ${OCCT_MODULE}_${OCCT_TOOLKITS_NAME_SUFFIX} ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
if (NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
set (CURRENT_MODULE ${OCCT_MODULE})
endif()
endforeach()
if (MSVC)
OCCT_INSERT_CODE_FOR_TARGET ()
endif()
if (USE_QT)
FIND_AND_WRAP_MOC_FILES("${USED_INCFILES}" "${PROJECT_NAME}_MOC_FILES")
#message("MOC files: ${${PROJECT_NAME}_MOC_FILES}")
endif (USE_QT)
if (EXECUTABLE_PROJECT)
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
install (TARGETS ${PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
if (EMSCRIPTEN)
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
endif()
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (MSVC)
if (BUILD_FORCE_RelWithDebInfo)
set (aReleasePdbConf "Release")
else()
set (aReleasePdbConf)
endif()
# install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
# CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
# DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
endif()
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
set (CMAKE_SHARED_LIBRARY_SUFFIX_DEFAULT ${CMAKE_SHARED_LIBRARY_SUFFIX})
set (CMAKE_SHARED_LIBRARY_SUFFIX "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
install (TARGETS ${PROJECT_NAME}
EXPORT OpenCASCADE${CURRENT_MODULE}Targets
RUNTIME DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}"
ARCHIVE DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
if (NOT WIN32)
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
set (LINK_NAME "${INSTALL_DIR}/${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}/lib${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX_DEFAULT}")
set (LIBRARY_NAME "${INSTALL_DIR}/${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}/lib${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
OCCT_CREATE_SYMLINK_TO_FILE (${LIBRARY_NAME} ${LINK_NAME})
endif()
endif()
endif()
if (CURRENT_MODULE)
set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER "${OCC_TARGET_FOLDER}/${CURRENT_MODULE}")
set_target_properties (${PROJECT_NAME} PROPERTIES MODULE "${CURRENT_MODULE}")
if (APPLE)
if (NOT "${INSTALL_NAME_DIR}" STREQUAL "")
set_target_properties (${PROJECT_NAME} PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "${INSTALL_NAME_DIR}")
endif()
endif()
endif()
get_property (OCC_VERSION_MAJOR GLOBAL PROPERTY OCC_VERSION_MAJOR)
get_property (OCC_VERSION_MINOR GLOBAL PROPERTY OCC_VERSION_MINOR)
get_property (OCC_VERSION_MAINTENANCE GLOBAL PROPERTY OCC_VERSION_MAINTENANCE)
if (ANDROID)
# do not append version to the filename
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
else()
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
SOVERSION "${OCC_VERSION_MAJOR}"
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
endif()
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
# parse EXTERNLIB file
if (CUSTOM_EXTERNLIB)
set (USED_EXTERNLIB_AND_TOOLKITS ${CUSTOM_EXTERNLIB})
else()
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
endif()
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
if (NOT COMMENT_FOUND)
string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM})
string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM})
if (NOT "${TK_FOUND}" STREQUAL "" OR NOT "${VTK_FOUND}" STREQUAL "")
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
if (NOT "${VTK_FOUND}" STREQUAL "" AND BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK)
OCCT_INSTALL_VTK(${USED_ITEM})
endif()
else()
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
if ("${CSF_FOUND}" STREQUAL "")
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlLibs")
add_definitions (-DHAVE_OPENGL)
endif()
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlesLibs")
add_definitions (-DHAVE_GLES2)
endif()
set (LIBRARY_FROM_CACHE 0)
separate_arguments (CURRENT_CSF)
foreach (CSF_LIBRARY ${CURRENT_CSF})
string (TOLOWER "${CSF_LIBRARY}" CSF_LIBRARY)
string (REPLACE "+" "[+]" CSF_LIBRARY "${CSF_LIBRARY}")
string (REPLACE "." "" CSF_LIBRARY "${CSF_LIBRARY}")
get_cmake_property(ALL_CACHE_VARIABLES CACHE_VARIABLES)
string (REGEX MATCHALL "(^|;)3RDPARTY_[^;]+_LIBRARY[^;]*" ALL_CACHE_VARIABLES "${ALL_CACHE_VARIABLES}")
foreach (CACHE_VARIABLE ${ALL_CACHE_VARIABLES})
set (CURRENT_CACHE_LIBRARY ${${CACHE_VARIABLE}})
string (TOLOWER "${CACHE_VARIABLE}" CACHE_VARIABLE)
if (EXISTS "${CURRENT_CACHE_LIBRARY}" AND NOT IS_DIRECTORY "${CURRENT_CACHE_LIBRARY}")
string (REGEX MATCH "_${CSF_LIBRARY}$" IS_ENDING "${CACHE_VARIABLE}")
string (REGEX MATCH "^([a-z]+)" CSF_WO_VERSION "${CSF_LIBRARY}")
string (REGEX MATCH "_${CSF_WO_VERSION}$" IS_ENDING_WO_VERSION "${CACHE_VARIABLE}")
if ("3rdparty_${CSF_LIBRARY}_library" STREQUAL "${CACHE_VARIABLE}" OR
"3rdparty_${CSF_WO_VERSION}_library" STREQUAL "${CACHE_VARIABLE}" OR
NOT "x${IS_ENDING}" STREQUAL "x" OR
NOT "x${IS_ENDING_WO_VERSION}" STREQUAL "x")
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT "${CURRENT_CACHE_LIBRARY}")
set (LIBRARY_FROM_CACHE 1)
endif()
endif()
endforeach()
endforeach()
if (NOT ${LIBRARY_FROM_CACHE})
# prepare a list from a string with whitespaces
separate_arguments (CURRENT_CSF)
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
endif()
endif()
endif()
endif()
endif()
endforeach()
if (APPLE)
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
if (NOT ${IS_X11_FOUND} EQUAL -1)
find_package (X11 COMPONENTS X11)
if (NOT X11_FOUND)
message (STATUS "Warning: X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org")
endif()
endif()
endif()
# Update list of used VTK libraries if OpenGL2 Rendering BackEnd is used.
# Add VTK_OPENGL2_BACKEND definition.
if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2" OR IS_VTK_9XX)
add_definitions(-DVTK_OPENGL2_BACKEND)
foreach (VTK_EXCLUDE_LIBRARY vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL)
list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "${VTK_EXCLUDE_LIBRARY}" IS_VTK_OPENGL_FOUND)
if (NOT ${IS_VTK_OPENGL_FOUND} EQUAL -1)
list (REMOVE_ITEM USED_TOOLKITS_BY_CURRENT_PROJECT ${VTK_EXCLUDE_LIBRARY})
if (${VTK_EXCLUDE_LIBRARY} STREQUAL vtkRenderingOpenGL)
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT vtkRenderingOpenGL2)
if(VTK_MAJOR_VERSION GREATER 6)
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT vtkRenderingGL2PSOpenGL2)
endif()
endif()
endif()
endforeach()
else()
if(VTK_MAJOR_VERSION EQUAL 6 AND VTK_MINOR_VERSION GREATER 2 OR VTK_MAJOR_VERSION GREATER 6)
list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "vtkRenderingFreeTypeOpenGL" IS_VTK_RENDER_FREETYPE_FOUND)
if (NOT ${IS_VTK_RENDER_FREETYPE_FOUND} EQUAL -1)
list (REMOVE_ITEM USED_TOOLKITS_BY_CURRENT_PROJECT "vtkRenderingFreeTypeOpenGL")
endif()
endif()
endif()
if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
endif()
if (USE_QT)
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})
target_link_libraries (${PROJECT_NAME} debug ${PROJECT_LIBRARY_DEBUG})
endforeach()
foreach (PROJECT_LIBRARY_RELEASE ${PROJECT_LIBRARIES_RELEASE})
target_link_libraries (${PROJECT_NAME} optimized ${PROJECT_LIBRARY_RELEASE})
endforeach()
endif()
# suppress deprecation warnings inside OCCT itself for old gcc versions with unavailable Standard_DISABLE_DEPRECATION_WARNINGS
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6.0)
add_definitions("-DOCCT_NO_DEPRECATED")
message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used")
endif()
endif()
# use Cotire to accelerate build via usage of precompiled headers
if (BUILD_USE_PCH)
if (WIN32)
# prevent definition of min and max macros through inclusion of Windows.h
# (for cotire builds)
add_definitions("-DNOMINMAX")
# avoid warnings on deprecated names from standard C library (see strsafe.h)
add_definitions("-DSTRSAFE_NO_DEPRECATE")
# avoid "std::Equal1" warning in QANCollection_Stl.cxx in debug mode
# suggesting using msvc "Checked Iterators"
add_definitions("-D_SCL_SECURE_NO_WARNINGS")
endif()
# Exclude system-provided glext.h.
# These macros are already defined within OpenGl_GlFunctions.hxx,
# however we have to duplicate them here for building TKOpenGl with PCH.
add_definitions("-DGL_GLEXT_LEGACY")
add_definitions("-DGLX_GLXEXT_LEGACY")
# workaround for old gcc
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
add_definitions("-D__STDC_CONSTANT_MACROS")
add_definitions("-D__STDC_FORMAT_MACROS")
endif()
# unity builds are not used since they do not add speed but cause conflicts
# in TKV3d
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(${PROJECT_NAME})
endif()

View file

@ -24,7 +24,6 @@
* miniz: No packages, author suggests using in the source tree
* qhull: libqhull-dev does not contain libqhullcpp => link errors. Until it is fixed, we will use the builtin version. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925540
* semver: One module C library, author expects to use clib for installation. No packages.
* Shiny: no packages
## Header only
* igl

4
resources/icons/edit.svg Normal file
View file

@ -0,0 +1,4 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M38.2923 1.34808L38.2441 1.30417C37.3235 0.463194 36.1301 0 34.8837 0C33.4864 0 32.1449 0.591489 31.2029 1.62267L13.3916 21.1224C13.2293 21.3002 13.1061 21.5099 13.03 21.7381L10.9357 28.0167C10.6935 28.7426 10.815 29.5453 11.2607 30.164C11.7099 30.7875 12.4336 31.1598 13.1967 31.1598H13.1968C13.5269 31.1598 13.8495 31.0919 14.1555 30.958L20.2195 28.3052C20.44 28.2087 20.6377 28.0671 20.8 27.8894L38.6114 8.38977C40.4648 6.36078 40.3219 3.20211 38.2923 1.34808ZM14.9484 26.8569L16.1773 23.1726L16.281 23.0591L18.6102 25.1866L18.5066 25.3001L14.9484 26.8569ZM36.0718 6.07002L20.93 22.6472L18.6007 20.5197L33.7426 3.94242C34.0387 3.61819 34.444 3.43956 34.8838 3.43956C35.2696 3.43956 35.6391 3.5831 35.9251 3.84428L35.9731 3.88819C36.6019 4.46248 36.6461 5.44127 36.0718 6.07002V6.07002Z" fill="#ED6B21"/>
<path d="M34.8369 15.8664C33.8871 15.8664 33.1171 16.6364 33.1171 17.5862V32.1868C33.1171 34.5984 31.155 36.5604 28.7435 36.5604H7.89985C5.48815 36.5604 3.52623 34.5984 3.52623 32.1868V11.5125C3.52623 9.10094 5.48826 7.1389 7.89985 7.1389H22.9865C23.9363 7.1389 24.7063 6.3689 24.7063 5.41912C24.7063 4.46934 23.9363 3.69934 22.9865 3.69934H7.89985C3.59158 3.69934 0.0866699 7.20437 0.0866699 11.5125V32.1867C0.0866699 36.4949 3.59169 39.9999 7.89985 39.9999H28.7433C33.0515 39.9999 36.5565 36.4949 36.5565 32.1867V17.5862C36.5566 16.6364 35.7866 15.8664 34.8369 15.8664V15.8664Z" fill="#808080"/>
</svg>

After

(image error) Size: 1.5 KiB

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2135,8 +2135,8 @@ msgid "Choose one or more files (STL, OBJ):"
msgstr "Vyberte jeden nebo více souborů (STL, OBJ):"
#: src/slic3r/GUI/GUI_App.cpp:1870
msgid "Choose one or more files (STL/OBJ/AMF/3MF/PRUSA):"
msgstr "Vyberte jeden nebo více souborů (STL/OBJ/AMF/3MF/PRUSA):"
msgid "Choose one or more files (STL/3MF/STEP/OBJ/AMF/PRUSA):"
msgstr "Vyberte jeden nebo více souborů (STL/3MF/STEP/OBJ/AMF/PRUSA):"
#: src/slic3r/GUI/ConfigWizard.cpp:1361
msgid "Choose the type of firmware used by your printer."
@ -6044,12 +6044,13 @@ msgid "Import STL (Imperial Units)"
msgstr "Importovat STL (imperiální jednotky)"
#: src/slic3r/GUI/MainFrame.cpp:1208
msgid "Import STL/OBJ/AM&F/3MF"
msgstr "Importovat STL/OBJ/AM&F/3MF"
msgid "Import STL/3MF/STEP/OBJ/AM&F"
msgstr "Importovat STL/3MF/STEP/OBJ/AM&F"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:83
msgid "Import STL/OBJ/AMF/3MF without config, keep plater"
msgstr "Importovat STL/OBJ/AMF/3MF bez konfigurace, zachová stávající podložku"
msgid "Import STL/3MF/STEP/OBJ/AMF without config, keep plater"
msgstr ""
"Importovat STL/3MF/STEP/OBJ/AMF bez konfigurace, zachová stávající podložku"
#: src/slic3r/GUI/Plater.cpp:5293
msgid "Import config only"
@ -8227,9 +8228,8 @@ msgid "Open new instance"
msgstr "Otevřít novou instanci"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:78
msgid "Open project STL/OBJ/AMF/3MF with config, clear plater"
msgstr ""
"Otevřít projekt STL/OBJ/AMF/3MF s konfigurací, odstranit modely na podložce"
msgid "Open project AMF/3MF with config, clear plater"
msgstr "Otevřít projekt AMF/3MF s konfigurací, odstranit modely na podložce"
#: src/slic3r/GUI/MainFrame.cpp:1082
#, c-format, boost-format

View file

@ -2130,8 +2130,8 @@ msgid "Choose one or more files (STL, OBJ):"
msgstr "Wählen Sie eine oder mehrere Dateien (STL, OBJ):"
#: src/slic3r/GUI/GUI_App.cpp:1870
msgid "Choose one or more files (STL/OBJ/AMF/3MF/PRUSA):"
msgstr "Wählen Sie eine oder mehrere Dateien (STL/OBJ/AMF/3MF/PRUSA):"
msgid "Choose one or more files (STL/3MF/STEP/OBJ/AMF/PRUSA):"
msgstr "Wählen Sie eine oder mehrere Dateien (STL/3MF/STEP/OBJ/AMF/PRUSA):"
#: src/slic3r/GUI/ConfigWizard.cpp:1361
msgid "Choose the type of firmware used by your printer."
@ -6141,13 +6141,13 @@ msgid "Import STL (Imperial Units)"
msgstr "STL importieren (imperiale Einheiten)"
#: src/slic3r/GUI/MainFrame.cpp:1208
msgid "Import STL/OBJ/AM&F/3MF"
msgstr "Importiere STL/OBJ/AM&F/3MF"
msgid "Import STL/3MF/STEP/OBJ/AM&F"
msgstr "Importiere STL/3MF/STEP/OBJ/AM&F"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:83
msgid "Import STL/OBJ/AMF/3MF without config, keep plater"
msgid "Import STL/3MF/STEP/OBJ/AMF without config, keep plater"
msgstr ""
"Importiere STL/OBJ/AMF/3MF mit Konfigurationsdaten, Druckplatte beibehalten"
"Importiere STL/3MF/STEP/OBJ/AMF mit Konfigurationsdaten, Druckplatte beibehalten"
#: src/slic3r/GUI/Plater.cpp:5293
msgid "Import config only"
@ -8357,8 +8357,8 @@ msgid "Open new instance"
msgstr "Neue Instanz öffnen"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:78
msgid "Open project STL/OBJ/AMF/3MF with config, clear plater"
msgstr "Öffne Projekt STL/OBJ/AMF/3MF mit Konfiguration, Druckplatte leeren"
msgid "Open project AMF/3MF with config, clear plater"
msgstr "Öffne Projekt AMF/3MF mit Konfiguration, Druckplatte leeren"
#: src/slic3r/GUI/MainFrame.cpp:1082
#, c-format, boost-format

File diff suppressed because it is too large Load diff

View file

@ -2115,8 +2115,8 @@ msgid "Choose one or more files (STL, OBJ):"
msgstr "Elije uno o varios archivos (STL, OBJ):"
#: src/slic3r/GUI/GUI_App.cpp:1870
msgid "Choose one or more files (STL/OBJ/AMF/3MF/PRUSA):"
msgstr "Escoje uno o más archivos (STL/OBJ/AMF/3MF/PRUSA):"
msgid "Choose one or more files (STL/3MF/STEP/OBJ/AMF/PRUSA):"
msgstr "Escoje uno o más archivos (STL/3MF/STEP/OBJ/AMF/PRUSA):"
#: src/slic3r/GUI/ConfigWizard.cpp:1361
msgid "Choose the type of firmware used by your printer."
@ -6096,12 +6096,12 @@ msgid "Import STL (Imperial Units)"
msgstr "Importar STL (Unidades Imperiales)"
#: src/slic3r/GUI/MainFrame.cpp:1208
msgid "Import STL/OBJ/AM&F/3MF"
msgstr "Importar STL/OBJ/AM&F/3MF"
msgid "Import STL/3MF/STEP/OBJ/AM&F"
msgstr "Importar STL/3MF/STEP/OBJ/AM&F"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:83
msgid "Import STL/OBJ/AMF/3MF without config, keep plater"
msgstr "Importar STL/OBJ/AMF/3MF sin configuración, mantener la base"
msgid "Import STL/3MF/STEP/OBJ/AMF without config, keep plater"
msgstr "Importar STL/3MF/STEP/OBJ/AMF sin configuración, mantener la base"
#: src/slic3r/GUI/Plater.cpp:5293
msgid "Import config only"
@ -8302,8 +8302,8 @@ msgid "Open new instance"
msgstr "Abrir instancia nueva"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:78
msgid "Open project STL/OBJ/AMF/3MF with config, clear plater"
msgstr "Abrir proyecto STL/OBJ/AMF/3MF con configuración, limpiar plataforma"
msgid "Open project AMF/3MF with config, clear plater"
msgstr "Abrir proyecto AMF/3MF con configuración, limpiar plataforma"
#: src/slic3r/GUI/MainFrame.cpp:1082
#, c-format, boost-format

View file

@ -2139,8 +2139,8 @@ msgid "Choose one or more files (STL, OBJ):"
msgstr "Choisissez un ou plusieurs fichiers (STL, OBJ) :"
#: src/slic3r/GUI/GUI_App.cpp:1870
msgid "Choose one or more files (STL/OBJ/AMF/3MF/PRUSA):"
msgstr "Choisir un ou plusieurs fichiers (STL/OBJ/AMF/3MF/PRUSA) :"
msgid "Choose one or more files (STL/3MF/STEP/OBJ/AMF/PRUSA):"
msgstr "Choisir un ou plusieurs fichiers (STL/3MF/STEP/OBJ/AMF/PRUSA) :"
#: src/slic3r/GUI/ConfigWizard.cpp:1361
msgid "Choose the type of firmware used by your printer."
@ -6155,12 +6155,12 @@ msgid "Import STL (Imperial Units)"
msgstr "Importer le STL (unités impériales)"
#: src/slic3r/GUI/MainFrame.cpp:1208
msgid "Import STL/OBJ/AM&F/3MF"
msgstr "Importer STL/OBJ/AM&F/3MF"
msgid "Import STL/3MF/STEP/OBJ/AM&F"
msgstr "Importer STL/3MF/STEP/OBJ/AM&F"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:83
msgid "Import STL/OBJ/AMF/3MF without config, keep plater"
msgstr "Importer un STL/OBJ/AMF/3MF sans configuration, conserver le plateau"
msgid "Import STL/3MF/STEP/OBJ/AMF without config, keep plater"
msgstr "Importer un STL/3MF/STEP/OBJ/AMF sans configuration, conserver le plateau"
#: src/slic3r/GUI/Plater.cpp:5293
msgid "Import config only"
@ -8375,9 +8375,8 @@ msgid "Open new instance"
msgstr "Ouvrir une nouvelle instance"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:78
msgid "Open project STL/OBJ/AMF/3MF with config, clear plater"
msgstr ""
"Ouvrir un projet STL/OBJ/AMF/3MF avec configuration, libérer le plateau"
msgid "Open project AMF/3MF with config, clear plater"
msgstr "Ouvrir un projet AMF/3MF avec configuration, libérer le plateau"
#: src/slic3r/GUI/MainFrame.cpp:1082
#, c-format, boost-format

File diff suppressed because it is too large Load diff

View file

@ -2119,8 +2119,8 @@ msgid "Choose one or more files (STL, OBJ):"
msgstr "Scegli uno o più file (STL, OBJ):"
#: src/slic3r/GUI/GUI_App.cpp:1870
msgid "Choose one or more files (STL/OBJ/AMF/3MF/PRUSA):"
msgstr "Seleziona uno o più file (STL/OBJ/AMF/3MF/PRUSA):"
msgid "Choose one or more files (STL/3MF/STEP/OBJ/AMF/PRUSA):"
msgstr "Seleziona uno o più file (STL/3MF/STEP/OBJ/AMF/PRUSA):"
#: src/slic3r/GUI/ConfigWizard.cpp:1361
msgid "Choose the type of firmware used by your printer."
@ -6091,12 +6091,12 @@ msgid "Import STL (Imperial Units)"
msgstr "Importa STL (unità imperiali)"
#: src/slic3r/GUI/MainFrame.cpp:1208
msgid "Import STL/OBJ/AM&F/3MF"
msgstr "Importa STL/OBJ/AM&F/3MF"
msgid "Import STL/3MF/STEP/OBJ/AM&F"
msgstr "Importa STL/3MF/STEP/OBJ/AM&F"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:83
msgid "Import STL/OBJ/AMF/3MF without config, keep plater"
msgstr "Importa STL/OBJ/AMF/3MF senza configurazione, mantieni piano"
msgid "Import STL/3MF/STEP/OBJ/AMF without config, keep plater"
msgstr "Importa STL/3MF/STEP/OBJ/AMF senza configurazione, mantieni piano"
#: src/slic3r/GUI/Plater.cpp:5293
msgid "Import config only"
@ -8294,8 +8294,8 @@ msgid "Open new instance"
msgstr "Apri una nuova istanza"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:78
msgid "Open project STL/OBJ/AMF/3MF with config, clear plater"
msgstr "Apri progetto STL/OBJ/AMF/3MF con configurazione, pulisci piano"
msgid "Open project AMF/3MF with config, clear plater"
msgstr "Apri progetto AMF/3MF con configurazione, pulisci piano"
#: src/slic3r/GUI/MainFrame.cpp:1082
#, c-format, boost-format

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2145,8 +2145,8 @@ msgid "Choose one or more files (STL, OBJ):"
msgstr "Wybierz jeden lub więcej plików (STL, OBJ):"
#: src/slic3r/GUI/GUI_App.cpp:1870
msgid "Choose one or more files (STL/OBJ/AMF/3MF/PRUSA):"
msgstr "Wybierz jeden lub więcej plików (STL/OBJ/AMF/3MF/PRUSA):"
msgid "Choose one or more files (STL/3MF/STEP/OBJ/AMF/PRUSA):"
msgstr "Wybierz jeden lub więcej plików (STL/3MF/STEP/OBJ/AMF/PRUSA):"
#: src/slic3r/GUI/ConfigWizard.cpp:1361
msgid "Choose the type of firmware used by your printer."
@ -6080,12 +6080,12 @@ msgid "Import STL (Imperial Units)"
msgstr "Import STL (jednostki imperialne)"
#: src/slic3r/GUI/MainFrame.cpp:1208
msgid "Import STL/OBJ/AM&F/3MF"
msgstr "Import STL/OBJ/AM&F/3MF"
msgid "Import STL/3MF/STEP/OBJ/AM&F"
msgstr "Import STL/3MF/STEP/OBJ/AM&F"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:83
msgid "Import STL/OBJ/AMF/3MF without config, keep plater"
msgstr "Otwórz STL/OBJ/AMF/3MF bez konfiguracji, zachowaj zawartość stołu"
msgid "Import STL/3MF/STEP/OBJ/AMF without config, keep plater"
msgstr "Otwórz STL/3MF/STEP/OBJ/AMF bez konfiguracji, zachowaj zawartość stołu"
#: src/slic3r/GUI/Plater.cpp:5293
msgid "Import config only"
@ -8279,8 +8279,8 @@ msgid "Open new instance"
msgstr "Otwórz nową instancję"
#: src/slic3r/GUI/KBShortcutsDialog.cpp:78
msgid "Open project STL/OBJ/AMF/3MF with config, clear plater"
msgstr "Otwórz projekt STL/OBJ/AMF/3MF z konfiguracją, wyczyść stół"
msgid "Open project AMF/3MF with config, clear plater"
msgstr "Otwórz projekt AMF/3MF z konfiguracją, wyczyść stół"
#: src/slic3r/GUI/MainFrame.cpp:1082
#, c-format, boost-format

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
min_slic3r_version = 2.5.0-alpha0
0.2.1 Added Ender 3 Neo and Ender 3 S1 Plus. Various updates.
0.2.0 Added alternative nozzle support
0.1.5 Added Ender-3 S1 Pro
min_slic3r_version = 2.4.1

View file

@ -5,7 +5,7 @@
name = Creality
# Configuration version of this file. Config file will only be installed, if the config_version differs.
# This means, the server may force the PrusaSlicer configuration to be downgraded.
config_version = 0.2.0
config_version = 0.2.1
# Where to get the updates from?
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/Creality/
# changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
@ -41,6 +41,15 @@ bed_model = ender3_bed.stl
bed_texture = ender3.svg
default_materials = Generic PLA @CREALITY; Generic PETG @CREALITY; Generic ABS @CREALITY; Creality PLA @CREALITY; Prusament PLA @CREALITY; Prusament PETG @CREALITY; AzureFilm PLA @CREALITY; Devil Design PLA @CREALITY; Devil Design PLA Matt @CREALITY; Devil Design PLA Galaxy @CREALITY; Extrudr PLA NX2 @CREALITY; Real Filament PLA @CREALITY; Velleman PLA @CREALITY; 3DJAKE ecoPLA @CREALITY; 3DJAKE ecoPLA Matt @CREALITY; 3DJAKE ecoPLA Tough @CREALITY; 123-3D Jupiter PLA @CREALITY; Verbatim PLA @CREALITY
[printer_model:ENDER3NEO]
name = Creality Ender-3 Neo
variants = 0.4; 0.3; 0.5; 0.6
technology = FFF
family = ENDER
bed_model = ender3_bed.stl
bed_texture = ender3.svg
default_materials = Generic PLA @CREALITY; Generic PETG @CREALITY; Generic ABS @CREALITY; Creality PLA @CREALITY; Prusament PLA @CREALITY; Prusament PETG @CREALITY; AzureFilm PLA @CREALITY; Devil Design PLA @CREALITY; Devil Design PLA Matt @CREALITY; Devil Design PLA Galaxy @CREALITY; Extrudr PLA NX2 @CREALITY; Real Filament PLA @CREALITY; Velleman PLA @CREALITY; 3DJAKE ecoPLA @CREALITY; 3DJAKE ecoPLA Matt @CREALITY; 3DJAKE ecoPLA Tough @CREALITY; 123-3D Jupiter PLA @CREALITY; Verbatim PLA @CREALITY
[printer_model:ENDER3V2]
name = Creality Ender-3 V2
variants = 0.4; 0.3; 0.5; 0.6
@ -77,6 +86,15 @@ bed_model = ender3v2_bed.stl
bed_texture = ender3v2.svg
default_materials = Generic PLA @CREALITY; Generic PETG @CREALITY; Generic ABS @CREALITY; Creality PLA @CREALITY; Prusament PLA @CREALITY; Prusament PETG @CREALITY; AzureFilm PLA @CREALITY; Devil Design PLA @CREALITY; Devil Design PLA Matt @CREALITY; Devil Design PLA Galaxy @CREALITY; Extrudr PLA NX2 @CREALITY; Real Filament PLA @CREALITY; Velleman PLA @CREALITY; 3DJAKE ecoPLA @CREALITY; 3DJAKE ecoPLA Matt @CREALITY; 3DJAKE ecoPLA Tough @CREALITY; 123-3D Jupiter PLA @CREALITY; Verbatim PLA @CREALITY
[printer_model:ENDER3S1PLUS]
name = Creality Ender-3 S1 Plus
variants = 0.4; 0.3; 0.5; 0.6
technology = FFF
family = ENDER
bed_model = cr10v2_bed.stl
bed_texture = cr10spro.svg
default_materials = Generic PLA @CREALITY; Generic PETG @CREALITY; Generic ABS @CREALITY; Creality PLA @CREALITY; Prusament PLA @CREALITY; Prusament PETG @CREALITY; AzureFilm PLA @CREALITY; Devil Design PLA @CREALITY; Devil Design PLA Matt @CREALITY; Devil Design PLA Galaxy @CREALITY; Extrudr PLA NX2 @CREALITY; Real Filament PLA @CREALITY; Velleman PLA @CREALITY; 3DJAKE ecoPLA @CREALITY; 3DJAKE ecoPLA Matt @CREALITY; 3DJAKE ecoPLA Tough @CREALITY; 123-3D Jupiter PLA @CREALITY; Verbatim PLA @CREALITY
[printer_model:ENDER3MAX]
name = Creality Ender-3 Max
variants = 0.4; 0.3; 0.5; 0.6
@ -531,11 +549,11 @@ support_material_spacing = 1
first_layer_height = 0.2
extrusion_width = 0.33
external_perimeter_extrusion_width = 0.31
first_layer_extrusion_width = 0.33
first_layer_extrusion_width = 0.31
infill_extrusion_width = 0.33
perimeter_extrusion_width = 0.33
solid_infill_extrusion_width = 0.33
top_infill_extrusion_width = 0.33
top_infill_extrusion_width = 0.30
support_material_extrusion_width = 0.27
[print:*0.4nozzle*]
@ -545,11 +563,11 @@ support_material_spacing = 1
first_layer_height = 0.2
extrusion_width = 0.44
external_perimeter_extrusion_width = 0.42
first_layer_extrusion_width = 0.44
first_layer_extrusion_width = 0.42
infill_extrusion_width = 0.44
perimeter_extrusion_width = 0.44
solid_infill_extrusion_width = 0.44
top_infill_extrusion_width = 0.44
top_infill_extrusion_width = 0.40
support_material_extrusion_width = 0.36
[print:*0.5nozzle*]
@ -559,11 +577,11 @@ support_material_spacing = 1.1
first_layer_height = 0.2
extrusion_width = 0.55
external_perimeter_extrusion_width = 0.52
first_layer_extrusion_width = 0.55
first_layer_extrusion_width = 0.52
infill_extrusion_width = 0.55
perimeter_extrusion_width = 0.55
solid_infill_extrusion_width = 0.55
top_infill_extrusion_width = 0.55
top_infill_extrusion_width = 0.50
support_material_extrusion_width = 0.45
[print:*0.6nozzle*]
@ -573,11 +591,11 @@ support_material_spacing = 1.2
first_layer_height = 0.3
extrusion_width = 0.66
external_perimeter_extrusion_width = 0.63
first_layer_extrusion_width = 0.66
first_layer_extrusion_width = 0.63
infill_extrusion_width = 0.66
perimeter_extrusion_width = 0.66
solid_infill_extrusion_width = 0.66
top_infill_extrusion_width = 0.66
top_infill_extrusion_width = 0.60
support_material_extrusion_width = 0.54
@ -1268,6 +1286,25 @@ inherits = *ENDER3PRO*; *0.6nozzle*
[printer:*ENDER3NEO*]
inherits = *ENDER3*; *fastabl*
printer_model = ENDER3NEO
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_ENDER3NEO\nPRINTER_HAS_BOWDEN
[printer:Creality Ender-3 Neo (0.3 mm nozzle)]
inherits = *ENDER3NEO*; *0.3nozzle*
[printer:Creality Ender-3 Neo (0.4 mm nozzle)]
inherits = *ENDER3NEO*; *0.4nozzle*
[printer:Creality Ender-3 Neo (0.5 mm nozzle)]
inherits = *ENDER3NEO*; *0.5nozzle*
[printer:Creality Ender-3 Neo (0.6 mm nozzle)]
inherits = *ENDER3NEO*; *0.6nozzle*
[printer:*ENDER3V2*]
inherits = *common*; *bowden*; *pauseprint*
bed_shape = 5x0,215x0,215x220,5x220
@ -1312,7 +1349,7 @@ inherits = *ENDER3V2NEO*; *0.6nozzle*
[printer:*ENDER3S1*]
inherits = *common*; *bowden*; *spriteextruder*; *pauseprint*
inherits = *common*; *fastabl*; *spriteextruder*; *pauseprint*
bed_shape = 5x0,215x0,215x220,5x220
max_print_height = 270
printer_model = ENDER3S1
@ -1334,7 +1371,7 @@ inherits = *ENDER3S1*; *0.6nozzle*
[printer:*ENDER3S1PRO*]
inherits = *common*; *bowden*; *spriteextruder*; *pauseprint*
inherits = *common*; *fastabl*; *spriteextruder*; *pauseprint*
bed_shape = 5x0,215x0,215x220,5x220
max_print_height = 270
printer_model = ENDER3S1PRO
@ -1355,6 +1392,26 @@ inherits = *ENDER3S1PRO*; *0.6nozzle*
[printer:*ENDER3S1PLUS*]
inherits = *common*; *slowabl*; *spriteextruder*; *pauseprint*
bed_shape = 5x5,295x5,295x295,5x295
max_print_height = 300
printer_model = ENDER3S1PLUS
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_ENDER3S1PLUS
[printer:Creality Ender-3 S1 Plus (0.3 mm nozzle)]
inherits = *ENDER3S1PLUS*; *0.3nozzle*
[printer:Creality Ender-3 S1 Plus (0.4 mm nozzle)]
inherits = *ENDER3S1PLUS*; *0.4nozzle*
[printer:Creality Ender-3 S1 Plus (0.5 mm nozzle)]
inherits = *ENDER3S1PLUS*; *0.5nozzle*
[printer:Creality Ender-3 S1 Plus (0.6 mm nozzle)]
inherits = *ENDER3S1PLUS*; *0.6nozzle*
[printer:*ENDER3MAX*]
inherits = *common*; *bowdenlong*; *pauseprint*
@ -1669,7 +1726,7 @@ inherits = *CR10SMART*; *0.6nozzle*
[printer:*CR10SMARTPRO*]
inherits = *common*; *bowdenlong*; *slowabl*; *spriteextruder*
inherits = *common*; *slowabl*; *spriteextruder*
bed_shape = 5x5,295x5,295x295,5x295
max_print_height = 400
printer_model = CR10SMARTPRO

Binary file not shown.

After

(image error) Size: 34 KiB

Binary file not shown.

After

(image error) Size: 29 KiB

View file

@ -1,6 +1,10 @@
min_slic3r_version = 2.5.0-alpha0
1.5.1 Renamed filament type "NYLON" to "PA". Updated Adura X profile. Updated PETG fan settings for Prusa MINI (removed fan ramp up).
1.5.0 Updated arachne parameters. Added profiles for Jessie filaments.
1.5.0-alpha1 Added filament profile for Prusament PA11 Carbon Fiber. Added profiles for multiple 3D-Fuel filaments.
1.5.0-alpha0 Added parameters for Arachne perimeter generator. Changed default seam position. Updated output filename format.
min_slic3r_version = 2.4.0-rc
1.4.7 Added filament profile for Prusament PA11 Carbon Fiber. Added profiles for multiple 3D-Fuel filaments.
1.4.6 Added SLA materials. Updated filament profiles.
1.4.5 Added MMU2/S profiles for 0.25mm nozzle. Updated FW version. Enabled g-code thumbnails for MK3 family printers. Updated end g-code.
1.4.4 Added multiple Fiberlogy filament profiles. Updated Extrudr filament profiles.

View file

@ -5,7 +5,7 @@
name = Prusa Research
# Configuration version of this file. Config file will only be installed, if the config_version differs.
# This means, the server may force the PrusaSlicer configuration to be downgraded.
config_version = 1.5.0-alpha0
config_version = 1.5.1
# Where to get the updates from?
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/PrusaResearch/
changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
@ -30,7 +30,7 @@ technology = FFF
family = MK3
bed_model = mk3_bed.stl
bed_texture = mk3.svg
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend; Prusament PC Blend Carbon Fiber; Prusament PVB
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend; Prusament PC Blend Carbon Fiber; Prusament PVB; Prusament PA11 Carbon Fiber
[printer_model:MK3]
name = Original Prusa i3 MK3
@ -39,7 +39,7 @@ technology = FFF
family = MK3
bed_model = mk3_bed.stl
bed_texture = mk3.svg
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend; Prusament PC Blend Carbon Fiber; Prusament PVB
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend; Prusament PC Blend Carbon Fiber; Prusament PVB; Prusament PA11 Carbon Fiber
[printer_model:MK3SMMU2S]
name = Original Prusa i3 MK3S && MK3S+ MMU2S
@ -66,7 +66,7 @@ technology = FFF
family = MK2.5
bed_model = mk3_bed.stl
bed_texture = mk3.svg
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend; Prusament PC Blend Carbon Fiber; Prusament PVB
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend; Prusament PC Blend Carbon Fiber; Prusament PVB; Prusament PA11 Carbon Fiber @MK2
[printer_model:MK2.5]
name = Original Prusa i3 MK2.5
@ -75,7 +75,7 @@ technology = FFF
family = MK2.5
bed_model = mk3_bed.stl
bed_texture = mk3.svg
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend; Prusament PC Blend Carbon Fiber; Prusament PVB
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend; Prusament PC Blend Carbon Fiber; Prusament PVB; Prusament PA11 Carbon Fiber @MK2
[printer_model:MK2.5SMMU2S]
name = Original Prusa i3 MK2.5S MMU2S
@ -102,7 +102,7 @@ technology = FFF
family = MK2
bed_model = mk2_bed.stl
bed_texture = mk2.svg
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend; Prusament PC Blend Carbon Fiber; Prusament PVB
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend; Prusament PC Blend Carbon Fiber; Prusament PVB; Prusament PA11 Carbon Fiber @MK2
[printer_model:MK2SMM]
name = Original Prusa i3 MK2S MMU1
@ -243,14 +243,11 @@ bottom_solid_min_thickness = 0.5
gcode_label_objects = 1
infill_anchor = 2.5
infill_anchor_max = 12
wall_add_middle_threshold = 75%
wall_split_middle_threshold = 50%
wall_transition_angle = 10
wall_transition_filter_deviation = 25%
wall_transition_length = 0.4
wall_distribution_count = 1
min_bead_width = 85%
min_feature_size = 0.1
[print:*MK3*]
fill_pattern = grid
@ -297,14 +294,11 @@ thick_bridges = 0
bridge_flow_ratio = 1
bridge_speed = 20
wipe_tower_bridging = 6
wall_add_middle_threshold = 85%
wall_split_middle_threshold = 70%
wall_transition_angle = 10
wall_transition_filter_deviation = 25%
wall_transition_length = 0.25
wall_distribution_count = 1
min_bead_width = 85%
min_feature_size = 0.0625
[print:*0.25nozzleMK3*]
inherits = *0.25nozzle*
@ -353,14 +347,11 @@ bottom_solid_min_thickness = 0.6
thick_bridges = 1
bridge_flow_ratio = 0.95
bridge_speed = 25
wall_add_middle_threshold = 85%
wall_split_middle_threshold = 70%
wall_transition_angle = 10
wall_transition_filter_deviation = 25%
wall_transition_length = 0.6
wall_distribution_count = 1
min_bead_width = 85%
min_feature_size = 0.15
[print:*0.6nozzleMK3*]
inherits = *0.6nozzle*
@ -422,14 +413,11 @@ bottom_solid_min_thickness = 0.8
single_extruder_multi_material_priming = 0
thick_bridges = 1
overhangs = 0
wall_add_middle_threshold = 85%
wall_split_middle_threshold = 70%
wall_transition_angle = 10
wall_transition_filter_deviation = 25%
wall_transition_length = 0.8
wall_distribution_count = 1
min_bead_width = 85%
min_feature_size = 0.2
[print:*soluble_support*]
overhangs = 1
@ -926,6 +914,7 @@ top_solid_infill_speed = 40
fill_pattern = gyroid
fill_density = 15%
perimeters = 3
wipe_tower_bridging = 5
[print:0.15mm QUALITY @MK3]
inherits = *0.15mm*; *MK3*
@ -1620,9 +1609,9 @@ filament_retract_lift = 0.2
compatible_printers_condition = printer_model=="MK2SMM"
[filament:*PETMINI*]
# inherits = *PET*
full_fan_speed_layer = 0
filament_retract_length = nil
filament_retract_speed = 40
filament_retract_speed = 45
filament_deretract_speed = 25
filament_retract_lift = nil
filament_retract_before_travel = 1
@ -1631,9 +1620,9 @@ compatible_printers_condition = printer_model=="MINI"
start_filament_gcode = "M900 K{if nozzle_diameter[0]==0.6}0.12{elsif nozzle_diameter[0]==0.8}0.06{else}0.2{endif} ; Filament gcode"
[filament:*PETMINI06*]
# inherits = *PET*
full_fan_speed_layer = 0
filament_retract_length = nil
filament_retract_speed = 40
filament_retract_speed = 45
filament_deretract_speed = 25
filament_retract_lift = nil
filament_retract_before_travel = 1
@ -1642,7 +1631,6 @@ start_filament_gcode = "M900 K0.12 ; Filament gcode"
filament_max_volumetric_speed = 13
[filament:*ABSMINI*]
# inherits = *ABS*
bed_temperature = 100
first_layer_bed_temperature = 100
filament_retract_length = 2.7
@ -2057,6 +2045,28 @@ disable_fan_first_layers = 6
compatible_printers_condition = nozzle_diameter[0]>=0.4 and nozzle_diameter[0]!=0.8 and printer_notes=~/.*PRINTER_MODEL_MK(2|2.5).*/ and ! (printer_notes=~/.*PRINTER_MODEL_MK2.5.*/ and single_extruder_multi_material)
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.8}0.06{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif nozzle_diameter[0]==0.8}0.02{elsif nozzle_diameter[0]==0.6}0.04{else}0.07{endif} ; Filament gcode LA 1.5\n{if printer_notes=~/.*PRINTER_MODEL_MINI.*/};{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}M900 K200{elsif nozzle_diameter[0]==0.6}M900 K24{elsif nozzle_diameter[0]==0.8};{else}M900 K45{endif} ; Filament gcode LA 1.0"
[filament:Prusament PA11 Carbon Fiber]
inherits = Prusament PC Blend Carbon Fiber
filament_cost = 151.24
filament_density = 1.11
filament_type = PA
filament_max_volumetric_speed = 6.5
extrusion_multiplier = 1.05
first_layer_temperature = 275
temperature = 285
first_layer_bed_temperature = 90
bed_temperature = 115
fan_below_layer_time = 10
compatible_printers_condition = printer_notes!~/.*PRINTER_MODEL_MK(2|2.5).*/ and nozzle_diameter[0]>=0.4 and nozzle_diameter[0]!=0.8 and printer_model!="MINI" and ! single_extruder_multi_material
[filament:Prusament PA11 Carbon Fiber @MK2]
inherits = Prusament PA11 Carbon Fiber
first_layer_bed_temperature = 90
bed_temperature = 110
disable_fan_first_layers = 6
compatible_printers_condition = nozzle_diameter[0]>=0.4 and nozzle_diameter[0]!=0.8 and printer_notes=~/.*PRINTER_MODEL_MK(2|2.5).*/ and ! (printer_notes=~/.*PRINTER_MODEL_MK2.5.*/ and single_extruder_multi_material)
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.8}0.06{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif nozzle_diameter[0]==0.8}0.02{elsif nozzle_diameter[0]==0.6}0.04{else}0.07{endif} ; Filament gcode LA 1.5\n{if printer_notes=~/.*PRINTER_MODEL_MINI.*/};{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}M900 K200{elsif nozzle_diameter[0]==0.6}M900 K24{elsif nozzle_diameter[0]==0.8};{else}M900 K45{endif} ; Filament gcode LA 1.0"
[filament:Fillamentum CPE]
inherits = *PET*
filament_vendor = Fillamentum
@ -2376,10 +2386,10 @@ inherits = *PET*
filament_vendor = addnorth
filament_cost = 29.99
filament_density = 1.27
filament_type = NYLON
filament_type = PA
extrusion_multiplier = 0.98
bed_temperature = 60
first_layer_bed_temperature = 60
bed_temperature = 115
first_layer_bed_temperature = 105
first_layer_temperature = 265
temperature = 270
fan_always_on = 0
@ -2396,7 +2406,7 @@ filament_retract_lift = 0.4
filament_max_volumetric_speed = 4
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.8}0.06{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif nozzle_diameter[0]==0.8}0.02{elsif nozzle_diameter[0]==0.6}0.04{else}0.08{endif} ; Filament gcode LA 1.5\n{if printer_notes=~/.*PRINTER_MODEL_MINI.*/};{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}M900 K200{elsif nozzle_diameter[0]==0.6}M900 K24{elsif nozzle_diameter[0]==0.8};{else}M900 K45{endif} ; Filament gcode LA 1.0"
filament_spool_weight = 0
compatible_printers_condition = nozzle_diameter[0]>=0.4 and printer_model!="MINI" and printer_model!="MK2SMM" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
compatible_printers_condition = printer_notes!~/.*PRINTER_MODEL_MK(2|2.5).*/ and nozzle_diameter[0]>=0.4 and printer_model!="MINI" and printer_model!="MK2SMM" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
[filament:addnorth Adura X @MINI]
inherits = addnorth Adura X
@ -2404,14 +2414,24 @@ filament_retract_length = nil
filament_retract_lift = nil
filament_retract_speed = 40
filament_deretract_speed = 25
bed_temperature = 60
first_layer_bed_temperature = 60
compatible_printers_condition = nozzle_diameter[0]>=0.4 and printer_model=="MINI"
[filament:addnorth Adura X @MMU1]
inherits = addnorth Adura X
filament_retract_length = nil
filament_retract_lift = nil
bed_temperature = 60
first_layer_bed_temperature = 60
compatible_printers_condition = nozzle_diameter[0]>=0.4 and printer_model=="MK2SMM"
[filament:addnorth Adura X @MK2]
inherits = addnorth Adura X
bed_temperature = 110
first_layer_bed_temperature = 105
compatible_printers_condition = nozzle_diameter[0]>=0.4 and printer_notes=~/.*PRINTER_MODEL_MK(2|2.5).*/ and ! (printer_notes=~/.*PRINTER_MODEL_MK2.5.*/ and single_extruder_multi_material)
[filament:addnorth E-PLA]
inherits = *PLA*
filament_vendor = addnorth
@ -2684,6 +2704,75 @@ filament_cost = 25.4
filament_density = 1.24
compatible_printers_condition = nozzle_diameter[0]!=0.8 and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
[filament:3D-Fuel Standard PLA]
inherits = *PLA*
filament_vendor = 3D-Fuel
filament_cost = 22.14
filament_density = 1.24
filament_max_volumetric_speed = 10
first_layer_temperature = 210
temperature = 200
[filament:3D-Fuel EasiPrint PLA]
inherits = 3D-Fuel Standard PLA
filament_cost = 30.44
[filament:3D-Fuel Pro PLA]
inherits = *PLA*
filament_vendor = 3D-Fuel
filament_cost = 26.57
filament_density = 1.22
filament_max_volumetric_speed = 12
first_layer_temperature = 220
temperature = 215
filament_retract_lift = 0
[filament:3D-Fuel Buzzed]
inherits = 3D-Fuel Standard PLA
filament_cost = 44.27
filament_retract_lift = 0
first_layer_temperature = 210
temperature = 195
filament_max_volumetric_speed = 8
[filament:3D-Fuel Wound up]
inherits = 3D-Fuel Buzzed
filament_cost = 44.27
filament_retract_lift = nil
first_layer_temperature = 215
temperature = 210
filament_max_volumetric_speed = 8
[filament:3D-Fuel Workday ABS]
inherits = *ABSC*
filament_vendor = 3D-Fuel
filament_cost = 23.25
filament_density = 1.04
[filament:3D-Fuel Workday ABS @MINI]
inherits = 3D-Fuel Workday ABS; *ABSMINI*
[filament:Jessie PLA]
inherits = *PLA*
filament_vendor = Printed Solid
filament_cost = 21
filament_density = 1.24
filament_max_volumetric_speed = 12
[filament:Jessie PETG]
inherits = *PET*
filament_vendor = Printed Solid
filament_cost = 22
filament_density = 1.27
first_layer_temperature = 240
first_layer_bed_temperature = 85
temperature = 245
bed_temperature = 90
filament_max_volumetric_speed = 7
[filament:Jessie PETG @MINI]
inherits = Jessie PETG; *PETMINI*
[filament:Devil Design PLA]
inherits = *PLA*
filament_vendor = Devil Design
@ -2941,7 +3030,7 @@ bed_temperature = 115
fan_always_on = 0
cooling = 0
bridge_fan_speed = 25
filament_type = NYLON
filament_type = PA
filament_max_volumetric_speed = 8
compatible_printers_condition = printer_notes!~/.*PRINTER_MODEL_MK(2|2.5).*/ and printer_model!="MINI" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
@ -4085,7 +4174,7 @@ filament_cost = 27.65
[filament:Fiberlogy Nylon PA12]
inherits = Fiberlogy ASA
filament_type = NYLON
filament_type = PA
filament_density = 1.01
filament_cost = 48
first_layer_bed_temperature = 105
@ -4318,7 +4407,7 @@ inherits = *common*
filament_vendor = Taulman
filament_cost = 40
filament_density = 1.13
bed_temperature = 90
bed_temperature = 110
bridge_fan_speed = 40
cooling = 0
disable_fan_first_layers = 3
@ -4327,13 +4416,22 @@ fan_below_layer_time = 20
filament_colour = #DEE0E6
filament_max_volumetric_speed = 7
filament_soluble = 0
filament_type = NYLON
first_layer_bed_temperature = 60
first_layer_temperature = 240
filament_type = PA
first_layer_bed_temperature = 90
first_layer_temperature = 260
temperature = 260
max_fan_speed = 0
min_fan_speed = 0
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.8}0.06{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif nozzle_diameter[0]==0.8}0.02{elsif nozzle_diameter[0]==0.6}0.04{else}0.08{endif} ; Filament gcode LA 1.5\n{if printer_notes=~/.*PRINTER_MODEL_MINI.*/};{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}M900 K200{elsif nozzle_diameter[0]==0.6}M900 K24{elsif nozzle_diameter[0]==0.8};{else}M900 K45{endif} ; Filament gcode LA 1.0"
compatible_printers_condition = printer_model!="MINI" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
[filament:Taulman Bridge @MINI]
inherits = Taulman Bridge
bed_temperature = 90
first_layer_bed_temperature = 60
first_layer_temperature = 240
temperature = 250
compatible_printers_condition = printer_model=="MINI"
[filament:Fillamentum Nylon FX256]
inherits = *common*
@ -4352,7 +4450,7 @@ slowdown_below_layer_time = 20
filament_colour = #DEE0E6
filament_max_volumetric_speed = 6
filament_soluble = 0
filament_type = NYLON
filament_type = PA
first_layer_bed_temperature = 90
first_layer_temperature = 250
max_fan_speed = 0
@ -4365,10 +4463,10 @@ inherits = *common*
filament_vendor = Fiberthree
filament_cost = 200.84
filament_density = 1.2
bed_temperature = 70
first_layer_bed_temperature = 75
first_layer_temperature = 270
temperature = 270
bed_temperature = 90
first_layer_bed_temperature = 90
first_layer_temperature = 285
temperature = 285
bridge_fan_speed = 30
cooling = 1
disable_fan_first_layers = 3
@ -4379,7 +4477,7 @@ slowdown_below_layer_time = 10
filament_colour = #DEE0E6
filament_max_volumetric_speed = 5
filament_soluble = 0
filament_type = NYLON
filament_type = PA
max_fan_speed = 20
min_fan_speed = 20
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.8}0.06{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif nozzle_diameter[0]==0.8}0.01{elsif nozzle_diameter[0]==0.6}0.04{else}0.05{endif} ; Filament gcode LA 1.5\n{if printer_notes=~/.*PRINTER_MODEL_MINI.*/};{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}M900 K200{elsif nozzle_diameter[0]==0.6}M900 K18{elsif nozzle_diameter[0]==0.8};{else}M900 K30{endif} ; Filament gcode LA 1.0"
@ -4395,10 +4493,10 @@ inherits = *common*
filament_vendor = Fiberthree
filament_cost = 208.1
filament_density = 1.25
bed_temperature = 70
first_layer_bed_temperature = 75
first_layer_temperature = 275
temperature = 275
bed_temperature = 90
first_layer_bed_temperature = 90
first_layer_temperature = 285
temperature = 285
bridge_fan_speed = 30
cooling = 1
disable_fan_first_layers = 3
@ -4409,7 +4507,7 @@ slowdown_below_layer_time = 10
filament_colour = #DEE0E6
filament_max_volumetric_speed = 5
filament_soluble = 0
filament_type = NYLON
filament_type = PA
max_fan_speed = 0
min_fan_speed = 0
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.8}0.06{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif nozzle_diameter[0]==0.8}0.01{elsif nozzle_diameter[0]==0.6}0.04{else}0.05{endif} ; Filament gcode LA 1.5\n{if printer_notes=~/.*PRINTER_MODEL_MINI.*/};{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}M900 K200{elsif nozzle_diameter[0]==0.6}M900 K18{elsif nozzle_diameter[0]==0.8};{else}M900 K30{endif} ; Filament gcode LA 1.0"
@ -4695,6 +4793,10 @@ compatible_printers_condition = printer_model=="MINI" and nozzle_diameter[0]!=0.
[filament:Fiberthree F3 PA Pure Pro @MINI]
inherits = Fiberthree F3 PA Pure Pro
filament_max_volumetric_speed = 4
first_layer_temperature = 280
temperature = 280
first_layer_bed_temperature = 75
bed_temperature = 70
filament_retract_length = nil
filament_retract_speed = nil
filament_retract_lift = nil
@ -4704,6 +4806,10 @@ compatible_printers_condition = printer_model=="MINI"
[filament:Fiberthree F3 PA-CF Pro @MINI]
inherits = Fiberthree F3 PA-CF Pro
first_layer_temperature = 280
temperature = 280
first_layer_bed_temperature = 75
bed_temperature = 70
filament_max_volumetric_speed = 4
filament_retract_length = nil
filament_retract_speed = nil
@ -5083,6 +5189,16 @@ filament_max_volumetric_speed = 13
filament_retract_lift = 0.25
compatible_printers_condition = printer_notes!~/.*PRINTER_MODEL_MK(2|2.5).*/ and nozzle_diameter[0]==0.8 and printer_model!="MINI" and ! single_extruder_multi_material
[filament:Prusament PA11 Carbon Fiber @0.8 nozzle]
inherits = Prusament PA11 Carbon Fiber
filament_max_volumetric_speed = 11
compatible_printers_condition = printer_notes!~/.*PRINTER_MODEL_MK(2|2.5).*/ and nozzle_diameter[0]==0.8 and printer_model!="MINI" and ! single_extruder_multi_material
[filament:Prusament PA11 Carbon Fiber @0.8 nozzle MK2]
inherits = Prusament PA11 Carbon Fiber @MK2
filament_max_volumetric_speed = 11
compatible_printers_condition = nozzle_diameter[0]==0.8 and printer_model!="MK2SMM" and printer_notes=~/.*PRINTER_MODEL_MK(2|2.5).*/ and ! (printer_notes=~/.*PRINTER_MODEL_MK2.5.*/ and single_extruder_multi_material)
[filament:Prusament PC Blend @0.8 nozzle MK2]
inherits = Prusament PC Blend @MK2
filament_max_volumetric_speed = 13
@ -8839,7 +8955,7 @@ inherits = Original Prusa i3 MK2S
printer_model = MK2.5
remaining_times = 1
machine_max_jerk_e = 4.5
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\nG92 E0
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n{if filament_settings_id[initial_tool]=~/.*Prusament PA11.*/}\nG1 Z0.3 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E9 F1000 ; intro line\n{else}\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\n{endif}\nG92 E0
[printer:Original Prusa i3 MK2.5 0.25 nozzle]
inherits = Original Prusa i3 MK2S 0.25 nozzle
@ -8853,7 +8969,8 @@ inherits = Original Prusa i3 MK2S 0.6 nozzle
printer_model = MK2.5
remaining_times = 1
machine_max_jerk_e = 4.5
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\nG92 E0
deretract_speed = 25
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n{if filament_settings_id[initial_tool]=~/.*Prusament PA11.*/}\nG1 Z0.3 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E9 F1000 ; intro line\n{else}\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\n{endif}\nG92 E0
[printer:Original Prusa i3 MK2.5 0.8 nozzle]
inherits = Original Prusa i3 MK2S 0.6 nozzle
@ -8862,10 +8979,13 @@ nozzle_diameter = 0.8
printer_variant = 0.8
max_layer_height = 0.6
min_layer_height = 0.2
retract_length = 1
retract_length = 0.7
retract_speed = 35
deretract_speed = 20
retract_lift = 0.25
remaining_times = 1
machine_max_jerk_e = 4.5
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\nG92 E0
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n{if filament_settings_id[initial_tool]=~/.*Prusament PA11.*/}\nG1 Z0.3 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E9 F1000 ; intro line\n{else}\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\n{endif}\nG92 E0
default_print_profile = 0.40mm QUALITY @0.8 nozzle
default_filament_profile = Prusament PLA @0.8 nozzle
color_change_gcode = M600\nG1 E0.6 F1500 ; prime after color change
@ -8939,7 +9059,10 @@ max_layer_height = 0.6
min_layer_height = 0.2
nozzle_diameter = 0.8
printer_variant = 0.8
retract_length = 1
retract_length = 0.7
retract_speed = 35
deretract_speed = 20
retract_lift = 0.25
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nTx\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n\n;go outside print area\nG1 Y-3 F1000\nG1 Z0.4 F1000\n; select extruder\nTc\n; purge line\nG1 X55 F2000\nG1 Z0.3 F1000\nG92 E0\nG1 X240 E25 F2200\nG1 Y-2 F1000\nG1 X55 E25 F1400\nG1 Z0.2 F1000\nG1 X5 E4 F1000\nG92 E0\n
default_print_profile = 0.40mm QUALITY @0.8 nozzle
default_filament_profile = Prusament PLA @0.8 nozzle
@ -8952,6 +9075,7 @@ max_layer_height = 0.35
min_layer_height = 0.1
nozzle_diameter = 0.6
printer_variant = 0.6
deretract_speed = 25
default_print_profile = 0.20mm NORMAL @0.6 nozzle
color_change_gcode = M600\nG1 E0.5 F1500 ; prime after color change
@ -8985,6 +9109,7 @@ nozzle_diameter = 0.6,0.6,0.6,0.6,0.6
max_layer_height = 0.40
min_layer_height = 0.15
printer_variant = 0.6
deretract_speed = 25
default_print_profile = 0.20mm NORMAL @0.6 nozzle
color_change_gcode = M600\nG1 E0.5 F1500 ; prime after color change
@ -8994,6 +9119,7 @@ nozzle_diameter = 0.6,0.6,0.6,0.6,0.6
max_layer_height = 0.40
min_layer_height = 0.15
printer_variant = 0.6
deretract_speed = 25
default_print_profile = 0.20mm NORMAL @0.6 nozzle
color_change_gcode = M600\nG1 E0.5 F1500 ; prime after color change
@ -9067,7 +9193,7 @@ remaining_times = 1
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MK3\n
retract_lift_below = 209
max_print_height = 210
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\nG92 E0\nM221 S{if layer_height<0.075}100{else}95{endif}\n\n; Don't change E values below. Excessive value can damage the printer.\n{if print_settings_id=~/.*(DETAIL @MK3|QUALITY @MK3).*/}M907 E430 ; set extruder motor current{endif}\n{if print_settings_id=~/.*(SPEED @MK3|DRAFT @MK3).*/}M907 E538 ; set extruder motor current{endif}
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n{if filament_settings_id[initial_tool]=~/.*Prusament PA11.*/}\nG1 Z0.3 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E9 F1000 ; intro line\n{else}\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\n{endif}\nG92 E0\nM221 S{if layer_height<0.075}100{else}95{endif}\n\n; Don't change E values below. Excessive value can damage the printer.\n{if print_settings_id=~/.*(DETAIL @MK3|QUALITY @MK3).*/}M907 E430 ; set extruder motor current{endif}\n{if print_settings_id=~/.*(SPEED @MK3|DRAFT @MK3).*/}M907 E538 ; set extruder motor current{endif}
printer_model = MK3
default_print_profile = 0.15mm QUALITY @MK3
thumbnails = 160x120
@ -9089,7 +9215,8 @@ nozzle_diameter = 0.6
max_layer_height = 0.40
min_layer_height = 0.15
printer_variant = 0.6
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\nG92 E0\nM221 S{if layer_height<0.075}100{else}95{endif}
deretract_speed = 25
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n{if filament_settings_id[initial_tool]=~/.*Prusament PA11.*/}\nG1 Z0.3 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E9 F1000 ; intro line\n{else}\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\n{endif}\nG92 E0\nM221 S{if layer_height<0.075}100{else}95{endif}
default_print_profile = 0.30mm QUALITY @0.6 nozzle MK3
color_change_gcode = M600\nG1 E0.5 F1500 ; prime after color change
@ -9099,8 +9226,11 @@ nozzle_diameter = 0.8
max_layer_height = 0.6
min_layer_height = 0.2
printer_variant = 0.8
retract_length = 1
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\nG92 E0\nM221 S95
retract_length = 0.7
retract_speed = 35
deretract_speed = 20
retract_lift = 0.25
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n{if filament_settings_id[initial_tool]=~/.*Prusament PA11.*/}\nG1 Z0.3 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E9 F1000 ; intro line\n{else}\nG1 Z0.2 F720\nG1 Y-3 F1000 ; go outside print area\nG92 E0\nG1 X60 E9 F1000 ; intro line\nG1 X100 E12.5 F1000 ; intro line\n{endif}\nG92 E0\nM221 S95
default_print_profile = 0.40mm QUALITY @0.8 nozzle
default_filament_profile = Prusament PLA @0.8 nozzle
color_change_gcode = M600\nG1 E0.6 F1500 ; prime after color change
@ -9182,6 +9312,7 @@ nozzle_diameter = 0.6
max_layer_height = 0.40
min_layer_height = 0.15
printer_variant = 0.6
deretract_speed = 25
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nTx\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n\n;go outside print area\nG1 Y-3 F1000\nG1 Z0.4 F1000\n; select extruder\nTc\n; purge line\nG1 X55 E8 F2000\nG1 Z0.3 F1000\nG92 E0\nG1 X240 E25 F2200\nG1 Y-2 F1000\nG1 X55 E25 F1400\nG1 Z0.2 F1000\nG1 X5 E4 F1000\n\nM221 S{if layer_height<0.075}100{else}95{endif}\nG92 E0
default_print_profile = 0.30mm QUALITY @0.6 nozzle MK3
color_change_gcode = M600\nG1 E0.5 F1500 ; prime after color change
@ -9193,7 +9324,10 @@ nozzle_diameter = 0.8
max_layer_height = 0.6
min_layer_height = 0.2
printer_variant = 0.8
retract_length = 1
retract_length = 0.7
retract_speed = 35
deretract_speed = 20
retract_lift = 0.25
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nTx\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n\n;go outside print area\nG1 Y-3 F1000\nG1 Z0.4 F1000\n; select extruder\nTc\n; purge line\nG1 X55 E8 F2000\nG1 Z0.3 F1000\nG92 E0\nG1 X240 E25 F2200\nG1 Y-2 F1000\nG1 X55 E25 F1400\nG1 Z0.2 F1000\nG1 X5 E4 F1000\n\nM221 S{if layer_height<0.075}100{else}95{endif}\nG92 E0
default_print_profile = 0.40mm QUALITY @0.8 nozzle
default_filament_profile = Prusament PLA @0.8 nozzle
@ -9235,6 +9369,7 @@ nozzle_diameter = 0.6
max_layer_height = 0.40
min_layer_height = 0.15
printer_variant = 0.6
deretract_speed = 25
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nTx\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n\n;go outside print area\nG1 Y-3 F1000\nG1 Z0.4 F1000\n; select extruder\nTc\n; purge line\nG1 X55 F2000\nG1 Z0.3 F1000\nG92 E0\nG1 X240 E25 F2200\nG1 Y-2 F1000\nG1 X55 E25 F1400\nG1 Z0.2 F1000\nG1 X5 E4 F1000\n\nM221 S{if layer_height<0.075}100{else}95{endif}\nG92 E0
default_print_profile = 0.30mm QUALITY @0.6 nozzle MK3
color_change_gcode = M600\nG1 E0.5 F1500 ; prime after color change
@ -9246,7 +9381,10 @@ nozzle_diameter = 0.8
max_layer_height = 0.6
min_layer_height = 0.2
printer_variant = 0.8
retract_length = 1
retract_length = 0.7
retract_speed = 35
deretract_speed = 20
retract_lift = 0.25
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nTx\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n\n;go outside print area\nG1 Y-3 F1000\nG1 Z0.4 F1000\n; select extruder\nTc\n; purge line\nG1 X55 F2000\nG1 Z0.3 F1000\nG92 E0\nG1 X240 E25 F2200\nG1 Y-2 F1000\nG1 X55 E25 F1400\nG1 Z0.2 F1000\nG1 X5 E4 F1000\n\nM221 S{if layer_height<0.075}100{else}95{endif}\nG92 E0
default_print_profile = 0.40mm QUALITY @0.8 nozzle
default_filament_profile = Prusament PLA @0.8 nozzle
@ -9283,6 +9421,7 @@ nozzle_diameter = 0.6,0.6,0.6,0.6,0.6
max_layer_height = 0.40
min_layer_height = 0.15
printer_variant = 0.6
deretract_speed = 25
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n\n; Send the filament type to the MMU2.0 unit.\n; E stands for extruder number, F stands for filament type (0: default; 1:flex; 2: PVA)\nM403 E0 F{"" + ((filament_type[0]=="FLEX") ? 1 : ((filament_type[0]=="PVA") ? 2 : 0))}\nM403 E1 F{"" + ((filament_type[1]=="FLEX") ? 1 : ((filament_type[1]=="PVA") ? 2 : 0))}\nM403 E2 F{"" + ((filament_type[2]=="FLEX") ? 1 : ((filament_type[2]=="PVA") ? 2 : 0))}\nM403 E3 F{"" + ((filament_type[3]=="FLEX") ? 1 : ((filament_type[3]=="PVA") ? 2 : 0))}\nM403 E4 F{"" + ((filament_type[4]=="FLEX") ? 1 : ((filament_type[4]=="PVA") ? 2 : 0))}\n\n{if not has_single_extruder_multi_material_priming}\n;go outside print area\nG1 Y-3 F1000\nG1 Z0.4 F1000\n; select extruder\nT[initial_tool]\n; initial load\nG1 X55 E29 F1073\nG1 X5 E29 F1800\nG1 X55 E8 F2000\nG1 Z0.3 F1000\nG92 E0\nG1 X240 E25 F2200\nG1 Y-2 F1000\nG1 X55 E25 F1400\nG1 Z0.2 F1000\nG1 X5 E4 F1000\nG92 E0\n{endif}\n\nM221 S{if layer_height<0.075}100{else}95{endif}\nG92 E0
default_print_profile = 0.30mm QUALITY @0.6 nozzle MK3
color_change_gcode = M600\nG1 E0.5 F1500 ; prime after color change
@ -9293,6 +9432,7 @@ nozzle_diameter = 0.6,0.6,0.6,0.6,0.6
max_layer_height = 0.40
min_layer_height = 0.15
printer_variant = 0.6
deretract_speed = 25
start_gcode = M862.3 P \"[printer_model]\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.11.0 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\n\n; Send the filament type to the MMU2.0 unit.\n; E stands for extruder number, F stands for filament type (0: default; 1:flex; 2: PVA)\nM403 E0 F{"" + ((filament_type[0]=="FLEX") ? 1 : ((filament_type[0]=="PVA") ? 2 : 0))}\nM403 E1 F{"" + ((filament_type[1]=="FLEX") ? 1 : ((filament_type[1]=="PVA") ? 2 : 0))}\nM403 E2 F{"" + ((filament_type[2]=="FLEX") ? 1 : ((filament_type[2]=="PVA") ? 2 : 0))}\nM403 E3 F{"" + ((filament_type[3]=="FLEX") ? 1 : ((filament_type[3]=="PVA") ? 2 : 0))}\nM403 E4 F{"" + ((filament_type[4]=="FLEX") ? 1 : ((filament_type[4]=="PVA") ? 2 : 0))}\n\n{if not has_single_extruder_multi_material_priming}\n;go outside print area\nG1 Y-3 F1000\nG1 Z0.4 F1000\n; select extruder\nT[initial_tool]\n; initial load\nG1 X55 E32 F1073\nG1 X5 E32 F1800\nG1 X55 E8 F2000\nG1 Z0.3 F1000\nG92 E0\nG1 X240 E25 F2200\nG1 Y-2 F1000\nG1 X55 E25 F1400\nG1 Z0.2 F1000\nG1 X5 E4 F1000\nG92 E0\n{endif}\n\nM221 S{if layer_height<0.075}100{else}95{endif}\nG92 E0
default_print_profile = 0.30mm QUALITY @0.6 nozzle MK3
color_change_gcode = M600\nG1 E0.5 F1500 ; prime after color change
@ -9424,8 +9564,10 @@ max_layer_height = 0.55
min_layer_height = 0.2
default_print_profile = 0.40mm QUALITY @0.8 nozzle MINI
default_filament_profile = Prusament PLA @0.8 nozzle
retract_length = 3.5
retract_length = 3
retract_before_travel = 1.5
retract_speed = 45
deretract_speed = 20
[printer:Original Prusa SL1]
printer_technology = SLA

View file

@ -1,3 +1,4 @@
min_slic3r_version = 2.4.0-alpha0
1.0.1 Speed improvements, start gcode changes, added HIPS filament.
1.0.0 Initial version

View file

@ -1,14 +1,14 @@
# Print profiles for the gCreate printers.
#
# GTL Modified 210706 (at gCreate Shop)
#
# GTL Modified 220825 (at gCreate Shop)
# Speed improvements, start/end gCode changes
[vendor]
# Vendor name will be shown by the Config Wizard.
name = gCreate
# Configuration version of this file. Config file will only be installed, if the config_version differs.
# This means, the server may force the PrusaSlicer configuration to be downgraded.
config_version = 1.0.0
config_version = 1.0.1
# Where to get the updates from?
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/gCreate/
# changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
@ -548,6 +548,7 @@ compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_GCREATE.*/
# Common filament preset across all PLA filaments
[filament:*PLA*]
inherits = *common*
extrusion_multiplier = 0.94
bed_temperature = 60
fan_below_layer_time = 15
filament_colour = #FF3232
@ -749,11 +750,20 @@ filament_vendor = ProtoPasta
temperature = 250
bed_temperature = 70
[filament:Generic HIPS @GCREATE]
inherits = *PET*
filament_vendor = Generic
filament_density = 1.04
temperature = 230
first_layer_temperature = 235
bed_temperature = 100
first_layer_bed_temperature = 100
filament_type = HIPS
[filament:Generic TPU 90A @GCREATE]
inherits = *TPU90A*
filament_vendor = Generic
[filament:Generic CF PETG @GCREATE]
inherits = *CFPETG*
filament_vendor = Generic
@ -770,8 +780,6 @@ filament_vendor = Generic
inherits = *WOODFILLPLA*
filament_vendor = ColorFabb
[filament:Generic PVA @GCREATE - PLA and PVA Support]
bed_temperature = 0
bridge_fan_speed = 75
@ -830,8 +838,8 @@ machine_max_feedrate_x = 500
machine_max_feedrate_y = 500
machine_max_feedrate_z = 10
machine_max_jerk_e = 2.5
machine_max_jerk_x = 3
machine_max_jerk_y = 3
machine_max_jerk_x = 10
machine_max_jerk_y = 10
machine_max_jerk_z = 0.4
machine_min_extruding_rate = 0
machine_min_travel_rate = 0
@ -893,7 +901,7 @@ retract_speed = 70
deretract_speed = 40
retract_before_wipe = 70%
default_print_profile = 0.20mm - Standard Layers @GCREATE
start_gcode = G90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 ; home all\nG92 E0.0
start_gcode = M420 Z20\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 ; home all\nG92 E0.0
end_gcode = M104 S0 T0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+5, max_print_height)} F600{endif} ; Move print head up\nG1 X5 Y170 F3000 ; present print\n{if layer_z < max_print_height-10}G1 Z{z_offset+min(layer_z+70, max_print_height-10)} F600{endif} ; Move print head up\nM84 X Y E ; disable motors
#[printer:*abl*]
@ -906,6 +914,7 @@ printer_model = GMAX2PRO
max_layer_height = 0.7
min_layer_height = 0.08
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_GCREATE\nPRINTER_MODEL_GMAX2PRO
start_gcode = G90\nG28\nM420 Z20\nG1 Z5 F5000
bed_shape = 0x0,457x0,457x457,0x457
max_print_height = 610
@ -929,7 +938,7 @@ printer_model = GMAX2DUAL2IN1
max_layer_height = 0.7
min_layer_height = 0.08
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_GCREATE\nPRINTER_MODEL_GMAX2DUAL2IN1
start_gcode = G90 ;\n G28 ;\n G1 Z5 F5000
start_gcode = G90\nG28\nM420 Z20\nG1 Z5 F5000
bed_shape = 0x0,457x0,457x457,0x457
max_print_height = 610
default_print_profile = 0.20mm - Standard Layers @GCREATE
@ -951,7 +960,7 @@ printer_model = GMAX2DUAL
max_layer_height = 0.7
min_layer_height = 0.08
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_GCREATE\nPRINTER_MODEL_GMAX2DUAL
start_gcode = G90\nG28\nG1 Z5 F5000\nM218 T1 X20 Y0 ; Set second extruder offset
start_gcode = G90\nG28\nM420 Z20\nG1 Z5 F5000\nM218 T1 X20 Y0 ; Set second extruder offset
end_gcode = M104 S0 T0 ; turn off temperature\nM104 S0 T1 ; turn off 2nd extruder\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+5, max_print_height)} F600{endif} ; Move print head up\nG1 X5 Y170 F3000 ; present print\n{if layer_z < max_print_height-10}G1 Z{z_offset+min(layer_z+70, max_print_height-10)} F600{endif} ; Move print head up\nM84 X Y E ; disable motors
bed_shape = 0x0,457x0,457x457,0x457
max_print_height = 610

View file

@ -0,0 +1,13 @@
#version 100
precision highp float;
uniform vec4 top_color;
uniform vec4 bottom_color;
varying vec2 tex_coord;
void main()
{
gl_FragColor = mix(bottom_color, top_color, tex_coord.y);
}

View file

@ -0,0 +1,12 @@
#version 100
attribute vec3 v_position;
attribute vec2 v_tex_coord;
varying vec2 tex_coord;
void main()
{
tex_coord = v_tex_coord;
gl_Position = vec4(v_position, 1.0);
}

View file

@ -0,0 +1,20 @@
#version 100
precision highp float;
// see as reference: https://stackoverflow.com/questions/52928678/dashed-line-in-opengl3
uniform float dash_size;
uniform float gap_size;
uniform vec4 uniform_color;
varying float coord_s;
void main()
{
float inv_stride = 1.0 / (dash_size + gap_size);
if (gap_size > 0.0 && fract(coord_s * inv_stride) > dash_size * inv_stride)
discard;
gl_FragColor = uniform_color;
}

View file

@ -0,0 +1,17 @@
#version 100
// see as reference: https://stackoverflow.com/questions/52928678/dashed-line-in-opengl3
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
// v_position.w = coordinate along the line
attribute vec4 v_position;
varying float coord_s;
void main()
{
coord_s = v_position.w;
gl_Position = projection_matrix * view_model_matrix * vec4(v_position.xyz, 1.0);
}

View file

@ -0,0 +1,10 @@
#version 100
precision highp float;
uniform vec4 uniform_color;
void main()
{
gl_FragColor = uniform_color;
}

View file

@ -0,0 +1,11 @@
#version 100
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
attribute vec3 v_position;
void main()
{
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
}

View file

@ -0,0 +1,17 @@
#version 100
precision highp float;
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
uniform vec4 uniform_color;
varying vec3 clipping_planes_dots;
void main()
{
if (any(lessThan(clipping_planes_dots, ZERO)))
discard;
gl_FragColor = uniform_color;
}

View file

@ -0,0 +1,23 @@
#version 100
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
uniform mat4 volume_world_matrix;
// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane.
uniform vec2 z_range;
// Clipping plane - general orientation. Used by the SLA gizmo.
uniform vec4 clipping_plane;
attribute vec3 v_position;
varying vec3 clipping_planes_dots;
void main()
{
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.
vec4 world_pos = volume_world_matrix * vec4(v_position, 1.0);
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
}

View file

@ -0,0 +1,12 @@
#version 100
precision highp float;
uniform sampler2D uniform_texture;
varying vec2 tex_coord;
void main()
{
gl_FragColor = texture2D(uniform_texture, tex_coord);
}

View file

@ -0,0 +1,15 @@
#version 100
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
attribute vec3 v_position;
attribute vec2 v_tex_coord;
varying vec2 tex_coord;
void main()
{
tex_coord = v_tex_coord;
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
}

View file

@ -0,0 +1,81 @@
#version 100
precision highp float;
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
const float EPSILON = 0.0001;
struct PrintVolumeDetection
{
// 0 = rectangle, 1 = circle, 2 = custom, 3 = invalid
int type;
// type = 0 (rectangle):
// x = min.x, y = min.y, z = max.x, w = max.y
// type = 1 (circle):
// x = center.x, y = center.y, z = radius
vec4 xy_data;
// x = min z, y = max z
vec2 z_data;
};
struct SlopeDetection
{
bool actived;
float normal_z;
mat3 volume_world_normal_matrix;
};
uniform vec4 uniform_color;
uniform SlopeDetection slope;
#ifdef ENABLE_ENVIRONMENT_MAP
uniform sampler2D environment_tex;
uniform bool use_environment_tex;
#endif // ENABLE_ENVIRONMENT_MAP
uniform PrintVolumeDetection print_volume;
varying vec3 clipping_planes_dots;
// x = diffuse, y = specular;
varying vec2 intensity;
varying vec4 world_pos;
varying float world_normal_z;
varying vec3 eye_normal;
void main()
{
if (any(lessThan(clipping_planes_dots, ZERO)))
discard;
vec3 color = uniform_color.rgb;
float alpha = uniform_color.a;
if (slope.actived && world_normal_z < slope.normal_z - EPSILON) {
color = vec3(0.7, 0.7, 1.0);
alpha = 1.0;
}
// if the fragment is outside the print volume -> use darker color
vec3 pv_check_min = ZERO;
vec3 pv_check_max = ZERO;
if (print_volume.type == 0) {
// rectangle
pv_check_min = world_pos.xyz - vec3(print_volume.xy_data.x, print_volume.xy_data.y, print_volume.z_data.x);
pv_check_max = world_pos.xyz - vec3(print_volume.xy_data.z, print_volume.xy_data.w, print_volume.z_data.y);
}
else if (print_volume.type == 1) {
// circle
float delta_radius = print_volume.xy_data.z - distance(world_pos.xy, print_volume.xy_data.xy);
pv_check_min = vec3(delta_radius, 0.0, world_pos.z - print_volume.z_data.x);
pv_check_max = vec3(0.0, 0.0, world_pos.z - print_volume.z_data.y);
}
color = (any(lessThan(pv_check_min, ZERO)) || any(greaterThan(pv_check_max, ZERO))) ? mix(color, ZERO, 0.3333) : color;
#ifdef ENABLE_ENVIRONMENT_MAP
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, alpha);
else
#endif
gl_FragColor = vec4(vec3(intensity.y) + color * intensity.x, alpha);
}

View file

@ -0,0 +1,77 @@
#version 100
#define INTENSITY_CORRECTION 0.6
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SHININESS 20.0
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
//#define LIGHT_FRONT_SPECULAR (0.0 * INTENSITY_CORRECTION)
//#define LIGHT_FRONT_SHININESS 5.0
#define INTENSITY_AMBIENT 0.3
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
struct SlopeDetection
{
bool actived;
float normal_z;
mat3 volume_world_normal_matrix;
};
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
uniform mat3 view_normal_matrix;
uniform mat4 volume_world_matrix;
uniform SlopeDetection slope;
// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane.
uniform vec2 z_range;
// Clipping plane - general orientation. Used by the SLA gizmo.
uniform vec4 clipping_plane;
attribute vec3 v_position;
attribute vec3 v_normal;
// x = diffuse, y = specular;
varying vec2 intensity;
varying vec3 clipping_planes_dots;
varying vec4 world_pos;
varying float world_normal_z;
varying vec3 eye_normal;
void main()
{
// First transform the normal into camera space and normalize the result.
eye_normal = normalize(view_normal_matrix * v_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(eye_normal, LIGHT_TOP_DIR), 0.0);
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
vec4 position = view_model_matrix * vec4(v_position, 1.0);
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), 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(eye_normal, LIGHT_FRONT_DIR), 0.0);
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
// Point in homogenous coordinates.
world_pos = volume_world_matrix * vec4(v_position, 1.0);
// z component of normal vector in world coordinate used for slope shading
world_normal_z = slope.actived ? (normalize(slope.volume_world_normal_matrix * v_normal)).z : 0.0;
gl_Position = projection_matrix * position;
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
}

View file

@ -0,0 +1,14 @@
#version 100
precision highp float;
uniform vec4 uniform_color;
uniform float emission_factor;
// x = tainted, y = specular;
varying vec2 intensity;
void main()
{
gl_FragColor = vec4(vec3(intensity.y) + uniform_color.rgb * (intensity.x + emission_factor), uniform_color.a);
}

View file

@ -0,0 +1,45 @@
#version 100
#define INTENSITY_CORRECTION 0.6
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SHININESS 20.0
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
#define INTENSITY_AMBIENT 0.3
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
uniform mat3 view_normal_matrix;
attribute vec3 v_position;
attribute vec3 v_normal;
// x = tainted, y = specular;
varying vec2 intensity;
void main()
{
// First transform the normal into camera space and normalize the result.
vec3 normal = normalize(view_normal_matrix * v_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);
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
vec4 position = view_model_matrix * vec4(v_position, 1.0);
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, 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);
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
gl_Position = projection_matrix * position;
}

View file

@ -0,0 +1,12 @@
#version 100
uniform vec4 uniform_color;
uniform float emission_factor;
// x = tainted, y = specular;
varying vec2 intensity;
void main()
{
gl_FragColor = vec4(vec3(intensity.y) + uniform_color.rgb * (intensity.x + emission_factor), uniform_color.a);
}

View file

@ -0,0 +1,50 @@
#version 100
#define INTENSITY_CORRECTION 0.6
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SHININESS 20.0
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
#define INTENSITY_AMBIENT 0.3
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
uniform mat3 view_normal_matrix;
// vertex attributes
attribute vec3 v_position;
attribute vec3 v_normal;
// instance attributes
attribute vec3 i_offset;
attribute vec2 i_scales;
// x = tainted, y = specular;
varying vec2 intensity;
void main()
{
// First transform the normal into camera space and normalize the result.
vec3 eye_normal = normalize(view_normal_matrix * v_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(eye_normal, LIGHT_TOP_DIR), 0.0);
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
vec4 world_position = vec4(v_position * vec3(vec2(1.5 * i_scales.x), 1.5 * i_scales.y) + i_offset - vec3(0.0, 0.0, 0.5 * i_scales.y), 1.0);
vec4 eye_position = view_model_matrix * world_position;
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(eye_position.xyz), 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(eye_normal, LIGHT_FRONT_DIR), 0.0);
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
gl_Position = projection_matrix * eye_position;
}

View file

@ -0,0 +1,13 @@
#version 100
precision highp float;
uniform sampler2D Texture;
varying vec2 Frag_UV;
varying vec4 Frag_Color;
void main()
{
gl_FragColor = Frag_Color * texture2D(Texture, Frag_UV.st);
}

View file

@ -0,0 +1,17 @@
#version 100
uniform mat4 ProjMtx;
attribute vec2 Position;
attribute vec2 UV;
attribute vec4 Color;
varying vec2 Frag_UV;
varying vec4 Frag_Color;
void main()
{
Frag_UV = UV;
Frag_Color = Color;
gl_Position = ProjMtx * vec4(Position.xy, 0.0, 1.0);
}

View file

@ -0,0 +1,10 @@
#version 100
precision highp float;
uniform vec4 uniform_color;
void main()
{
gl_FragColor = uniform_color;
}

View file

@ -0,0 +1,15 @@
#version 100
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
uniform float offset;
attribute vec3 v_position;
void main()
{
// Add small epsilon to z to solve z-fighting
vec4 clip_position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
clip_position.z -= offset * abs(clip_position.w);
gl_Position = clip_position;
}

View file

@ -0,0 +1,66 @@
#version 100
#extension GL_OES_standard_derivatives : enable
precision highp float;
#define INTENSITY_CORRECTION 0.6
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SHININESS 20.0
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
#define INTENSITY_AMBIENT 0.3
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
const float EPSILON = 0.0001;
uniform vec4 uniform_color;
uniform bool volume_mirrored;
uniform mat4 view_model_matrix;
uniform mat3 view_normal_matrix;
varying vec3 clipping_planes_dots;
varying vec4 model_pos;
void main()
{
if (any(lessThan(clipping_planes_dots, ZERO)))
discard;
vec3 color = uniform_color.rgb;
float alpha = uniform_color.a;
vec3 triangle_normal = normalize(cross(dFdx(model_pos.xyz), dFdy(model_pos.xyz)));
#ifdef FLIP_TRIANGLE_NORMALS
triangle_normal = -triangle_normal;
#endif
if (volume_mirrored)
triangle_normal = -triangle_normal;
// First transform the normal into camera space and normalize the result.
vec3 eye_normal = normalize(view_normal_matrix * triangle_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(eye_normal, LIGHT_TOP_DIR), 0.0);
// x = diffuse, y = specular;
vec2 intensity = vec2(0.0);
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
vec3 position = (view_model_matrix * model_pos).xyz;
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(eye_normal, LIGHT_FRONT_DIR), 0.0);
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
gl_FragColor = vec4(vec3(intensity.y) + color * intensity.x, alpha);
}

View file

@ -0,0 +1,28 @@
#version 100
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
uniform mat4 volume_world_matrix;
// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane.
uniform vec2 z_range;
// Clipping plane - general orientation. Used by the SLA gizmo.
uniform vec4 clipping_plane;
attribute vec3 v_position;
varying vec3 clipping_planes_dots;
varying vec4 model_pos;
void main()
{
model_pos = vec4(v_position, 1.0);
// Point in homogenous coordinates.
vec4 world_pos = volume_world_matrix * model_pos;
gl_Position = projection_matrix * view_model_matrix * model_pos;
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
}

View file

@ -0,0 +1,38 @@
#version 100
precision highp float;
const vec3 back_color_dark = vec3(0.235, 0.235, 0.235);
const vec3 back_color_light = vec3(0.365, 0.365, 0.365);
uniform sampler2D texture;
uniform bool transparent_background;
uniform bool svg_source;
varying vec2 tex_coord;
vec4 svg_color()
{
// takes foreground from texture
vec4 fore_color = texture2D(texture, tex_coord);
// calculates radial gradient
vec3 back_color = vec3(mix(back_color_light, back_color_dark, smoothstep(0.0, 0.5, length(abs(tex_coord.xy) - vec2(0.5)))));
// blends foreground with background
return vec4(mix(back_color, fore_color.rgb, fore_color.a), transparent_background ? fore_color.a : 1.0);
}
vec4 non_svg_color()
{
// takes foreground from texture
vec4 color = texture2D(texture, tex_coord);
return vec4(color.rgb, transparent_background ? color.a * 0.25 : color.a);
}
void main()
{
vec4 color = svg_source ? svg_color() : non_svg_color();
color.a = transparent_background ? color.a * 0.5 : color.a;
gl_FragColor = color;
}

View file

@ -0,0 +1,15 @@
#version 100
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
attribute vec3 v_position;
attribute vec2 v_tex_coord;
varying vec2 tex_coord;
void main()
{
tex_coord = v_tex_coord;
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
}

View file

@ -0,0 +1,21 @@
#version 100
precision highp float;
const vec4 BLACK = vec4(vec3(0.1), 1.0);
const vec4 WHITE = vec4(vec3(1.0), 1.0);
const float emission_factor = 0.25;
uniform vec3 world_center;
// x = tainted, y = specular;
varying vec2 intensity;
varying vec3 world_position;
void main()
{
vec3 delta = world_position - world_center;
vec4 color = delta.x * delta.y * delta.z > 0.0 ? BLACK : WHITE;
gl_FragColor = vec4(vec3(intensity.y) + color.rgb * (intensity.x + emission_factor), 1.0);
}

View file

@ -0,0 +1,47 @@
#version 100
#define INTENSITY_CORRECTION 0.6
// normalized values for (-0.6/1.31, 0.6/1.31, 1./1.31)
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SHININESS 20.0
// normalized values for (1./1.43, 0.2/1.43, 1./1.43)
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
#define INTENSITY_AMBIENT 0.3
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
uniform mat3 view_normal_matrix;
attribute vec3 v_position;
attribute vec3 v_normal;
// x = tainted, y = specular;
varying vec2 intensity;
varying vec3 world_position;
void main()
{
// First transform the normal into camera space and normalize the result.
vec3 normal = normalize(view_normal_matrix * v_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);
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
vec4 position = view_model_matrix * vec4(v_position, 1.0);
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, 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);
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
world_position = v_position;
gl_Position = projection_matrix * position;
}

View file

@ -0,0 +1,44 @@
#version 100
#extension GL_OES_standard_derivatives : enable
precision highp float;
#define M_PI 3.1415926535897932384626433832795
// 2D texture (1D texture split by the rows) of color along the object Z axis.
uniform sampler2D z_texture;
// Scaling from the Z texture rows coordinate to the normalized texture row coordinate.
uniform float z_to_texture_row;
uniform float z_texture_row_to_normalized;
uniform float z_cursor;
uniform float z_cursor_band_width;
// x = tainted, y = specular;
varying vec2 intensity;
varying float object_z;
void main()
{
float object_z_row = z_to_texture_row * object_z;
// Index of the row in the texture.
float z_texture_row = floor(object_z_row);
// Normalized coordinate from 0. to 1.
float z_texture_col = object_z_row - z_texture_row;
float z_blend = 0.25 * cos(min(M_PI, abs(M_PI * (object_z - z_cursor) * 1.8 / z_cursor_band_width))) + 0.25;
// Calculate level of detail from the object Z coordinate.
// This makes the slowly sloping surfaces to be shown with high detail (with stripes),
// and the vertical surfaces to be shown with low detail (no stripes)
float z_in_cells = object_z_row * 190.;
// Gradient of Z projected on the screen.
float dx_vtc = dFdx(z_in_cells);
float dy_vtc = dFdy(z_in_cells);
float lod = clamp(0.5 * log2(max(dx_vtc * dx_vtc, dy_vtc * dy_vtc)), 0., 1.);
// Sample the Z texture. Texture coordinates are normalized to <0, 1>.
vec4 color = vec4(0.25, 0.25, 0.25, 1.0);
if (z_texture_row >= 0.0)
color = mix(texture2D(z_texture, vec2(z_texture_col, z_texture_row_to_normalized * (z_texture_row + 0.5 )), -10000.),
texture2D(z_texture, vec2(z_texture_col, z_texture_row_to_normalized * (z_texture_row * 2. + 1.)), 10000.), lod);
// Mix the final color.
gl_FragColor = vec4(vec3(intensity.y), 1.0) + intensity.x * mix(color, vec4(1.0, 1.0, 0.0, 1.0), z_blend);
}

View file

@ -0,0 +1,60 @@
#version 100
#define INTENSITY_CORRECTION 0.6
const vec3 LIGHT_TOP_DIR = vec3(-0.4574957, 0.4574957, 0.7624929);
#define LIGHT_TOP_DIFFUSE (0.8 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SPECULAR (0.125 * INTENSITY_CORRECTION)
#define LIGHT_TOP_SHININESS 20.0
const vec3 LIGHT_FRONT_DIR = vec3(0.6985074, 0.1397015, 0.6985074);
#define LIGHT_FRONT_DIFFUSE (0.3 * INTENSITY_CORRECTION)
//#define LIGHT_FRONT_SPECULAR (0.0 * INTENSITY_CORRECTION)
//#define LIGHT_FRONT_SHININESS 5.0
#define INTENSITY_AMBIENT 0.3
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
uniform mat3 view_normal_matrix;
uniform mat4 volume_world_matrix;
uniform float object_max_z;
attribute vec3 v_position;
attribute vec3 v_normal;
attribute vec2 v_tex_coord;
// x = tainted, y = specular;
varying vec2 intensity;
varying float object_z;
void main()
{
// =====================================================
// NOTE:
// when object_max_z > 0.0 we are rendering the overlay
// when object_max_z == 0.0 we are rendering the volumes
// =====================================================
// First transform the normal into camera space and normalize the result.
vec3 normal = (object_max_z > 0.0) ? vec3(0.0, 0.0, 1.0) : normalize(view_normal_matrix * v_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);
intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE;
vec4 position = view_model_matrix * vec4(v_position, 1.0);
intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position.xyz), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS);
// Perform the same lighting calculation for the 2nd light source (no specular)
NdotL = max(dot(normal, LIGHT_FRONT_DIR), 0.0);
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
// Scaled to widths of the Z texture.
object_z = (object_max_z > 0.0) ? object_max_z * v_tex_coord.y : (volume_world_matrix * vec4(v_position, 1.0)).z;
gl_Position = projection_matrix * position;
}

View file

@ -0,0 +1,19 @@
#version 100
#extension GL_OES_standard_derivatives : enable
// see for reference: https://stackoverflow.com/questions/7361582/opengl-debugging-single-pass-wireframe-rendering
precision highp float;
uniform vec4 uniform_color;
varying vec3 barycentric;
void main()
{
float min_dist = min(min(barycentric.x, barycentric.y), barycentric.z);
if (min_dist > 0.5 * fwidth(min_dist))
discard;
gl_FragColor = uniform_color;
}

View file

@ -0,0 +1,20 @@
#version 100
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
uniform float offset;
attribute vec3 v_position;
attribute vec3 v_normal;
attribute vec3 v_extra;
varying vec3 barycentric;
void main()
{
barycentric = v_extra;
// Add small epsilon to z to solve z-fighting
vec4 clip_position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
clip_position.z -= offset * abs(clip_position.w);
gl_Position = clip_position;
}

View file

@ -6,8 +6,6 @@
#include <libslic3r/AABBTreeIndirect.hpp>
#include <libslic3r/SLA/EigenMesh3D.hpp>
#include <Shiny/Shiny.h>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4244)
@ -42,53 +40,42 @@ void profile(const TriangleMesh &mesh)
Eigen::MatrixXd occlusion_output0;
{
AABBTreeIndirect::Tree3f tree;
{
PROFILE_BLOCK(AABBIndirect_Init);
tree = AABBTreeIndirect::build_aabb_tree_over_indexed_triangle_set(mesh.its.vertices, mesh.its.indices);
}
{
PROFILE_BLOCK(EigenMesh3D_AABBIndirectF_AmbientOcclusion);
occlusion_output0.resize(num_vertices, 1);
for (int ivertex = 0; ivertex < num_vertices; ++ ivertex) {
const Eigen::Vector3d origin = mesh.its.vertices[ivertex].template cast<double>();
const Eigen::Vector3d normal = vertex_normals.row(ivertex).template cast<double>();
int num_hits = 0;
for (int s = 0; s < num_samples; s++) {
Eigen::Vector3d d = dirs.row(s);
if(d.dot(normal) < 0) {
// reverse ray
d *= -1;
}
igl::Hit hit;
if (AABBTreeIndirect::intersect_ray_first_hit(mesh.its.vertices, mesh.its.indices, tree, (origin + 1e-4 * d).eval(), d, hit))
++ num_hits;
AABBTreeIndirect::Tree3f tree = AABBTreeIndirect::build_aabb_tree_over_indexed_triangle_set(mesh.its.vertices, mesh.its.indices);
occlusion_output0.resize(num_vertices, 1);
for (int ivertex = 0; ivertex < num_vertices; ++ ivertex) {
const Eigen::Vector3d origin = mesh.its.vertices[ivertex].template cast<double>();
const Eigen::Vector3d normal = vertex_normals.row(ivertex).template cast<double>();
int num_hits = 0;
for (int s = 0; s < num_samples; s++) {
Eigen::Vector3d d = dirs.row(s);
if(d.dot(normal) < 0) {
// reverse ray
d *= -1;
}
occlusion_output0(ivertex) = (double)num_hits/(double)num_samples;
igl::Hit hit;
if (AABBTreeIndirect::intersect_ray_first_hit(mesh.its.vertices, mesh.its.indices, tree, (origin + 1e-4 * d).eval(), d, hit))
++ num_hits;
}
occlusion_output0(ivertex) = (double)num_hits/(double)num_samples;
}
{
PROFILE_BLOCK(EigenMesh3D_AABBIndirectFF_AmbientOcclusion);
occlusion_output0.resize(num_vertices, 1);
for (int ivertex = 0; ivertex < num_vertices; ++ ivertex) {
const Eigen::Vector3d origin = mesh.its.vertices[ivertex].template cast<double>();
const Eigen::Vector3d normal = vertex_normals.row(ivertex).template cast<double>();
int num_hits = 0;
for (int s = 0; s < num_samples; s++) {
Eigen::Vector3d d = dirs.row(s);
if(d.dot(normal) < 0) {
// reverse ray
d *= -1;
}
igl::Hit hit;
if (AABBTreeIndirect::intersect_ray_first_hit(mesh.its.vertices, mesh.its.indices, tree,
Eigen::Vector3f((origin + 1e-4 * d).template cast<float>()),
Eigen::Vector3f(d.template cast<float>()), hit))
++ num_hits;
occlusion_output0.resize(num_vertices, 1);
for (int ivertex = 0; ivertex < num_vertices; ++ ivertex) {
const Eigen::Vector3d origin = mesh.its.vertices[ivertex].template cast<double>();
const Eigen::Vector3d normal = vertex_normals.row(ivertex).template cast<double>();
int num_hits = 0;
for (int s = 0; s < num_samples; s++) {
Eigen::Vector3d d = dirs.row(s);
if(d.dot(normal) < 0) {
// reverse ray
d *= -1;
}
occlusion_output0(ivertex) = (double)num_hits/(double)num_samples;
igl::Hit hit;
if (AABBTreeIndirect::intersect_ray_first_hit(mesh.its.vertices, mesh.its.indices, tree,
Eigen::Vector3f((origin + 1e-4 * d).template cast<float>()),
Eigen::Vector3f(d.template cast<float>()), hit))
++ num_hits;
}
occlusion_output0(ivertex) = (double)num_hits/(double)num_samples;
}
}
@ -100,31 +87,23 @@ void profile(const TriangleMesh &mesh)
vertices.emplace_back(V.row(i).transpose());
for (int i = 0; i < F.rows(); ++ i)
triangles.emplace_back(F.row(i).transpose());
AABBTreeIndirect::Tree3d tree;
{
PROFILE_BLOCK(AABBIndirectD_Init);
tree = AABBTreeIndirect::build_aabb_tree_over_indexed_triangle_set(vertices, triangles);
}
{
PROFILE_BLOCK(EigenMesh3D_AABBIndirectD_AmbientOcclusion);
occlusion_output1.resize(num_vertices, 1);
for (int ivertex = 0; ivertex < num_vertices; ++ ivertex) {
const Eigen::Vector3d origin = V.row(ivertex).template cast<double>();
const Eigen::Vector3d normal = vertex_normals.row(ivertex).template cast<double>();
int num_hits = 0;
for (int s = 0; s < num_samples; s++) {
Eigen::Vector3d d = dirs.row(s);
if(d.dot(normal) < 0) {
// reverse ray
d *= -1;
}
igl::Hit hit;
if (AABBTreeIndirect::intersect_ray_first_hit(vertices, triangles, tree, Eigen::Vector3d(origin + 1e-4 * d), d, hit))
++ num_hits;
AABBTreeIndirect::Tree3d tree = AABBTreeIndirect::build_aabb_tree_over_indexed_triangle_set(vertices, triangles);
occlusion_output1.resize(num_vertices, 1);
for (int ivertex = 0; ivertex < num_vertices; ++ ivertex) {
const Eigen::Vector3d origin = V.row(ivertex).template cast<double>();
const Eigen::Vector3d normal = vertex_normals.row(ivertex).template cast<double>();
int num_hits = 0;
for (int s = 0; s < num_samples; s++) {
Eigen::Vector3d d = dirs.row(s);
if(d.dot(normal) < 0) {
// reverse ray
d *= -1;
}
occlusion_output1(ivertex) = (double)num_hits/(double)num_samples;
igl::Hit hit;
if (AABBTreeIndirect::intersect_ray_first_hit(vertices, triangles, tree, Eigen::Vector3d(origin + 1e-4 * d), d, hit))
++ num_hits;
}
occlusion_output1(ivertex) = (double)num_hits/(double)num_samples;
}
}
@ -133,29 +112,23 @@ void profile(const TriangleMesh &mesh)
Eigen::MatrixXd occlusion_output2;
{
igl::AABB<Eigen::MatrixXd, 3> AABB;
{
PROFILE_BLOCK(EigenMesh3D_AABB_Init);
AABB.init(V, F);
}
{
PROFILE_BLOCK(EigenMesh3D_AABB_AmbientOcclusion);
occlusion_output2.resize(num_vertices, 1);
for (int ivertex = 0; ivertex < num_vertices; ++ ivertex) {
const Eigen::Vector3d origin = V.row(ivertex).template cast<double>();
const Eigen::Vector3d normal = vertex_normals.row(ivertex).template cast<double>();
int num_hits = 0;
for (int s = 0; s < num_samples; s++) {
Eigen::Vector3d d = dirs.row(s);
if(d.dot(normal) < 0) {
// reverse ray
d *= -1;
}
igl::Hit hit;
if (AABB.intersect_ray(V, F, origin + 1e-4 * d, d, hit))
++ num_hits;
AABB.init(V, F);
occlusion_output2.resize(num_vertices, 1);
for (int ivertex = 0; ivertex < num_vertices; ++ ivertex) {
const Eigen::Vector3d origin = V.row(ivertex).template cast<double>();
const Eigen::Vector3d normal = vertex_normals.row(ivertex).template cast<double>();
int num_hits = 0;
for (int s = 0; s < num_samples; s++) {
Eigen::Vector3d d = dirs.row(s);
if(d.dot(normal) < 0) {
// reverse ray
d *= -1;
}
occlusion_output2(ivertex) = (double)num_hits/(double)num_samples;
igl::Hit hit;
if (AABB.intersect_ray(V, F, origin + 1e-4 * d, d, hit))
++ num_hits;
}
occlusion_output2(ivertex) = (double)num_hits/(double)num_samples;
}
}
@ -166,37 +139,28 @@ void profile(const TriangleMesh &mesh)
igl::AABB<MapMatrixXfUnaligned, 3> AABB;
auto vertices = MapMatrixXfUnaligned(mesh.its.vertices.front().data(), mesh.its.vertices.size(), 3);
auto faces = MapMatrixXiUnaligned(mesh.its.indices.front().data(), mesh.its.indices.size(), 3);
{
PROFILE_BLOCK(EigenMesh3D_AABBf_Init);
AABB.init(
vertices,
faces);
}
AABB.init(
vertices,
faces);
{
PROFILE_BLOCK(EigenMesh3D_AABBf_AmbientOcclusion);
occlusion_output3.resize(num_vertices, 1);
for (int ivertex = 0; ivertex < num_vertices; ++ ivertex) {
const Eigen::Vector3d origin = mesh.its.vertices[ivertex].template cast<double>();
const Eigen::Vector3d normal = vertex_normals.row(ivertex).template cast<double>();
int num_hits = 0;
for (int s = 0; s < num_samples; s++) {
Eigen::Vector3d d = dirs.row(s);
if(d.dot(normal) < 0) {
// reverse ray
d *= -1;
}
igl::Hit hit;
if (AABB.intersect_ray(vertices, faces, (origin + 1e-4 * d).eval().template cast<float>(), d.template cast<float>(), hit))
++ num_hits;
occlusion_output3.resize(num_vertices, 1);
for (int ivertex = 0; ivertex < num_vertices; ++ ivertex) {
const Eigen::Vector3d origin = mesh.its.vertices[ivertex].template cast<double>();
const Eigen::Vector3d normal = vertex_normals.row(ivertex).template cast<double>();
int num_hits = 0;
for (int s = 0; s < num_samples; s++) {
Eigen::Vector3d d = dirs.row(s);
if(d.dot(normal) < 0) {
// reverse ray
d *= -1;
}
occlusion_output3(ivertex) = (double)num_hits/(double)num_samples;
igl::Hit hit;
if (AABB.intersect_ray(vertices, faces, (origin + 1e-4 * d).eval().template cast<float>(), d.template cast<float>(), hit))
++ num_hits;
}
occlusion_output3(ivertex) = (double)num_hits/(double)num_samples;
}
}
PROFILE_UPDATE();
PROFILE_OUTPUT(nullptr);
}
int main(const int argc, const char *argv[])

View file

@ -9,7 +9,6 @@ add_subdirectory(boost)
add_subdirectory(clipper)
add_subdirectory(miniz)
add_subdirectory(glu-libtess)
add_subdirectory(Shiny)
add_subdirectory(semver)
add_subdirectory(libigl)
add_subdirectory(hints)
@ -67,6 +66,7 @@ if (SLIC3R_GUI)
if (NOT wxWidgets_FOUND)
message(STATUS "Trying to find wxWidgets in CONFIG mode...")
find_package(wxWidgets 3.2 CONFIG REQUIRED COMPONENTS html adv gl core base)
slic3r_remap_configs(wx::wxhtml wx::wxadv wx::wxgl wx::wxcore wx::wxbase RelWithDebInfo Release)
else ()
include(${wxWidgets_USE_FILE})
endif ()

View file

@ -1,25 +0,0 @@
cmake_minimum_required(VERSION 2.8.12)
project(Shiny)
add_library(Shiny STATIC
Shiny.h
ShinyConfig.h
ShinyData.h
ShinyMacros.h
ShinyManager.c
ShinyManager.h
ShinyNode.c
ShinyNode.h
ShinyNodePool.c
ShinyNodePool.h
ShinyNodeState.c
ShinyNodeState.h
ShinyOutput.c
ShinyOutput.h
ShinyPrereqs.h
ShinyTools.c
ShinyTools.h
ShinyVersion.h
ShinyZone.c
ShinyZone.h
)

View file

@ -1,36 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SHINY_H
#define SHINY_H
/*---------------------------------------------------------------------------*/
#include "ShinyMacros.h"
#ifdef SLIC3R_PROFILE
#include "ShinyManager.h"
#endif /* SLIC3R_PROFILE */
#endif /* SHINY_H */

View file

@ -1,61 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SHINY_CONFIG_H
#define SHINY_CONFIG_H
/*---------------------------------------------------------------------------*/
/* if SHINY_LOOKUP_RATE is defined to TRUE then Shiny will record the success of its hash function. This is useful for debugging. Default is FALSE.
*/
#ifndef SHINY_LOOKUP_RATE
// #define SHINY_LOOKUP_RATE FALSE
#endif
/* if SHINY_HAS_ENABLED is defined to TRUE then Shiny can be enabled and disabled at runtime. TODO: bla bla...
*/
#ifndef SHINY_HAS_ENABLED
// #define SHINY_HAS_ENABLED FALSE
#endif
/* TODO:
*/
#define SHINY_OUTPUT_MODE_FLAT 0x1
/* TODO:
*/
#define SHINY_OUTPUT_MODE_TREE 0x2
/* TODO:
*/
#define SHINY_OUTPUT_MODE_BOTH 0x3
/* TODO:
*/
#ifndef SHINY_OUTPUT_MODE
#define SHINY_OUTPUT_MODE SHINY_OUTPUT_MODE_BOTH
#endif
#endif /* SHINY_CONFIG_H */

View file

@ -1,102 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SHINY_DATA_H
#define SHINY_DATA_H
#include "ShinyPrereqs.h"
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*/
typedef struct {
uint32_t entryCount;
shinytick_t selfTicks;
} ShinyLastData;
/*---------------------------------------------------------------------------*/
typedef struct {
shinytick_t cur;
float avg;
} ShinyTickData;
typedef struct {
uint32_t cur;
float avg;
} ShinyCountData;
typedef struct {
ShinyCountData entryCount;
ShinyTickData selfTicks;
ShinyTickData childTicks;
} ShinyData;
SHINY_INLINE shinytick_t ShinyData_totalTicksCur(const ShinyData *self) {
return self->selfTicks.cur + self->childTicks.cur;
}
SHINY_INLINE float ShinyData_totalTicksAvg(const ShinyData *self) {
return self->selfTicks.avg + self->childTicks.avg;
}
SHINY_INLINE void ShinyData_computeAverage(ShinyData *self, float a_damping) {
self->entryCount.avg = self->entryCount.cur +
a_damping * (self->entryCount.avg - self->entryCount.cur);
self->selfTicks.avg = self->selfTicks.cur +
a_damping * (self->selfTicks.avg - self->selfTicks.cur);
self->childTicks.avg = self->childTicks.cur +
a_damping * (self->childTicks.avg - self->childTicks.cur);
}
SHINY_INLINE void ShinyData_copyAverage(ShinyData *self) {
self->entryCount.avg = (float) self->entryCount.cur;
self->selfTicks.avg = (float) self->selfTicks.cur;
self->childTicks.avg = (float) self->childTicks.cur;
}
SHINY_INLINE void ShinyData_clearAll(ShinyData *self) {
self->entryCount.cur = 0;
self->entryCount.avg = 0;
self->selfTicks.cur = 0;
self->selfTicks.avg = 0;
self->childTicks.cur = 0;
self->childTicks.avg = 0;
}
SHINY_INLINE void ShinyData_clearCurrent(ShinyData *self) {
self->entryCount.cur = 0;
self->selfTicks.cur = 0;
self->childTicks.cur = 0;
}
#if __cplusplus
} /* end of extern "C" */
#endif
#endif /* SHINY_DATA_H */

View file

@ -1,281 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SHINY_MACROS_H
#define SHINY_MACROS_H
#ifdef SLIC3R_PROFILE
#include "ShinyManager.h"
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#define PROFILE_UPDATE() \
ShinyManager_update(&Shiny_instance)
#define PROFILE_SET_DAMPING(floatfrom0to1) \
Shiny_instance.damping = (floatfrom0to1);
#define PROFILE_GET_DAMPING() \
(Shiny_instance.damping)
#define PROFILE_OUTPUT(filename) \
ShinyManager_output(&Shiny_instance, (filename))
#define PROFILE_OUTPUT_STREAM(stream) \
ShinyManager_outputToStream(&Shiny_instance, (stream))
#ifdef __cplusplus
#define PROFILE_GET_TREE_STRING() \
ShinyManager_outputTreeToString(&Shiny_instance)
#define PROFILE_GET_FLAT_STRING() \
ShinyManager_outputFlatToString(&Shiny_instance)
#endif /* __cplusplus */
#define PROFILE_DESTROY() \
ShinyManager_destroy(&Shiny_instance)
#define PROFILE_CLEAR() \
ShinyManager_clear(&Shiny_instance)
#define PROFILE_SORT_ZONES() \
ShinyManager_sortZones(&Shiny_instance)
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#define PROFILE_GET_TOTAL_TICKS_CUR() \
ShinyData_totalTicksCur(&Shiny_instance.rootZone.data)
#define PROFILE_GET_TOTAL_TICKS() \
ShinyData_totalTicksAvg(&Shiny_instance.rootZone.data)
#define PROFILE_GET_PROFILED_TICKS_CUR() \
(Shiny_instance.rootZone.data.selfTicks.cur)
#define PROFILE_GET_PROFILED_TICKS() \
(Shiny_instance.rootZone.data.selfTicks.avg)
#define PROFILE_GET_UNPROFILED_TICKS_CUR() \
(Shiny_instance.rootZone.data.childTicks.cur)
#define PROFILE_GET_UNPROFILED_TICKS() \
(Shiny_instance.rootZone.data.childTicks.avg)
#define PROFILE_GET_SHARED_TOTAL_TICKS_CUR(name) \
ShinyData_totalTicksCur(&(_PROFILE_ID_ZONE_SHARED(name).data))
#define PROFILE_GET_SHARED_TOTAL_TICKS(name) \
ShinyData_totalTicksAvg(&(_PROFILE_ID_ZONE_SHARED(name).data))
#define PROFILE_GET_SHARED_SELF_TICKS_CUR(name) \
(_PROFILE_ID_ZONE_SHARED(name).data.selfTicks.cur)
#define PROFILE_GET_SHARED_SELF_TICKS(name) \
(_PROFILE_ID_ZONE_SHARED(name).data.selfTicks.avg)
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#define PROFILE_IS_SHARED_SELF_BELOW(name, floatfrom0to1) \
ShinyManager_isZoneSelfTimeBelow( \
&Shiny_instance, _PROFILE_ID_ZONE_SHARED(name), floatfrom0to1)
#define PROFILE_IS_SHARED_TOTAL_BELOW(name, floatfrom0to1) \
ShinyManager_isZoneTotalTimeBelow( \
&Shiny_instance, _PROFILE_ID_ZONE_SHARED(name), floatfrom0to1)
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#define PROFILE_END() \
ShinyManager_endCurNode(&Shiny_instance)
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#define PROFILE_BEGIN( name ) \
\
static _PROFILE_ZONE_DEFINE(_PROFILE_ID_ZONE(name), #name); \
_PROFILE_ZONE_BEGIN(_PROFILE_ID_ZONE(name))
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#ifdef __cplusplus
#define PROFILE_BLOCK( name ) \
\
_PROFILE_BLOCK_DEFINE(_PROFILE_ID_BLOCK()); \
PROFILE_BEGIN(name)
#endif /* __cplusplus */
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#ifdef __cplusplus
#define PROFILE_FUNC() \
\
_PROFILE_BLOCK_DEFINE(_PROFILE_ID_BLOCK()); \
static _PROFILE_ZONE_DEFINE(_PROFILE_ID_ZONE_FUNC(), __FUNCTION__); \
_PROFILE_ZONE_BEGIN(_PROFILE_ID_ZONE_FUNC())
#endif /* __cplusplus */
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#define PROFILE_CODE( code ) \
\
do { \
static _PROFILE_ZONE_DEFINE(_PROFILE_ID_ZONE_CODE(), #code); \
_PROFILE_ZONE_BEGIN(_PROFILE_ID_ZONE_CODE()); \
{ code; } \
PROFILE_END(); \
} while(0)
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#define PROFILE_SHARED_EXTERN( name ) \
\
_PROFILE_ZONE_DECLARE(extern, _PROFILE_ID_ZONE_SHARED(name))
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#define PROFILE_SHARED_DEFINE( name ) \
\
_PROFILE_ZONE_DEFINE(_PROFILE_ID_ZONE_SHARED(name), #name)
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#define PROFILE_SHARED_BEGIN( name ) \
\
_PROFILE_ZONE_BEGIN(_PROFILE_ID_ZONE_SHARED(name))
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#ifdef __cplusplus
#define PROFILE_SHARED_BLOCK( name ) \
\
_PROFILE_BLOCK_DEFINE(_PROFILE_ID_BLOCK()); \
_PROFILE_ZONE_BEGIN(_PROFILE_ID_ZONE_SHARED(name))
#endif /* __cplusplus */
/*---------------------------------------------------------------------------*/
/* public preprocessors */
#ifdef SHINY_HAS_ENABLED
#define PROFILE_SET_ENABLED( boolean ) \
Shiny_instance.enabled = boolean
#endif
/*---------------------------------------------------------------------------*/
/* internal preprocessors */
#define _PROFILE_ID_ZONE( name ) __ShinyZone_##name
#define _PROFILE_ID_ZONE_FUNC() __ShinyZoneFunc
#define _PROFILE_ID_ZONE_CODE() __ShinyZoneCode
#define _PROFILE_ID_ZONE_SHARED( name ) name##__ShinyZoneShared
#define _PROFILE_ID_BLOCK() __ShinyBlock
/*---------------------------------------------------------------------------*/
/* internal preprocessor */
#define _PROFILE_ZONE_DEFINE( id, string ) \
\
ShinyZone id = { \
NULL, SHINY_ZONE_STATE_HIDDEN, string, \
{ { 0, 0 }, { 0, 0 }, { 0, 0 } } \
}
/*---------------------------------------------------------------------------*/
/* internal preprocessor */
#define _PROFILE_ZONE_DECLARE( prefix, id ) \
\
prefix ShinyZone id
/*---------------------------------------------------------------------------*/
/* internal preprocessor */
#define _PROFILE_BLOCK_DEFINE( id ) \
\
ShinyEndNodeOnDestruction SHINY_UNUSED id
/*---------------------------------------------------------------------------*/
/* internal preprocessor */
#define _PROFILE_ZONE_BEGIN( id ) \
\
do { \
static ShinyNodeCache cache = &_ShinyNode_dummy; \
ShinyManager_lookupAndBeginNode(&Shiny_instance, &cache, &id); \
} while(0)
/*---------------------------------------------------------------------------*/
#else /* SLIC3R_PROFILE */
#define PROFILE_UPDATE()
#define PROFILE_SET_DAMPING(x)
#define PROFILE_GET_DAMPING() 0.0f
#define PROFILE_OUTPUT(x)
#define PROFILE_OUTPUT_STREAM(x)
#define PROFILE_CLEAR()
#define PROFILE_GET_TREE_STRING() std::string()
#define PROFILE_GET_FLAT_STRING() std::string()
#define PROFILE_DESTROY()
#define PROFILE_BEGIN(name)
#define PROFILE_BLOCK(name)
#define PROFILE_FUNC()
#define PROFILE_CODE(code) do { code; } while (0)
#define PROFILE_SHARED_GLOBAL(name)
#define PROFILE_SHARED_MEMBER(name)
#define PROFILE_SHARED_DEFINE(name)
#define PROFILE_SHARED_BEGIN(name)
#define PROFILE_SHARED_BLOCK(name)
#define PROFILE_SET_ENABLED(boolean)
#endif /* SLIC3R_PROFILE */
#endif /* SHINY_MACROS_H */

View file

@ -1,445 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifdef SLIC3R_PROFILE
#include "ShinyManager.h"
#include <malloc.h>
#include <memory.h>
#include <string.h>
#include <stdio.h>
/*---------------------------------------------------------------------------*/
#define TABLE_SIZE_INIT 256
/*---------------------------------------------------------------------------*/
ShinyManager Shiny_instance = {
#if SHINY_HAS_ENABLED == TRUE
/* enabled = */ false,
#endif
/* _lastTick = */ 0,
/* _curNode = */ &Shiny_instance.rootNode,
/* _tableMask = */ 0,
/* _nodeTable = */ _ShinyManager_dummyNodeTable,
#if SHINY_LOOKUP_RATE == TRUE
/* _lookupCount = */ 0,
/* _lookupSuccessCount = */ 0,
#endif
/* _tableSize = */ 1,
/* nodeCount = */ 1,
/* zoneCount = */ 1,
/* _lastZone = */ &Shiny_instance.rootZone,
/* _lastNodePool = */ NULL,
/* _firstNodePool = */ NULL,
/* rootNode = */ {
/* _last = */ { 0, 0 },
/* zone = */ &Shiny_instance.rootZone,
/* parent = */ &Shiny_instance.rootNode,
/* nextSibling = */ NULL,
/* firstChild = */ NULL,
/* lastChild = */ NULL,
/* childCount = */ 0,
/* entryLevel = */ 0,
/* _cache = */ NULL,
/* data = */ { { 0, 0 }, { 0, 0 }, { 0, 0 } }
},
/* rootZone = */ {
/* next = */ NULL,
/* _state = */ SHINY_ZONE_STATE_HIDDEN,
/* name = */ "<unprofiled>",
/* data = */ { { 0, 0 }, { 0, 0 }, { 0, 0 } }
},
/* damping = */ 0.f, // Damping disabled, every PROFILE_UPDATE will be performed from scratch. Original value: 0.9f
/* _initialized = */ FALSE,
/* _firstUpdate = */ TRUE
};
ShinyNode* _ShinyManager_dummyNodeTable[] = { NULL };
/*---------------------------------------------------------------------------*/
#if SHINY_COMPILER == SHINY_COMPILER_MSVC
# pragma warning (push)
# pragma warning (disable: 4311)
#endif
/* primary hash function */
SHINY_INLINE uint32_t hash_value(void* a_pParent, void* a_pZone) {
uint32_t a = (uint32_t) a_pParent + (uint32_t) a_pZone;
// uint32_t a = *reinterpret_cast<uint32_t*>(&a_pParent) + *reinterpret_cast<uint32_t*>(&a_pZone);
a = (a+0x7ed55d16) + (a<<12);
a = (a^0xc761c23c) ^ (a>>19);
return a;
}
/*
* secondary hash used as index offset: force it to be odd
* so it's relatively prime to the power-of-two table size
*/
SHINY_INLINE uint32_t hash_offset(uint32_t a) {
return ((a << 8) + (a >> 4)) | 1;
}
#if SHINY_COMPILER == SHINY_COMPILER_MSVC
# pragma warning (pop)
#endif
/*---------------------------------------------------------------------------*/
void ShinyManager_preLoad(ShinyManager *self) {
if (!self->_initialized) {
_ShinyManager_init(self);
_ShinyManager_createNodeTable(self, TABLE_SIZE_INIT);
_ShinyManager_createNodePool(self, TABLE_SIZE_INIT / 2);
}
}
/*---------------------------------------------------------------------------*/
void ShinyManager_update(ShinyManager *self) {
#if SHINY_HAS_ENABLED == TRUE
if (!enabled) return;
#endif
_ShinyManager_appendTicksToCurNode(self);
ShinyZone_preUpdateChain(&self->rootZone);
if (self->_firstUpdate || self->damping == 0) {
self->_firstUpdate = FALSE;
ShinyNode_updateTreeClean(&self->rootNode);
ShinyZone_updateChainClean(&self->rootZone);
} else {
ShinyNode_updateTree(&self->rootNode, self->damping);
ShinyZone_updateChain(&self->rootZone, self->damping);
}
}
/*---------------------------------------------------------------------------*/
void ShinyManager_updateClean(ShinyManager *self) {
#if SHINY_HAS_ENABLED == TRUE
if (!enabled) return;
#endif
_ShinyManager_appendTicksToCurNode(self);
ShinyZone_preUpdateChain(&self->rootZone);
self->_firstUpdate = FALSE;
ShinyNode_updateTreeClean(&self->rootNode);
ShinyZone_updateChainClean(&self->rootZone);
}
/*---------------------------------------------------------------------------*/
void ShinyManager_clear(ShinyManager *self) {
ShinyManager_destroy(self);
ShinyManager_preLoad(self);
}
/*---------------------------------------------------------------------------*/
void ShinyManager_destroy(ShinyManager *self) {
ShinyManager_destroyNodes(self);
ShinyManager_resetZones(self);
_ShinyManager_uninit(self);
}
/*---------------------------------------------------------------------------*/
ShinyNode* _ShinyManager_lookupNode(ShinyManager *self, ShinyNodeCache *a_cache, ShinyZone *a_zone) {
uint32_t nHash = hash_value(self->_curNode, a_zone);
uint32_t nIndex = nHash & self->_tableMask;
ShinyNode* pNode = self->_nodeTable[nIndex];
_ShinyManager_incLookup(self);
_ShinyManager_incLookupSuccess(self);
if (pNode) {
uint32_t nStep;
if (ShinyNode_isEqual(pNode, self->_curNode, a_zone)) return pNode; /* found it! */
/* hash collision: */
/* compute a secondary hash function for stepping */
nStep = hash_offset(nHash);
for (;;) {
_ShinyManager_incLookup(self);
nIndex = (nIndex + nStep) & self->_tableMask;
pNode = self->_nodeTable[nIndex];
if (!pNode) break; /* found empty slot */
else if (ShinyNode_isEqual(pNode, self->_curNode, a_zone)) return pNode; /* found it! */
}
/* loop is guaranteed to end because the hash table is never full */
}
if (a_zone->_state == SHINY_ZONE_STATE_HIDDEN) { /* zone is not initialized */
ShinyZone_init(a_zone, self->_lastZone);
self->_lastZone = a_zone;
self->zoneCount++;
if (self->_initialized == FALSE) { /* first time init */
_ShinyManager_init(self);
_ShinyManager_createNodeTable(self, TABLE_SIZE_INIT);
_ShinyManager_createNodePool(self, TABLE_SIZE_INIT / 2);
/* initialization has invalidated nIndex
* we must compute nIndex again
*/
return _ShinyManager_createNode(self, a_cache, a_zone);
}
}
/* Althouth nodeCount is not updated
* it includes rootNode so it adds up.
*
* check if we need to grow the table
* we keep it at most 1/2 full to be very fast
*/
if (self->_tableSize < 2 * self->nodeCount) {
_ShinyManager_resizeNodeTable(self, 2 * self->_tableSize);
_ShinyManager_resizeNodePool(self, self->nodeCount - 1);
/* resize has invalidated nIndex
* we must compute nIndex again
*/
return _ShinyManager_createNode(self, a_cache, a_zone);
}
self->nodeCount++;
{
ShinyNode* pNewNode = ShinyNodePool_newItem(self->_lastNodePool);
ShinyNode_init(pNewNode, self->_curNode, a_zone, a_cache);
self->_nodeTable[nIndex] = pNewNode;
return pNewNode;
}
}
/*---------------------------------------------------------------------------*/
void _ShinyManager_insertNode(ShinyManager *self, ShinyNode* a_pNode) {
uint32_t nHash = hash_value(a_pNode->parent, a_pNode->zone);
uint32_t nIndex = nHash & self->_tableMask;
if (self->_nodeTable[nIndex]) {
uint32_t nStep = hash_offset(nHash);
while (self->_nodeTable[nIndex])
nIndex = (nIndex + nStep) & self->_tableMask;
}
self->_nodeTable[nIndex] = a_pNode;
}
/*---------------------------------------------------------------------------*/
ShinyNode* _ShinyManager_createNode(ShinyManager *self, ShinyNodeCache* a_cache, ShinyZone* a_pZone) {
ShinyNode* pNewNode = ShinyNodePool_newItem(self->_lastNodePool);
ShinyNode_init(pNewNode, self->_curNode, a_pZone, a_cache);
self->nodeCount++;
_ShinyManager_insertNode(self, pNewNode);
return pNewNode;
}
/*---------------------------------------------------------------------------*/
void _ShinyManager_createNodePool(ShinyManager *self, uint32_t a_nCount) {
self->_firstNodePool = ShinyNodePool_create(a_nCount);
self->_lastNodePool = self->_firstNodePool;
}
/*---------------------------------------------------------------------------*/
void _ShinyManager_resizeNodePool(ShinyManager *self, uint32_t a_nCount) {
ShinyNodePool* pPool = ShinyNodePool_create(a_nCount);
self->_lastNodePool->nextPool = pPool;
self->_lastNodePool = pPool;
}
/*---------------------------------------------------------------------------*/
void _ShinyManager_createNodeTable(ShinyManager *self, uint32_t a_nCount) {
self->_tableSize = a_nCount;
self->_tableMask = a_nCount - 1;
self->_nodeTable = (ShinyNodeTable*)
malloc(sizeof(ShinyNode) * a_nCount);
memset(self->_nodeTable, 0, a_nCount * sizeof(ShinyNode*));
}
/*---------------------------------------------------------------------------*/
void _ShinyManager_resizeNodeTable(ShinyManager *self, uint32_t a_nCount) {
ShinyNodePool* pPool;
free(self->_nodeTable);
_ShinyManager_createNodeTable(self, a_nCount);
pPool = self->_firstNodePool;
while (pPool) {
ShinyNode *pIter = ShinyNodePool_firstItem(pPool);
while (pIter != pPool->_nextItem)
_ShinyManager_insertNode(self, pIter++);
pPool = pPool->nextPool;
}
}
/*---------------------------------------------------------------------------*/
void ShinyManager_resetZones(ShinyManager *self) {
ShinyZone_resetChain(&self->rootZone);
self->_lastZone = &self->rootZone;
self->zoneCount = 1;
}
/*---------------------------------------------------------------------------*/
void ShinyManager_destroyNodes(ShinyManager *self) {
if (self->_firstNodePool) {
ShinyNodePool_destroy(self->_firstNodePool);
self->_firstNodePool = NULL;
}
if (self->_nodeTable != _ShinyManager_dummyNodeTable) {
free(self->_nodeTable);
self->_nodeTable = _ShinyManager_dummyNodeTable;
self->_tableSize = 1;
self->_tableMask = 0;
}
self->_curNode = &self->rootNode;
self->nodeCount = 1;
_ShinyManager_init(self);
}
/*---------------------------------------------------------------------------*/
const char* ShinyManager_getOutputErrorString(ShinyManager *self) {
if (self->_firstUpdate) return "!!! Profile data must first be updated !!!";
else if (!self->_initialized) return "!!! No profiles where executed !!!";
else return NULL;
}
/*---------------------------------------------------------------------------*/
#if SHINY_COMPILER == SHINY_COMPILER_MSVC
# pragma warning (push)
# pragma warning (disable: 4996)
#endif
int ShinyManager_output(ShinyManager *self, const char *a_filename) {
if (!a_filename) {
ShinyManager_outputToStream(self, stdout);
} else {
FILE *file = fopen(a_filename, "w");
if (!file) return FALSE;
ShinyManager_outputToStream(self, file);
fclose(file);
}
return TRUE;
}
#if SHINY_COMPILER == SHINY_COMPILER_MSVC
# pragma warning (pop)
#endif
/*---------------------------------------------------------------------------*/
void ShinyManager_outputToStream(ShinyManager *self, FILE *a_stream) {
const char *error = ShinyManager_getOutputErrorString(self);
if (error) {
fwrite(error, 1, strlen(error), a_stream);
fwrite("\n\n", 1, 2, a_stream);
return;
}
#if SHINY_OUTPUT_MODE & SHINY_OUTPUT_MODE_FLAT
ShinyManager_sortZones(self);
{
int size = ShinyPrintZonesSize(self->zoneCount);
char *buffer = (char*) malloc(size);
ShinyPrintZones(buffer, &self->rootZone);
fwrite(buffer, 1, size - 1, a_stream);
fwrite("\n\n", 1, 2, a_stream);
free(buffer);
}
#endif
#if SHINY_OUTPUT_MODE & SHINY_OUTPUT_MODE_TREE
{
int size = ShinyPrintNodesSize(self->nodeCount);
char *buffer = (char*) malloc(size);
ShinyPrintNodes(buffer, &self->rootNode);
fwrite(buffer, 1, size - 1, a_stream);
fwrite("\n\n", 1, 2, a_stream);
free(buffer);
}
#endif
}
#endif /* SLIC3R_PROFILE */

View file

@ -1,263 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SHINY_MANAGER_H
#define SHINY_MANAGER_H
#include "ShinyZone.h"
#include "ShinyNode.h"
#include "ShinyNodePool.h"
#include "ShinyTools.h"
#include "ShinyOutput.h"
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*/
typedef struct {
#ifdef SHINY_HAS_ENABLED
bool enabled;
#endif
shinytick_t _lastTick;
ShinyNode* _curNode;
uint32_t _tableMask; /* = _tableSize - 1 */
ShinyNodeTable* _nodeTable;
#ifdef SHINY_LOOKUP_RATE
uint64_t _lookupCount;
uint64_t _lookupSuccessCount;
#endif
uint32_t _tableSize;
uint32_t nodeCount;
uint32_t zoneCount;
ShinyZone* _lastZone;
ShinyNodePool* _lastNodePool;
ShinyNodePool* _firstNodePool;
ShinyNode rootNode;
ShinyZone rootZone;
float damping;
int _initialized;
int _firstUpdate;
} ShinyManager;
/*---------------------------------------------------------------------------*/
extern ShinyNode* _ShinyManager_dummyNodeTable[];
extern ShinyManager Shiny_instance;
/*---------------------------------------------------------------------------*/
SHINY_INLINE void _ShinyManager_appendTicksToCurNode(ShinyManager *self) {
shinytick_t curTick;
ShinyGetTicks(&curTick);
ShinyNode_appendTicks(self->_curNode, curTick - self->_lastTick);
self->_lastTick = curTick;
}
SHINY_API ShinyNode* _ShinyManager_lookupNode(ShinyManager *self, ShinyNodeCache* a_cache, ShinyZone* a_zone);
SHINY_API void _ShinyManager_createNodeTable(ShinyManager *self, uint32_t a_count);
SHINY_API void _ShinyManager_resizeNodeTable(ShinyManager *self, uint32_t a_count);
SHINY_API void _ShinyManager_createNodePool(ShinyManager *self, uint32_t a_count);
SHINY_API void _ShinyManager_resizeNodePool(ShinyManager *self, uint32_t a_count);
SHINY_API ShinyNode* _ShinyManager_createNode(ShinyManager *self, ShinyNodeCache* a_cache, ShinyZone* a_pZone);
SHINY_API void _ShinyManager_insertNode(ShinyManager *self, ShinyNode* a_pNode);
SHINY_INLINE void _ShinyManager_init(ShinyManager *self) {
self->_initialized = TRUE;
self->rootNode._last.entryCount = 1;
self->rootNode._last.selfTicks = 0;
ShinyGetTicks(&self->_lastTick);
}
SHINY_INLINE void _ShinyManager_uninit(ShinyManager *self) {
self->_initialized = FALSE;
ShinyNode_clear(&self->rootNode);
self->rootNode.parent = &self->rootNode;
self->rootNode.zone = &self->rootZone;
}
#ifdef SHINY_LOOKUP_RATE
SHINY_INLINE void _ShinyManager_incLookup(ShinyManager *self) { self->_lookupCount++; }
SHINY_INLINE void _ShinyManager_incLookupSuccess(ShinyManager *self) { self->_lookupSuccessCount++; }
SHINY_INLINE float ShinyManager_lookupRate(const ShinyManager *self) { return ((float) self->_lookupSuccessCount) / ((float) self->_lookupCount); }
#else
SHINY_INLINE void _ShinyManager_incLookup(ShinyManager * self) { self = self; }
SHINY_INLINE void _ShinyManager_incLookupSuccess(ShinyManager * self) { self = self; }
SHINY_INLINE float ShinyManager_lookupRate(const ShinyManager * self) { self = self; return -1; }
#endif
SHINY_API void ShinyManager_resetZones(ShinyManager *self);
SHINY_API void ShinyManager_destroyNodes(ShinyManager *self);
SHINY_INLINE float ShinyManager_tableUsage(const ShinyManager *self) {
return ((float) self->nodeCount) / ((float) self->_tableSize);
}
SHINY_INLINE uint32_t ShinyManager_allocMemInBytes(const ShinyManager *self) {
return self->_tableSize * sizeof(ShinyNode*)
+ (self->_firstNodePool)? ShinyNodePool_memoryUsageChain(self->_firstNodePool) : 0;
}
SHINY_INLINE void ShinyManager_beginNode(ShinyManager *self, ShinyNode* a_node) {
ShinyNode_beginEntry(a_node);
_ShinyManager_appendTicksToCurNode(self);
self->_curNode = a_node;
}
SHINY_INLINE void ShinyManager_lookupAndBeginNode(ShinyManager *self, ShinyNodeCache* a_cache, ShinyZone* a_zone) {
#ifdef SHINY_HAS_ENABLED
if (!self->enabled) return;
#endif
if (self->_curNode != (*a_cache)->parent)
*a_cache = _ShinyManager_lookupNode(self, a_cache, a_zone);
ShinyManager_beginNode(self, *a_cache);
}
SHINY_INLINE void ShinyManager_endCurNode(ShinyManager *self) {
#ifdef SHINY_HAS_ENABLED
if (!self->enabled) return;
#endif
_ShinyManager_appendTicksToCurNode(self);
self->_curNode = self->_curNode->parent;
}
/**/
SHINY_API void ShinyManager_preLoad(ShinyManager *self);
SHINY_API void ShinyManager_updateClean(ShinyManager *self);
SHINY_API void ShinyManager_update(ShinyManager *self);
SHINY_API void ShinyManager_clear(ShinyManager *self);
SHINY_API void ShinyManager_destroy(ShinyManager *self);
SHINY_INLINE void ShinyManager_sortZones(ShinyManager *self) {
if (self->rootZone.next)
self->_lastZone = ShinyZone_sortChain(&self->rootZone.next);
}
SHINY_API const char* ShinyManager_getOutputErrorString(ShinyManager *self);
SHINY_API int ShinyManager_output(ShinyManager *self, const char *a_filename);
SHINY_API void ShinyManager_outputToStream(ShinyManager *self, FILE *stream);
#if __cplusplus
} /* end of extern "C" */
SHINY_INLINE std::string ShinyManager_outputTreeToString(ShinyManager *self) {
const char* error = ShinyManager_getOutputErrorString(self);
if (error) return error;
else return ShinyNodesToString(&self->rootNode, self->nodeCount);
}
SHINY_INLINE std::string ShinyManager_outputFlatToString(ShinyManager *self) {
const char* error = ShinyManager_getOutputErrorString(self);
if (error) return error;
ShinyManager_sortZones(self);
return ShinyZonesToString(&self->rootZone, self->zoneCount);
}
extern "C" { /* end of c++ */
#endif
SHINY_INLINE int ShinyManager_isZoneSelfTimeBelow(ShinyManager *self, ShinyZone* a_zone, float a_percentage) {
return a_percentage * (float) self->rootZone.data.childTicks.cur
<= (float) a_zone->data.selfTicks.cur;
}
SHINY_INLINE int ShinyManager_isZoneTotalTimeBelow(ShinyManager *self, ShinyZone* a_zone, float a_percentage) {
return a_percentage * (float) self->rootZone.data.childTicks.cur
<= (float) ShinyData_totalTicksCur(&a_zone->data);
}
/**/
SHINY_INLINE void ShinyManager_enumerateNodes(ShinyManager *self, void (*a_func)(const ShinyNode*)) {
ShinyNode_enumerateNodes(&self->rootNode, a_func);
}
SHINY_INLINE void ShinyManager_enumerateZones(ShinyManager *self, void (*a_func)(const ShinyZone*)) {
ShinyZone_enumerateZones(&self->rootZone, a_func);
}
#if __cplusplus
} /* end of extern "C" */
template <class T> void ShinyManager_enumerateNodes(ShinyManager *self, T* a_this, void (T::*a_func)(const ShinyNode*)) {
ShinyNode_enumerateNodes(&self->rootNode, a_this, a_func);
}
template <class T> void ShinyManager_enumerateZones(ShinyManager *self, T* a_this, void (T::*a_func)(const ShinyZone*)) {
ShinyZone_enumerateZones(&self->rootZone, a_this, a_func);
}
extern "C" { /* end of c++ */
#endif
/*---------------------------------------------------------------------------*/
#if __cplusplus
} /* end of extern "C" */
class ShinyEndNodeOnDestruction {
public:
SHINY_INLINE ~ShinyEndNodeOnDestruction() {
ShinyManager_endCurNode(&Shiny_instance);
}
};
#endif
#endif /* SHINY_MANAGER_H */

View file

@ -1,129 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifdef SLIC3R_PROFILE
#include "ShinyNode.h"
#include "ShinyZone.h"
#include "ShinyNodeState.h"
#include <memory.h>
/*---------------------------------------------------------------------------*/
ShinyNode _ShinyNode_dummy = {
/* _last = */ { 0, 0 },
/* zone = */ NULL,
/* parent = */ NULL,
/* nextSibling = */ NULL,
/* firstChild = */ NULL,
/* lastChild = */ NULL
};
/*---------------------------------------------------------------------------*/
void ShinyNode_updateTree(ShinyNode* first, float a_damping) {
ShinyNodeState *top = NULL;
ShinyNode *node = first;
for (;;) {
do {
top = ShinyNodeState_push(top, node);
node = node->firstChild;
} while (node);
for (;;) {
node = ShinyNodeState_finishAndGetNext(top, a_damping);
top = ShinyNodeState_pop(top);
if (node) break;
else if (!top) return;
}
}
}
/*---------------------------------------------------------------------------*/
void ShinyNode_updateTreeClean(ShinyNode* first) {
ShinyNodeState *top = NULL;
ShinyNode *node = first;
for (;;) {
do {
top = ShinyNodeState_push(top, node);
node = node->firstChild;
} while (node);
for (;;) {
node = ShinyNodeState_finishAndGetNextClean(top);
top = ShinyNodeState_pop(top);
if (node) break;
else if (!top) return;
}
}
}
/*---------------------------------------------------------------------------*/
const ShinyNode* ShinyNode_findNextInTree(const ShinyNode* self) {
if (self->firstChild) {
return self->firstChild;
} else if (self->nextSibling) {
return self->nextSibling;
} else {
ShinyNode* pParent = self->parent;
while (!ShinyNode_isRoot(pParent)) {
if (pParent->nextSibling) return pParent->nextSibling;
else pParent = pParent->parent;
}
return NULL;
}
}
/*---------------------------------------------------------------------------*/
void ShinyNode_clear(ShinyNode* self) {
memset(self, 0, sizeof(ShinyNode));
}
/*---------------------------------------------------------------------------*/
void ShinyNode_enumerateNodes(const ShinyNode* a_node, void (*a_func)(const ShinyNode*)) {
a_func(a_node);
if (a_node->firstChild) ShinyNode_enumerateNodes(a_node->firstChild, a_func);
if (a_node->nextSibling) ShinyNode_enumerateNodes(a_node->nextSibling, a_func);
}
#endif /* SLIC3R_PROFILE */

View file

@ -1,133 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SHINY_NODE_H
#define SHINY_NODE_H
#include "ShinyData.h"
#include "ShinyTools.h"
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*/
typedef struct _ShinyNode {
ShinyLastData _last;
struct _ShinyZone* zone;
struct _ShinyNode* parent;
struct _ShinyNode* nextSibling;
struct _ShinyNode* firstChild;
struct _ShinyNode* lastChild;
uint32_t childCount;
uint32_t entryLevel;
ShinyNodeCache* _cache;
ShinyData data;
} ShinyNode;
/*---------------------------------------------------------------------------*/
extern ShinyNode _ShinyNode_dummy;
/*---------------------------------------------------------------------------*/
SHINY_INLINE void ShinyNode_addChild(ShinyNode* self, ShinyNode* a_child) {
if (self->childCount++) {
self->lastChild->nextSibling = a_child;
self->lastChild = a_child;
} else {
self->lastChild = a_child;
self->firstChild = a_child;
}
}
SHINY_INLINE void ShinyNode_init(ShinyNode* self, ShinyNode* a_parent, struct _ShinyZone* a_zone, ShinyNodeCache* a_cache) {
/* NOTE: all member variables are assumed to be zero when allocated */
self->zone = a_zone;
self->parent = a_parent;
self->entryLevel = a_parent->entryLevel + 1;
ShinyNode_addChild(a_parent, self);
self->_cache = a_cache;
}
SHINY_API void ShinyNode_updateTree(ShinyNode* self, float a_damping);
SHINY_API void ShinyNode_updateTreeClean(ShinyNode* self);
SHINY_INLINE void ShinyNode_destroy(ShinyNode* self) {
*(self->_cache) = &_ShinyNode_dummy;
}
SHINY_INLINE void ShinyNode_appendTicks(ShinyNode* self, shinytick_t a_elapsedTicks) {
self->_last.selfTicks += a_elapsedTicks;
}
SHINY_INLINE void ShinyNode_beginEntry(ShinyNode* self) {
self->_last.entryCount++;
}
SHINY_INLINE int ShinyNode_isRoot(ShinyNode* self) {
return (self->entryLevel == 0);
}
SHINY_INLINE int ShinyNode_isDummy(ShinyNode* self) {
return (self == &_ShinyNode_dummy);
}
SHINY_INLINE int ShinyNode_isEqual(ShinyNode* self, const ShinyNode* a_parent, const struct _ShinyZone* a_zone) {
return (self->parent == a_parent && self->zone == a_zone);
}
SHINY_API const ShinyNode* ShinyNode_findNextInTree(const ShinyNode* self);
SHINY_API void ShinyNode_clear(ShinyNode* self);
SHINY_API void ShinyNode_enumerateNodes(const ShinyNode* a_node, void (*a_func)(const ShinyNode*));
#if __cplusplus
} /* end of extern "C" */
template <class T>
void ShinyNode_enumerateNodes(const ShinyNode* a_node, T* a_this, void (T::*a_func)(const ShinyNode*)) {
(a_this->*a_func)(a_node);
if (a_node->firstChild) ShinyNode_enumerateNodes(a_node->firstChild, a_this, a_func);
if (a_node->nextSibling) ShinyNode_enumerateNodes(a_node->nextSibling, a_this, a_func);
}
#endif /* __cplusplus */
#endif /* SHINY_NODE_H */

View file

@ -1,77 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifdef SLIC3R_PROFILE
#include "ShinyNodePool.h"
#include "ShinyTools.h"
#include <memory.h>
#include <malloc.h>
/*---------------------------------------------------------------------------*/
ShinyNodePool* ShinyNodePool_create(uint32_t a_items) {
ShinyNodePool* pPool = (ShinyNodePool*)
malloc(sizeof(ShinyNodePool) + sizeof(ShinyNode) * (a_items - 1));
pPool->nextPool = NULL;
pPool->_nextItem = &pPool->_items[0];
pPool->endOfItems = &pPool->_items[a_items];
memset(&pPool->_items[0], 0, a_items * sizeof(ShinyNode));
return pPool;
}
/*---------------------------------------------------------------------------*/
uint32_t ShinyNodePool_memoryUsageChain(ShinyNodePool *first) {
uint32_t bytes = (uint32_t) ((char*) first->endOfItems - (char*) first);
ShinyNodePool *pool = first->nextPool;
while (pool) {
bytes += (uint32_t) ((char*) pool->endOfItems - (char*) pool);
pool = pool->nextPool;
}
return bytes;
}
/*---------------------------------------------------------------------------*/
void ShinyNodePool_destroy(ShinyNodePool *self) {
ShinyNode* firstNode = ShinyNodePool_firstItem(self);
ShinyNode* lastNode = self->_nextItem;
while (firstNode != lastNode)
ShinyNode_destroy(firstNode++);
/* TODO: make this into a loop or a tail recursion */
if (self->nextPool) ShinyNodePool_destroy(self->nextPool);
free(self);
}
#endif /* SLIC3R_PROFILE */

View file

@ -1,67 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SHINY_NODE_POOL_H
#define SHINY_NODE_POOL_H
#include "ShinyNode.h"
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*/
typedef struct _ShinyNodePool {
struct _ShinyNodePool* nextPool;
ShinyNode *_nextItem;
ShinyNode *endOfItems;
ShinyNode _items[1];
} ShinyNodePool;
/*---------------------------------------------------------------------------*/
SHINY_INLINE ShinyNode* ShinyNodePool_firstItem(ShinyNodePool *self) {
return &(self->_items[0]);
}
SHINY_INLINE ShinyNode* ShinyNodePool_newItem(ShinyNodePool *self) {
return self->_nextItem++;
}
ShinyNodePool* ShinyNodePool_create(uint32_t a_items);
void ShinyNodePool_destroy(ShinyNodePool *self);
uint32_t ShinyNodePool_memoryUsageChain(ShinyNodePool *first);
#if __cplusplus
} /* end of extern "C" */
#endif
#endif /* SHINY_NODE_POOL_H */

View file

@ -1,108 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifdef SLIC3R_PROFILE
#include "ShinyNodeState.h"
#include "ShinyNode.h"
#include "ShinyZone.h"
#include <malloc.h>
/*---------------------------------------------------------------------------*/
ShinyNodeState* ShinyNodeState_push(ShinyNodeState *a_top, ShinyNode *a_node) {
ShinyZone *zone = a_node->zone;
ShinyNodeState *self = (ShinyNodeState*) malloc(sizeof(ShinyNodeState));
self->node = a_node;
self->_prev = a_top;
a_node->data.selfTicks.cur = a_node->_last.selfTicks;
a_node->data.entryCount.cur = a_node->_last.entryCount;
zone->data.selfTicks.cur += a_node->_last.selfTicks;
zone->data.entryCount.cur += a_node->_last.entryCount;
a_node->data.childTicks.cur = 0;
a_node->_last.selfTicks = 0;
a_node->_last.entryCount = 0;
self->zoneUpdating = zone->_state != SHINY_ZONE_STATE_UPDATING;
if (self->zoneUpdating) {
zone->_state = SHINY_ZONE_STATE_UPDATING;
} else {
zone->data.childTicks.cur -= a_node->data.selfTicks.cur;
}
return self;
}
/*---------------------------------------------------------------------------*/
ShinyNodeState* ShinyNodeState_pop(ShinyNodeState *a_top) {
ShinyNodeState *prev = a_top->_prev;
free(a_top);
return prev;
}
/*---------------------------------------------------------------------------*/
ShinyNode* ShinyNodeState_finishAndGetNext(ShinyNodeState *self, float a_damping) {
ShinyNode *node = self->node;
ShinyZone *zone = node->zone;
if (self->zoneUpdating) {
zone->data.childTicks.cur += node->data.childTicks.cur;
zone->_state = SHINY_ZONE_STATE_INITIALIZED;
}
ShinyData_computeAverage(&node->data, a_damping);
if (!ShinyNode_isRoot(node))
node->parent->data.childTicks.cur += node->data.selfTicks.cur + node->data.childTicks.cur;
return node->nextSibling;
}
/*---------------------------------------------------------------------------*/
ShinyNode* ShinyNodeState_finishAndGetNextClean(ShinyNodeState *self) {
ShinyNode *node = self->node;
ShinyZone *zone = node->zone;
if (self->zoneUpdating) {
zone->data.childTicks.cur += node->data.childTicks.cur;
zone->_state = SHINY_ZONE_STATE_INITIALIZED;
}
ShinyData_copyAverage(&node->data);
if (!ShinyNode_isRoot(node))
node->parent->data.childTicks.cur += node->data.selfTicks.cur + node->data.childTicks.cur;
return node->nextSibling;
}
#endif /* SLIC3R_PROFILE */

View file

@ -1,56 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SHINY_NODE_STATE_H
#define SHINY_NODE_STATE_H
#include "ShinyNode.h"
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*/
typedef struct _ShinyNodeState {
ShinyNode *node;
int zoneUpdating;
struct _ShinyNodeState *_prev;
} ShinyNodeState;
/*---------------------------------------------------------------------------*/
ShinyNodeState* ShinyNodeState_push(ShinyNodeState *a_top, ShinyNode *a_node);
ShinyNodeState* ShinyNodeState_pop(ShinyNodeState *a_top);
ShinyNode* ShinyNodeState_finishAndGetNext(ShinyNodeState *self, float a_damping);
ShinyNode* ShinyNodeState_finishAndGetNextClean(ShinyNodeState *self);
#if __cplusplus
} /* end of extern "C" */
#endif
#endif /* SHINY_NODE_STATE_H */

View file

@ -1,189 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifdef SLIC3R_PROFILE
#include "ShinyOutput.h"
#include <stdio.h>
#if SHINY_COMPILER == SHINY_COMPILER_MSVC
# pragma warning(disable: 4996)
# define snprintf _snprintf
# define TRAILING 0
#else
# define TRAILING 1
#endif
/*---------------------------------------------------------------------------*/
#define OUTPUT_WIDTH_CALL 6
#define OUTPUT_WIDTH_TIME (6+3)
#define OUTPUT_WIDTH_PERC (4+3)
#define OUTPUT_WIDTH_SUM 120
#define OUTPUT_WIDTH_DATA (1+OUTPUT_WIDTH_CALL + 1 + 2*(OUTPUT_WIDTH_TIME+4+OUTPUT_WIDTH_PERC+1) + 1)
#define OUTPUT_WIDTH_NAME (OUTPUT_WIDTH_SUM - OUTPUT_WIDTH_DATA)
/*---------------------------------------------------------------------------*/
SHINY_INLINE char* printHeader(char *output, const char *a_title) {
snprintf(output, OUTPUT_WIDTH_SUM + TRAILING,
"%-*s %*s %*s %*s",
OUTPUT_WIDTH_NAME, a_title,
OUTPUT_WIDTH_CALL, "calls",
OUTPUT_WIDTH_TIME+4+OUTPUT_WIDTH_PERC+1, "self time",
OUTPUT_WIDTH_TIME+4+OUTPUT_WIDTH_PERC+1, "total time");
return output + OUTPUT_WIDTH_SUM;
}
/*---------------------------------------------------------------------------*/
SHINY_INLINE char* printData(char *output, const ShinyData *a_data, float a_topercent) {
float totalTicksAvg = ShinyData_totalTicksAvg(a_data);
const ShinyTimeUnit *selfUnit = ShinyGetTimeUnit(a_data->selfTicks.avg);
const ShinyTimeUnit *totalUnit = ShinyGetTimeUnit(totalTicksAvg);
snprintf(output, OUTPUT_WIDTH_DATA + TRAILING,
" %*.1f %*.2f %-2s %*.2f%% %*.2f %-2s %*.2f%%",
OUTPUT_WIDTH_CALL, a_data->entryCount.avg,
OUTPUT_WIDTH_TIME, a_data->selfTicks.avg * selfUnit->invTickFreq, selfUnit->suffix,
OUTPUT_WIDTH_PERC, a_data->selfTicks.avg * a_topercent,
OUTPUT_WIDTH_TIME, totalTicksAvg * totalUnit->invTickFreq, totalUnit->suffix,
OUTPUT_WIDTH_PERC, totalTicksAvg * a_topercent);
return output + OUTPUT_WIDTH_DATA;
}
/*---------------------------------------------------------------------------*/
SHINY_INLINE char* printNode(char* output, const ShinyNode *a_node, float a_topercent) {
int offset = a_node->entryLevel * 2;
snprintf(output, OUTPUT_WIDTH_NAME + TRAILING, "%*s%-*s",
offset, "", OUTPUT_WIDTH_NAME - offset, a_node->zone->name);
output += OUTPUT_WIDTH_NAME;
output = printData(output, &a_node->data, a_topercent);
return output;
}
/*---------------------------------------------------------------------------*/
SHINY_INLINE char* printZone(char* output, const ShinyZone *a_zone, float a_topercent) {
snprintf(output, OUTPUT_WIDTH_NAME + TRAILING, "%-*s",
OUTPUT_WIDTH_NAME, a_zone->name);
output += OUTPUT_WIDTH_NAME;
output = printData(output, &a_zone->data, a_topercent);
return output;
}
/*---------------------------------------------------------------------------*/
int ShinyPrintNodesSize(uint32_t a_count) {
return (1 + a_count) * (OUTPUT_WIDTH_SUM + 1);
}
/*---------------------------------------------------------------------------*/
int ShinyPrintZonesSize(uint32_t a_count) {
return (1 + a_count) * (OUTPUT_WIDTH_SUM + 1);
}
/*---------------------------------------------------------------------------*/
void ShinyPrintANode(char* output, const ShinyNode *a_node, const ShinyNode *a_root) {
float fTicksToPc = 100.0f / a_root->data.childTicks.avg;
output = printNode(output, a_node, fTicksToPc);
(*output++) = '\0';
}
/*---------------------------------------------------------------------------*/
void ShinyPrintAZone(char* output, const ShinyZone *a_zone, const ShinyZone *a_root) {
float fTicksToPc = 100.0f / a_root->data.childTicks.avg;
output = printZone(output, a_zone, fTicksToPc);
(*output++) = '\0';
}
/*---------------------------------------------------------------------------*/
void ShinyPrintNodes(char* output, const ShinyNode *a_root) {
float fTicksToPc = 100.0f / a_root->data.childTicks.avg;
const ShinyNode *node = a_root;
output = printHeader(output, "call tree");
(*output++) = '\n';
for (;;) {
output = printNode(output, node, fTicksToPc);
node = ShinyNode_findNextInTree(node);
if (node) {
(*output++) = '\n';
} else {
(*output++) = '\0';
return;
}
}
}
/*---------------------------------------------------------------------------*/
void ShinyPrintZones(char* output, const ShinyZone *a_root) {
float fTicksToPc = 100.0f / a_root->data.childTicks.avg;
const ShinyZone *zone = a_root;
output = printHeader(output, "sorted list");
(*output++) = '\n';
for (;;) {
output = printZone(output, zone, fTicksToPc);
zone = zone->next;
if (zone) {
(*output++) = '\n';
} else {
(*output++) = '\0';
return;
}
}
}
#endif /* SLIC3R_PROFILE */

View file

@ -1,68 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SHINY_OUTPUT_H
#define SHINY_OUTPUT_H
#include "ShinyNode.h"
#include "ShinyZone.h"
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*/
SHINY_API int ShinyPrintNodesSize(uint32_t a_count);
SHINY_API int ShinyPrintZonesSize(uint32_t a_count);
SHINY_API void ShinyPrintANode(char* output, const ShinyNode *a_node, const ShinyNode *a_root);
SHINY_API void ShinyPrintAZone(char* output, const ShinyZone *a_zone, const ShinyZone *a_root);
SHINY_API void ShinyPrintNodes(char* output, const ShinyNode *a_root);
SHINY_API void ShinyPrintZones(char* output, const ShinyZone *a_root);
/*---------------------------------------------------------------------------*/
#if __cplusplus
} /* end of extern "C" */
#include <string>
SHINY_INLINE std::string ShinyNodesToString(const ShinyNode *a_root, uint32_t a_count) {
std::string str;
str.resize(ShinyPrintNodesSize(a_count) - 1);
ShinyPrintNodes(&str[0], a_root);
return str;
}
SHINY_INLINE std::string ShinyZonesToString(const ShinyZone *a_root, uint32_t a_count) {
std::string str;
str.resize(ShinyPrintZonesSize(a_count) - 1);
ShinyPrintZones(&str[0], a_root);
return str;
}
#endif /* __cplusplus */
#endif /* SHINY_OUTPUT_H */

View file

@ -1,138 +0,0 @@
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SHINY_PREREQS_H
#define SHINY_PREREQS_H
#include <stdint.h>
/*---------------------------------------------------------------------------*/
#ifndef FALSE
#define FALSE 0x0
#endif
#ifndef TRUE
#define TRUE 0x1
#endif
#ifndef NULL
#define NULL 0
#endif
#include "ShinyConfig.h"
#include "ShinyVersion.h"
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*/
#define SHINY_PLATFORM_WIN32 0x1
#define SHINY_PLATFORM_POSIX 0x2
#if defined (_WIN32)
# define SHINY_PLATFORM SHINY_PLATFORM_WIN32
#else /* ASSUME: POSIX-compliant OS */
# define SHINY_PLATFORM SHINY_PLATFORM_POSIX
#endif
/*---------------------------------------------------------------------------*/
#define SHINY_COMPILER_MSVC 0x1
#define SHINY_COMPILER_GNUC 0x2
#define SHINY_COMPILER_OTHER 0x3
#if defined (_MSC_VER)
# define SHINY_COMPILER SHINY_COMPILER_MSVC
#elif defined (__GNUG__)
# define SHINY_COMPILER SHINY_COMPILER_GNUC
#else
# define SHINY_COMPILER SHINY_COMPILER_OTHER
#endif
/*---------------------------------------------------------------------------*/
#if SHINY_COMPILER == SHINY_COMPILER_GNUC
#include <sys/types.h>
#include <stdint.h>
#endif
/*---------------------------------------------------------------------------*/
struct _ShinyNode;
struct _ShinyZone;
typedef struct _ShinyNode* ShinyNodeCache;
typedef struct _ShinyNode* ShinyNodeTable;
/*---------------------------------------------------------------------------*/
#define SHINY_API
/*---------------------------------------------------------------------------*/
#if SHINY_COMPILER == SHINY_COMPILER_MSVC
# define SHINY_INLINE __inline
# define SHINY_UNUSED
#elif SHINY_COMPILER == SHINY_COMPILER_GNUC
# define SHINY_INLINE inline
# define SHINY_UNUSED __attribute__((unused))
#elif SHINY_COMPILER == SHINY_COMPILER_OTHER
# define SHINY_INLINE inline
# define SHINY_UNUSED
#endif
/*---------------------------------------------------------------------------*/
#if SHINY_COMPILER == SHINY_COMPILER_MSVC
typedef int int32_t;
typedef unsigned int uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
/*
#elif defined(__CYGWIN__)
typedef u_int32_t uint32_t;
typedef u_int64_t uint64_t;
*/
#endif
typedef uint64_t shinytick_t;
#if __cplusplus
} /* end of extern "C" */
#endif
#endif /* SHINY_PREREQS_H */

Some files were not shown because too many files have changed in this diff Show more