Merge commit '305ccfd9072dffdad7a9c6fa4b3e881d830daee8'
also add a better message when a config bundle is problematic.
@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(Slic3r)
|
||||
|
||||
include("version.inc")
|
||||
@ -102,7 +102,7 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/)
|
||||
enable_testing ()
|
||||
|
||||
# Enable C++11 language standard.
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(NOT WIN32)
|
||||
@ -373,18 +373,24 @@ if (NOT EXPAT_FOUND)
|
||||
endif ()
|
||||
include_directories(${EXPAT_INCLUDE_DIRS})
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
# Find glew or use bundled version
|
||||
if (NOT SLIC3R_STATIC)
|
||||
if (SLIC3R_STATIC)
|
||||
set(GLEW_USE_STATIC_LIBS ON)
|
||||
set(GLEW_VERBOSE ON)
|
||||
endif()
|
||||
|
||||
find_package(GLEW)
|
||||
endif ()
|
||||
if (NOT GLEW_FOUND)
|
||||
message(STATUS "GLEW not found, using bundled version.")
|
||||
add_library(glew STATIC ${LIBDIR}/glew/src/glew.c)
|
||||
set(GLEW_FOUND 1)
|
||||
set(GLEW_FOUND TRUE)
|
||||
set(GLEW_INCLUDE_DIRS ${LIBDIR}/glew/include/)
|
||||
set(GLEW_LIBRARIES glew)
|
||||
add_definitions(-DGLEW_STATIC)
|
||||
target_compile_definitions(glew PUBLIC GLEW_STATIC)
|
||||
target_include_directories(glew PUBLIC ${GLEW_INCLUDE_DIRS})
|
||||
add_library(GLEW::GLEW ALIAS glew)
|
||||
endif ()
|
||||
include_directories(${GLEW_INCLUDE_DIRS})
|
||||
|
||||
# Find the Cereal serialization library
|
||||
add_library(cereal INTERFACE)
|
||||
@ -407,6 +413,29 @@ if(SLIC3R_STATIC)
|
||||
set(USE_BLOSC TRUE)
|
||||
endif()
|
||||
|
||||
set(TOP_LEVEL_PROJECT_DIR ${PROJECT_SOURCE_DIR})
|
||||
function(prusaslicer_copy_dlls target)
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
set(_bits 64)
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
set(_bits 32)
|
||||
endif ()
|
||||
|
||||
get_target_property(_out_dir ${target} BINARY_DIR)
|
||||
|
||||
# This has to be a separate target due to the windows command line lenght limits
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll ${_out_dir}/
|
||||
COMMENT "Copy gmp runtime to build tree"
|
||||
VERBATIM)
|
||||
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll ${_out_dir}/
|
||||
COMMENT "Copy mpfr runtime to build tree"
|
||||
VERBATIM)
|
||||
|
||||
endfunction()
|
||||
|
||||
#find_package(OpenVDB 5.0 COMPONENTS openvdb)
|
||||
#slic3r_remap_configs(IlmBase::Half RelWithDebInfo Release)
|
||||
|
||||
|
351
cmake/modules/FindGLEW.cmake
Normal file
@ -0,0 +1,351 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
# PrusaSlicer specifics:
|
||||
# This file is backported from CMake 3.15 distribution to behave uniformly
|
||||
# across all versions of CMake. It explicitly adds GLEW_STATIC complile
|
||||
# definition to static targets which is needed to prevent link errors.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindGLEW
|
||||
--------
|
||||
|
||||
Find the OpenGL Extension Wrangler Library (GLEW)
|
||||
|
||||
Input Variables
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
The following variables may be set to influence this module’s behavior:
|
||||
|
||||
``GLEW_USE_STATIC_LIBS``
|
||||
to find and create :prop_tgt:`IMPORTED` target for static linkage.
|
||||
|
||||
``GLEW_VERBOSE``
|
||||
to output a detailed log of this module.
|
||||
|
||||
Imported Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module defines the following :ref:`Imported Targets <Imported Targets>`:
|
||||
|
||||
|
||||
``GLEW::glew``
|
||||
The GLEW shared library.
|
||||
``GLEW::glew_s``
|
||||
The GLEW static library, if ``GLEW_USE_STATIC_LIBS`` is set to ``TRUE``.
|
||||
``GLEW::GLEW``
|
||||
Duplicates either ``GLEW::glew`` or ``GLEW::glew_s`` based on availability.
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module defines the following variables:
|
||||
|
||||
``GLEW_INCLUDE_DIRS``
|
||||
include directories for GLEW
|
||||
``GLEW_LIBRARIES``
|
||||
libraries to link against GLEW
|
||||
``GLEW_SHARED_LIBRARIES``
|
||||
libraries to link against shared GLEW
|
||||
``GLEW_STATIC_LIBRARIES``
|
||||
libraries to link against static GLEW
|
||||
``GLEW_FOUND``
|
||||
true if GLEW has been found and can be used
|
||||
``GLEW_VERSION``
|
||||
GLEW version
|
||||
``GLEW_VERSION_MAJOR``
|
||||
GLEW major version
|
||||
``GLEW_VERSION_MINOR``
|
||||
GLEW minor version
|
||||
``GLEW_VERSION_MICRO``
|
||||
GLEW micro version
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(GLEW CONFIG QUIET)
|
||||
|
||||
if(GLEW_FOUND)
|
||||
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_CONFIG)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: did not find GLEW CMake config file. Searching for libraries.")
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
find_package(OpenGL QUIET)
|
||||
|
||||
if(OpenGL_FOUND)
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: Found OpenGL Framework.")
|
||||
message(STATUS "FindGLEW: OPENGL_LIBRARIES: ${OPENGL_LIBRARIES}")
|
||||
endif()
|
||||
else()
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: could not find GLEW library.")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
function(__glew_set_find_library_suffix shared_or_static)
|
||||
if((UNIX AND NOT APPLE) AND "${shared_or_static}" MATCHES "SHARED")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" PARENT_SCOPE)
|
||||
elseif((UNIX AND NOT APPLE) AND "${shared_or_static}" MATCHES "STATIC")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" PARENT_SCOPE)
|
||||
elseif(APPLE AND "${shared_or_static}" MATCHES "SHARED")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib;.so" PARENT_SCOPE)
|
||||
elseif(APPLE AND "${shared_or_static}" MATCHES "STATIC")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" PARENT_SCOPE)
|
||||
elseif(WIN32 AND "${shared_or_static}" MATCHES "SHARED")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" PARENT_SCOPE)
|
||||
elseif(WIN32 AND "${shared_or_static}" MATCHES "STATIC")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.a;.dll.a" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: CMAKE_FIND_LIBRARY_SUFFIXES for ${shared_or_static}: ${CMAKE_FIND_LIBRARY_SUFFIXES}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
if(GLEW_VERBOSE)
|
||||
if(DEFINED GLEW_USE_STATIC_LIBS)
|
||||
message(STATUS "FindGLEW: GLEW_USE_STATIC_LIBS: ${GLEW_USE_STATIC_LIBS}.")
|
||||
else()
|
||||
message(STATUS "FindGLEW: GLEW_USE_STATIC_LIBS is undefined. Treated as FALSE.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_path(GLEW_INCLUDE_DIR GL/glew.h)
|
||||
mark_as_advanced(GLEW_INCLUDE_DIR)
|
||||
|
||||
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
|
||||
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: GLEW_INCLUDE_DIR: ${GLEW_INCLUDE_DIR}")
|
||||
message(STATUS "FindGLEW: GLEW_INCLUDE_DIRS: ${GLEW_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "x64" OR "${CMAKE_GENERATOR}" MATCHES "Win64")
|
||||
set(_arch "x64")
|
||||
else()
|
||||
set(_arch "Win32")
|
||||
endif()
|
||||
|
||||
|
||||
set(__GLEW_CURRENT_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
__glew_set_find_library_suffix(SHARED)
|
||||
|
||||
find_library(GLEW_SHARED_LIBRARY_RELEASE
|
||||
NAMES GLEW glew glew32
|
||||
PATH_SUFFIXES lib lib64 libx32 lib/Release/${_arch}
|
||||
PATHS ENV GLEW_ROOT)
|
||||
|
||||
find_library(GLEW_SHARED_LIBRARY_DEBUG
|
||||
NAMES GLEWd glewd glew32d
|
||||
PATH_SUFFIXES lib lib64
|
||||
PATHS ENV GLEW_ROOT)
|
||||
|
||||
|
||||
__glew_set_find_library_suffix(STATIC)
|
||||
|
||||
find_library(GLEW_STATIC_LIBRARY_RELEASE
|
||||
NAMES GLEW glew glew32s
|
||||
PATH_SUFFIXES lib lib64 libx32 lib/Release/${_arch}
|
||||
PATHS ENV GLEW_ROOT)
|
||||
|
||||
find_library(GLEW_STATIC_LIBRARY_DEBUG
|
||||
NAMES GLEWds glewd glewds glew32ds
|
||||
PATH_SUFFIXES lib lib64
|
||||
PATHS ENV GLEW_ROOT)
|
||||
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${__GLEW_CURRENT_FIND_LIBRARY_SUFFIXES})
|
||||
unset(__GLEW_CURRENT_FIND_LIBRARY_SUFFIXES)
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
|
||||
select_library_configurations(GLEW_SHARED)
|
||||
select_library_configurations(GLEW_STATIC)
|
||||
|
||||
if(NOT GLEW_USE_STATIC_LIBS)
|
||||
set(GLEW_LIBRARIES ${GLEW_SHARED_LIBRARY})
|
||||
else()
|
||||
set(GLEW_LIBRARIES ${GLEW_STATIC_LIBRARY})
|
||||
endif()
|
||||
|
||||
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: GLEW_SHARED_LIBRARY_RELEASE: ${GLEW_SHARED_LIBRARY_RELEASE}")
|
||||
message(STATUS "FindGLEW: GLEW_STATIC_LIBRARY_RELEASE: ${GLEW_STATIC_LIBRARY_RELEASE}")
|
||||
message(STATUS "FindGLEW: GLEW_SHARED_LIBRARY_DEBUG: ${GLEW_SHARED_LIBRARY_DEBUG}")
|
||||
message(STATUS "FindGLEW: GLEW_STATIC_LIBRARY_DEBUG: ${GLEW_STATIC_LIBRARY_DEBUG}")
|
||||
message(STATUS "FindGLEW: GLEW_SHARED_LIBRARY: ${GLEW_SHARED_LIBRARY}")
|
||||
message(STATUS "FindGLEW: GLEW_STATIC_LIBRARY: ${GLEW_STATIC_LIBRARY}")
|
||||
message(STATUS "FindGLEW: GLEW_LIBRARIES: ${GLEW_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
|
||||
# Read version from GL/glew.h file
|
||||
if(EXISTS "${GLEW_INCLUDE_DIR}/GL/glew.h")
|
||||
file(STRINGS "${GLEW_INCLUDE_DIR}/GL/glew.h" _contents REGEX "^VERSION_.+ [0-9]+")
|
||||
if(_contents)
|
||||
string(REGEX REPLACE ".*VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" GLEW_VERSION_MAJOR "${_contents}")
|
||||
string(REGEX REPLACE ".*VERSION_MINOR[ \t]+([0-9]+).*" "\\1" GLEW_VERSION_MINOR "${_contents}")
|
||||
string(REGEX REPLACE ".*VERSION_MICRO[ \t]+([0-9]+).*" "\\1" GLEW_VERSION_MICRO "${_contents}")
|
||||
set(GLEW_VERSION "${GLEW_VERSION_MAJOR}.${GLEW_VERSION_MINOR}.${GLEW_VERSION_MICRO}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: GLEW_VERSION_MAJOR: ${GLEW_VERSION_MAJOR}")
|
||||
message(STATUS "FindGLEW: GLEW_VERSION_MINOR: ${GLEW_VERSION_MINOR}")
|
||||
message(STATUS "FindGLEW: GLEW_VERSION_MICRO: ${GLEW_VERSION_MICRO}")
|
||||
message(STATUS "FindGLEW: GLEW_VERSION: ${GLEW_VERSION}")
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(GLEW
|
||||
REQUIRED_VARS GLEW_INCLUDE_DIRS GLEW_LIBRARIES
|
||||
VERSION_VAR GLEW_VERSION)
|
||||
|
||||
if(NOT GLEW_FOUND)
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: could not find GLEW library.")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT TARGET GLEW::glew AND NOT GLEW_USE_STATIC_LIBS)
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: Creating GLEW::glew imported target.")
|
||||
endif()
|
||||
|
||||
add_library(GLEW::glew UNKNOWN IMPORTED)
|
||||
|
||||
set_target_properties(GLEW::glew
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIRS}")
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(GLEW::glew
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES OpenGL::GL)
|
||||
endif()
|
||||
|
||||
if(GLEW_SHARED_LIBRARY_RELEASE)
|
||||
set_property(TARGET GLEW::glew
|
||||
APPEND
|
||||
PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
|
||||
set_target_properties(GLEW::glew
|
||||
PROPERTIES IMPORTED_LOCATION_RELEASE "${GLEW_SHARED_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
|
||||
if(GLEW_SHARED_LIBRARY_DEBUG)
|
||||
set_property(TARGET GLEW::glew
|
||||
APPEND
|
||||
PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
|
||||
set_target_properties(GLEW::glew
|
||||
PROPERTIES IMPORTED_LOCATION_DEBUG "${GLEW_SHARED_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
|
||||
elseif(NOT TARGET GLEW::glew_s AND GLEW_USE_STATIC_LIBS)
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: Creating GLEW::glew_s imported target.")
|
||||
endif()
|
||||
|
||||
add_library(GLEW::glew_s UNKNOWN IMPORTED)
|
||||
|
||||
set_target_properties(GLEW::glew_s
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIRS}")
|
||||
|
||||
set_target_properties(GLEW::glew_s PROPERTIES INTERFACE_COMPILE_DEFINITIONS GLEW_STATIC)
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(GLEW::glew_s
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES OpenGL::GL)
|
||||
endif()
|
||||
|
||||
if(GLEW_STATIC_LIBRARY_RELEASE)
|
||||
set_property(TARGET GLEW::glew_s
|
||||
APPEND
|
||||
PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
|
||||
set_target_properties(GLEW::glew_s
|
||||
PROPERTIES IMPORTED_LOCATION_RELEASE "${GLEW_STATIC_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
|
||||
if(GLEW_STATIC_LIBRARY_DEBUG)
|
||||
set_property(TARGET GLEW::glew_s
|
||||
APPEND
|
||||
PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
|
||||
set_target_properties(GLEW::glew_s
|
||||
PROPERTIES IMPORTED_LOCATION_DEBUG "${GLEW_STATIC_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT TARGET GLEW::GLEW)
|
||||
if(GLEW_VERBOSE)
|
||||
message(STATUS "FindGLEW: Creating GLEW::GLEW imported target.")
|
||||
endif()
|
||||
|
||||
add_library(GLEW::GLEW UNKNOWN IMPORTED)
|
||||
|
||||
set_target_properties(GLEW::GLEW
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIRS}")
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(GLEW::GLEW
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES OpenGL::GL)
|
||||
endif()
|
||||
|
||||
if(TARGET GLEW::glew)
|
||||
if(GLEW_SHARED_LIBRARY_RELEASE)
|
||||
set_property(TARGET GLEW::GLEW
|
||||
APPEND
|
||||
PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
|
||||
set_target_properties(GLEW::GLEW
|
||||
PROPERTIES IMPORTED_LOCATION_RELEASE "${GLEW_SHARED_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
|
||||
if(GLEW_SHARED_LIBRARY_DEBUG)
|
||||
set_property(TARGET GLEW::GLEW
|
||||
APPEND
|
||||
PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
|
||||
set_target_properties(GLEW::GLEW
|
||||
PROPERTIES IMPORTED_LOCATION_DEBUG "${GLEW_SHARED_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
|
||||
elseif(TARGET GLEW::glew_s)
|
||||
if(GLEW_STATIC_LIBRARY_RELEASE)
|
||||
set_property(TARGET GLEW::GLEW
|
||||
APPEND
|
||||
PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
|
||||
set_target_properties(GLEW::GLEW
|
||||
PROPERTIES IMPORTED_LOCATION_RELEASE "${GLEW_STATIC_LIBRARY_RELEASE}"
|
||||
INTERFACE_COMPILE_DEFINITIONS GLEW_STATIC)
|
||||
endif()
|
||||
|
||||
if(GLEW_STATIC_LIBRARY_DEBUG AND GLEW_USE_STATIC_LIBS)
|
||||
set_property(TARGET GLEW::GLEW
|
||||
APPEND
|
||||
PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
|
||||
set_target_properties(GLEW::GLEW
|
||||
PROPERTIES IMPORTED_LOCATION_DEBUG "${GLEW_STATIC_LIBRARY_DEBUG}"
|
||||
INTERFACE_COMPILE_DEFINITIONS GLEW_STATIC)
|
||||
endif()
|
||||
|
||||
elseif(GLEW_VERBOSE)
|
||||
message(WARNING "FindGLEW: no `GLEW::glew` or `GLEW::glew_s` target was created. Something went wrong in FindGLEW target creation.")
|
||||
endif()
|
||||
endif()
|
@ -203,20 +203,50 @@ if(UNIX AND OPENVDB_USE_STATIC_LIBS)
|
||||
endif()
|
||||
|
||||
set(OpenVDB_LIB_COMPONENTS "")
|
||||
set(OpenVDB_DEBUG_SUFFIX "d" CACHE STRING "Suffix for the debug libraries")
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
||||
set(LIB_NAME ${COMPONENT})
|
||||
find_library(OpenVDB_${COMPONENT}_LIBRARY ${LIB_NAME} lib${LIB_NAME}
|
||||
|
||||
find_library(OpenVDB_${COMPONENT}_LIBRARY_RELEASE ${LIB_NAME} lib${LIB_NAME}
|
||||
PATHS ${_OPENVDB_LIBRARYDIR_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${OPENVDB_PATH_SUFFIXES}
|
||||
)
|
||||
list(APPEND OpenVDB_LIB_COMPONENTS ${OpenVDB_${COMPONENT}_LIBRARY})
|
||||
|
||||
if(OpenVDB_${COMPONENT}_LIBRARY)
|
||||
set(OpenVDB_${COMPONENT}_FOUND TRUE)
|
||||
else()
|
||||
set(OpenVDB_${COMPONENT}_FOUND FALSE)
|
||||
endif()
|
||||
find_library(OpenVDB_${COMPONENT}_LIBRARY_DEBUG ${LIB_NAME}${OpenVDB_DEBUG_SUFFIX} lib${LIB_NAME}${OpenVDB_DEBUG_SUFFIX}
|
||||
PATHS ${_OPENVDB_LIBRARYDIR_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${OPENVDB_PATH_SUFFIXES}
|
||||
)
|
||||
|
||||
if (_is_multi)
|
||||
list(APPEND OpenVDB_LIB_COMPONENTS ${OpenVDB_${COMPONENT}_LIBRARY_RELEASE} ${OpenVDB_${COMPONENT}_LIBRARY_DEBUG})
|
||||
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "Debug" _has_debug)
|
||||
|
||||
if(OpenVDB_${COMPONENT}_LIBRARY_RELEASE AND (_has_debug LESS 0 OR OpenVDB_${COMPONENT}_LIBRARY_DEBUG))
|
||||
set(OpenVDB_${COMPONENT}_FOUND TRUE)
|
||||
else()
|
||||
set(OpenVDB_${COMPONENT}_FOUND FALSE)
|
||||
endif()
|
||||
else ()
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" _BUILD_TYPE)
|
||||
|
||||
set(OpenVDB_${COMPONENT}_LIBRARY ${OpenVDB_${COMPONENT}_LIBRARY_${_BUILD_TYPE}})
|
||||
|
||||
if (NOT MSVC AND NOT OpenVDB_${COMPONENT}_LIBRARY)
|
||||
set(OpenVDB_${COMPONENT}_LIBRARY ${OpenVDB_${COMPONENT}_LIBRARY_RELEASE})
|
||||
endif ()
|
||||
|
||||
list(APPEND OpenVDB_LIB_COMPONENTS ${OpenVDB_${COMPONENT}_LIBRARY})
|
||||
|
||||
if(OpenVDB_${COMPONENT}_LIBRARY)
|
||||
set(OpenVDB_${COMPONENT}_FOUND TRUE)
|
||||
else()
|
||||
set(OpenVDB_${COMPONENT}_FOUND FALSE)
|
||||
endif()
|
||||
endif ()
|
||||
endforeach()
|
||||
|
||||
if(UNIX AND OPENVDB_USE_STATIC_LIBS)
|
||||
@ -465,7 +495,6 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
||||
if(NOT TARGET OpenVDB::${COMPONENT})
|
||||
add_library(OpenVDB::${COMPONENT} UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
|
||||
IMPORTED_LOCATION "${OpenVDB_${COMPONENT}_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${OpenVDB_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_INCLUDE_DIR}"
|
||||
IMPORTED_LINK_DEPENDENT_LIBRARIES "${_OPENVDB_HIDDEN_DEPENDENCIES}" # non visible deps
|
||||
@ -473,6 +502,17 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
||||
INTERFACE_COMPILE_FEATURES cxx_std_11
|
||||
)
|
||||
|
||||
if (_is_multi)
|
||||
set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${OpenVDB_${COMPONENT}_LIBRARY_RELEASE}"
|
||||
IMPORTED_LOCATION_DEBUG "${OpenVDB_${COMPONENT}_LIBRARY_DEBUG}"
|
||||
)
|
||||
else ()
|
||||
set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
|
||||
IMPORTED_LOCATION "${OpenVDB_${COMPONENT}_LIBRARY}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (OPENVDB_USE_STATIC_LIBS)
|
||||
set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "OPENVDB_STATICLIB;OPENVDB_OPENEXR_STATICLIB"
|
||||
|
20
deps/CGAL/CGAL.cmake
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
prusaslicer_add_cmake_project(
|
||||
CGAL
|
||||
GIT_REPOSITORY https://github.com/CGAL/cgal.git
|
||||
GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0
|
||||
# For whatever reason, this keeps downloading forever (repeats downloads if finished)
|
||||
# URL https://github.com/CGAL/cgal/archive/releases/CGAL-5.0.zip
|
||||
# URL_HASH SHA256=bd9327be903ab7ee379a8a7a0609eba0962f5078d2497cf8e13e8e1598584154
|
||||
DEPENDS dep_boost dep_GMP dep_MPFR
|
||||
)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# CGAL, for whatever reason, makes itself non-relocatable by writing the build directory into
|
||||
# CGALConfig-installation-dirs.cmake and including it in configure time.
|
||||
# If this file is not present, it will not consider the stored absolute path
|
||||
ExternalProject_Add_Step(dep_CGAL dep_CGAL_relocation_fix
|
||||
DEPENDEES install
|
||||
COMMAND ${CMAKE_COMMAND} -E remove CGALConfig-installation-dirs.cmake
|
||||
WORKING_DIRECTORY "${DESTDIR}/usr/local/${CMAKE_INSTALL_LIBDIR}/cmake/CGAL"
|
||||
)
|
56
deps/CMakeLists.txt
vendored
@ -44,6 +44,49 @@ option(DEP_WX_STABLE "Build against wxWidgets stable 3.0 as opposed to default 3
|
||||
|
||||
message(STATUS "Slic3r deps DESTDIR: ${DESTDIR}")
|
||||
message(STATUS "Slic3r deps debug build: ${DEP_DEBUG}")
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
function(prusaslicer_add_cmake_project projectname)
|
||||
cmake_parse_arguments(P_ARGS "" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN})
|
||||
|
||||
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
|
||||
if (_is_multi OR MSVC)
|
||||
set(_configs_line "")
|
||||
endif ()
|
||||
|
||||
set(_gen "")
|
||||
set(_build_j "-j${NPROC}")
|
||||
if (MSVC)
|
||||
set(_gen CMAKE_GENERATOR "${DEP_MSVC_GEN}" CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}")
|
||||
set(_build_j "/m")
|
||||
endif ()
|
||||
|
||||
ExternalProject_Add(
|
||||
dep_${projectname}
|
||||
EXCLUDE_FROM_ALL ON
|
||||
INSTALL_DIR ${DESTDIR}/usr/local
|
||||
${_gen}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
|
||||
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}/usr/local
|
||||
-DCMAKE_DEBUG_POSTFIX:STRING=d
|
||||
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
"${_configs_line}"
|
||||
${DEP_CMAKE_OPTS}
|
||||
${P_ARGS_CMAKE_ARGS}
|
||||
${P_ARGS_UNPARSED_ARGUMENTS}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
|
||||
)
|
||||
|
||||
endfunction(prusaslicer_add_cmake_project)
|
||||
|
||||
|
||||
if (MSVC)
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
message(STATUS "\nDetected 64-bit compiler => building 64-bit deps bundle\n")
|
||||
@ -82,6 +125,13 @@ else()
|
||||
include("deps-linux.cmake")
|
||||
endif()
|
||||
|
||||
include(GLEW/GLEW.cmake)
|
||||
include(OpenCSG/OpenCSG.cmake)
|
||||
|
||||
include(GMP/GMP.cmake)
|
||||
include(MPFR/MPFR.cmake)
|
||||
include(CGAL/CGAL.cmake)
|
||||
|
||||
if (MSVC)
|
||||
|
||||
add_custom_target(deps ALL
|
||||
@ -94,8 +144,10 @@ if (MSVC)
|
||||
dep_cereal
|
||||
dep_nlopt
|
||||
# dep_qhull # Experimental
|
||||
dep_zlib # on Windows we still need zlib
|
||||
dep_ZLIB # on Windows we still need zlib
|
||||
dep_openvdb
|
||||
dep_OpenCSG
|
||||
dep_CGAL
|
||||
)
|
||||
|
||||
else()
|
||||
@ -111,6 +163,8 @@ else()
|
||||
dep_nlopt
|
||||
dep_qhull
|
||||
dep_openvdb
|
||||
dep_OpenCSG
|
||||
dep_CGAL
|
||||
# dep_libigl # Not working, static build has different Eigen
|
||||
)
|
||||
|
||||
|
11
deps/GLEW/GLEW.cmake
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
# We have to check for OpenGL to compile GLEW
|
||||
find_package(OpenGL QUIET REQUIRED)
|
||||
|
||||
prusaslicer_add_cmake_project(
|
||||
GLEW
|
||||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/glew
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_GLEW)
|
||||
endif ()
|
33
deps/GLEW/glew/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(GLEW)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
add_library(glew src/glew.c)
|
||||
target_include_directories(glew PRIVATE include/)
|
||||
target_link_libraries(glew PUBLIC OpenGL::GL)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(glew PUBLIC GLEW_STATIC)
|
||||
endif ()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
install(
|
||||
FILES
|
||||
${PROJECT_SOURCE_DIR}/include/GL/glew.h
|
||||
${PROJECT_SOURCE_DIR}/include/GL/wglew.h
|
||||
${PROJECT_SOURCE_DIR}/include/GL/glxew.h
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/GL
|
||||
)
|
||||
|
||||
add_library(GLEW INTERFACE)
|
||||
target_link_libraries(GLEW INTERFACE glew)
|
||||
|
||||
install(TARGETS glew GLEW
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
73
deps/GLEW/glew/LICENSE.txt
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
The OpenGL Extension Wrangler Library
|
||||
Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org>
|
||||
Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
Copyright (C) 2002, Lev Povalahev
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* The name of the author may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Mesa 3-D graphics library
|
||||
Version: 7.0
|
||||
|
||||
Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||
|
||||
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
|
||||
BRIAN PAUL 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.
|
||||
|
||||
|
||||
Copyright (c) 2007 The Khronos Group Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and/or associated documentation files (the
|
||||
"Materials"), to deal in the Materials without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
permit persons to whom the Materials are 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 Materials.
|
||||
|
||||
THE MATERIALS ARE 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
|
||||
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
196
deps/GLEW/glew/README.md
vendored
Normal file
@ -0,0 +1,196 @@
|
||||
THIS IS NOT THE COMPLETE GLEW DISTRIBUTION. ONLY FILES NEEDED FOR COMPILING GLEW INTO SLIC3R WERE PUT INTO THE SLIC3R SOURCE DISTRIBUTION.
|
||||
|
||||
A CMAKE CONFIG EXPORT IS ADDED TO ENABLE FIND PACKAGE TO FIND DEBUG BUILD ON MSVC
|
||||
|
||||
# GLEW - The OpenGL Extension Wrangler Library
|
||||
|
||||

|
||||
|
||||
http://glew.sourceforge.net/
|
||||
|
||||
https://github.com/nigels-com/glew
|
||||
|
||||
[](https://travis-ci.org/nigels-com/glew)
|
||||
[](https://gitter.im/nigels-com/glew?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
[](https://sourceforge.net/projects/glew/files/latest/download)
|
||||
|
||||
## Downloads
|
||||
|
||||
Current release is [2.0.0](https://sourceforge.net/projects/glew/files/glew/2.0.0/).
|
||||
[(Change Log)](http://glew.sourceforge.net/log.html)
|
||||
|
||||
Sources available as
|
||||
[ZIP](https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0.zip/download) or
|
||||
[TGZ](https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0.tgz/download).
|
||||
|
||||
Windows binaries for [32-bit and 64-bit](https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0-win32.zip/download).
|
||||
|
||||
### Recent snapshots
|
||||
|
||||
Snapshots may contain new features, bug-fixes or new OpenGL extensions ahead of tested, official releases.
|
||||
|
||||
[glew-20160708.tgz](http://sourceforge.net/projects/glew/files/glew/snapshots/glew-20160708.tgz/download)
|
||||
*GLEW 2.0.0 RC: Core context, EGL support, no MX*
|
||||
|
||||
[glew-20160402.tgz](http://sourceforge.net/projects/glew/files/glew/snapshots/glew-20160402.tgz/download)
|
||||
*GLEW 2.0.0 RC: Core context, EGL support, no MX*
|
||||
|
||||
## Build
|
||||
|
||||
From a downloaded tarball or zip archive:
|
||||
|
||||
### Linux and Mac
|
||||
|
||||
#### Using GNU Make
|
||||
|
||||
##### Install build tools
|
||||
|
||||
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev libosmesa-dev git`
|
||||
|
||||
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel git`
|
||||
|
||||
##### Build
|
||||
|
||||
$ make
|
||||
$ sudo make install
|
||||
$ make clean
|
||||
|
||||
Targets: `all, glew.lib, glew.bin, clean, install, uninstall`
|
||||
|
||||
Variables: `SYSTEM=linux-clang, GLEW_DEST=/usr/local, STRIP=`
|
||||
|
||||
#### Using cmake
|
||||
|
||||
*CMake 2.8.12 or higher is required.*
|
||||
|
||||
##### Install build tools
|
||||
|
||||
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libXmu-dev libXi-dev libgl-dev git cmake`
|
||||
|
||||
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel git cmake`
|
||||
|
||||
##### Build
|
||||
|
||||
$ cd build
|
||||
$ cmake ./cmake
|
||||
$ make -j4
|
||||
|
||||
| Target | Description |
|
||||
| ---------- | ----------- |
|
||||
| glew | Build the glew shared library. |
|
||||
| glew_s | Build the glew static library. |
|
||||
| glewinfo | Build the `glewinfo` executable (requires `BUILD_UTILS` to be `ON`). |
|
||||
| visualinfo | Build the `visualinfo` executable (requires `BUILD_UTILS` to be `ON`). |
|
||||
| install | Install all enabled targets into `CMAKE_INSTALL_PREFIX`. |
|
||||
| clean | Clean up build artifacts. |
|
||||
| all | Build all enabled targets (default target). |
|
||||
|
||||
| Variables | Description |
|
||||
| --------------- | ----------- |
|
||||
| BUILD_UTILS | Build the `glewinfo` and `visualinfo` executables. |
|
||||
| GLEW_REGAL | Build in Regal mode. |
|
||||
| GLEW_OSMESA | Build in off-screen Mesa mode. |
|
||||
| BUILD_FRAMEWORK | Build as MacOSX Framework. Setting `CMAKE_INSTALL_PREFIX` to `/Library/Frameworks` is recommended. |
|
||||
|
||||
### Windows
|
||||
|
||||
#### Visual Studio
|
||||
|
||||
Use the provided Visual Studio project file in build/vc12/
|
||||
|
||||
Projects for vc6 and vc10 are also provided
|
||||
|
||||
#### MSYS/Mingw
|
||||
|
||||
Available from [Mingw](http://www.mingw.org/)
|
||||
|
||||
Requirements: bash, make, gcc
|
||||
|
||||
$ mingw32-make
|
||||
$ mingw32-make install
|
||||
$ mingw32-make install.all
|
||||
|
||||
Alternative toolchain: `SYSTEM=mingw-win32`
|
||||
|
||||
#### MSYS2/Mingw-w64
|
||||
|
||||
Available from [Msys2](http://msys2.github.io/) and/or [Mingw-w64](http://mingw-w64.org/)
|
||||
|
||||
Requirements: bash, make, gcc
|
||||
|
||||
$ pacman -S gcc make mingw-w64-i686-gcc mingw-w64-x86_64-gcc
|
||||
$ make
|
||||
$ make install
|
||||
$ make install.all
|
||||
|
||||
Alternative toolchain: `SYSTEM=msys, SYSTEM=msys-win32, SYSTEM=msys-win64`
|
||||
|
||||
## glewinfo
|
||||
|
||||
`glewinfo` is a command-line tool useful for inspecting the capabilities of an
|
||||
OpenGL implementation and GLEW support for that. Please include the output of
|
||||
`glewinfo` with bug reports, as appropriate.
|
||||
|
||||
---------------------------
|
||||
GLEW Extension Info
|
||||
---------------------------
|
||||
|
||||
GLEW version 2.0.0
|
||||
Reporting capabilities of pixelformat 3
|
||||
Running on a Intel(R) HD Graphics 3000 from Intel
|
||||
OpenGL version 3.1.0 - Build 9.17.10.4229 is supported
|
||||
|
||||
GL_VERSION_1_1: OK
|
||||
---------------
|
||||
|
||||
GL_VERSION_1_2: OK
|
||||
---------------
|
||||
glCopyTexSubImage3D: OK
|
||||
glDrawRangeElements: OK
|
||||
glTexImage3D: OK
|
||||
glTexSubImage3D: OK
|
||||
|
||||
...
|
||||
|
||||
## Code Generation
|
||||
|
||||
A Unix or Mac environment is neded for building GLEW from scratch to
|
||||
include new extensions, or customize the code generation. The extension
|
||||
data is regenerated from the top level source directory with:
|
||||
|
||||
make extensions
|
||||
|
||||
An alternative to generating the GLEW sources from scratch is to
|
||||
download a pre-generated (unsupported) snapshot:
|
||||
|
||||
https://sourceforge.net/projects/glew/files/glew/snapshots/
|
||||
|
||||
Travis-built snapshots are also available:
|
||||
|
||||
https://glew.s3.amazonaws.com/index.html
|
||||
|
||||
## Authors
|
||||
|
||||
GLEW is currently maintained by [Nigel Stewart](https://github.com/nigels-com)
|
||||
with bug fixes, new OpenGL extension support and new releases.
|
||||
|
||||
GLEW was developed by [Milan Ikits](http://www.cs.utah.edu/~ikits/)
|
||||
and [Marcelo Magallon](http://wwwvis.informatik.uni-stuttgart.de/~magallon/).
|
||||
Aaron Lefohn, Joe Kniss, and Chris Wyman were the first users and also
|
||||
assisted with the design and debugging process.
|
||||
|
||||
The acronym GLEW originates from Aaron Lefohn.
|
||||
Pasi Kärkkäinen identified and fixed several problems with
|
||||
GLX and SDL. Nate Robins created the `wglinfo` utility, to
|
||||
which modifications were made by Michael Wimmer.
|
||||
|
||||
## Copyright and Licensing
|
||||
|
||||
GLEW is originally derived from the EXTGL project by Lev Povalahev.
|
||||
The source code is licensed under the
|
||||
[Modified BSD License](http://glew.sourceforge.net/glew.txt), the
|
||||
[Mesa 3-D License](http://glew.sourceforge.net/mesa.txt) (MIT) and the
|
||||
[Khronos License](http://glew.sourceforge.net/khronos.txt) (MIT).
|
||||
|
||||
The automatic code generation scripts are released under the
|
||||
[GNU GPL](http://glew.sourceforge.net/gpl.txt).
|
1
deps/GLEW/glew/VERSION
vendored
Normal file
@ -0,0 +1 @@
|
||||
1.13.0
|
19753
deps/GLEW/glew/include/GL/glew.h
vendored
Normal file
1772
deps/GLEW/glew/include/GL/glxew.h
vendored
Normal file
1456
deps/GLEW/glew/include/GL/wglew.h
vendored
Normal file
18614
deps/GLEW/glew/src/glew.c
vendored
Normal file
27
deps/GMP/GMP.cmake
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/gmp)
|
||||
set(_dstdir ${DESTDIR}/usr/local)
|
||||
|
||||
if (MSVC)
|
||||
set(_output ${_dstdir}/include/gmp.h
|
||||
${_dstdir}/lib/libgmp-10.lib
|
||||
${_dstdir}/bin/libgmp-10.dll)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${_output}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/gmp.h ${_dstdir}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.lib ${_dstdir}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.dll ${_dstdir}/bin/
|
||||
)
|
||||
|
||||
add_custom_target(dep_GMP SOURCES ${_output})
|
||||
|
||||
else ()
|
||||
ExternalProject_Add(dep_GMP
|
||||
URL https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND ./configure --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" --with-pic
|
||||
BUILD_COMMAND make -j
|
||||
INSTALL_COMMAND make install
|
||||
)
|
||||
endif ()
|
674
deps/GMP/gmp/gmp.COPYING
vendored
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
105
deps/GMP/gmp/gmp.README
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
Copyright 1991, 1996, 1999, 2000, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU MP Library.
|
||||
|
||||
The GNU MP Library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
The GNU MP Library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
THE GNU MP LIBRARY
|
||||
|
||||
|
||||
GNU MP is a library for arbitrary precision arithmetic, operating on signed
|
||||
integers, rational numbers, and floating point numbers. It has a rich set of
|
||||
functions, and the functions have a regular interface.
|
||||
|
||||
GNU MP is designed to be as fast as possible, both for small operands and huge
|
||||
operands. The speed is achieved by using fullwords as the basic arithmetic
|
||||
type, by using fast algorithms, with carefully optimized assembly code for the
|
||||
most common inner loops for lots of CPUs, and by a general emphasis on speed
|
||||
(instead of simplicity or elegance).
|
||||
|
||||
GNU MP is believed to be faster than any other similar library. Its advantage
|
||||
increases with operand sizes for certain operations, since GNU MP in many
|
||||
cases has asymptotically faster algorithms.
|
||||
|
||||
GNU MP is free software and may be freely copied on the terms contained in the
|
||||
files COPYING.LIB and COPYING (most of GNU MP is under the former, some under
|
||||
the latter).
|
||||
|
||||
|
||||
|
||||
OVERVIEW OF GNU MP
|
||||
|
||||
There are five classes of functions in GNU MP.
|
||||
|
||||
1. Signed integer arithmetic functions (mpz). These functions are intended
|
||||
to be easy to use, with their regular interface. The associated type is
|
||||
`mpz_t'.
|
||||
|
||||
2. Rational arithmetic functions (mpq). For now, just a small set of
|
||||
functions necessary for basic rational arithmetics. The associated type
|
||||
is `mpq_t'.
|
||||
|
||||
3. Floating-point arithmetic functions (mpf). If the C type `double'
|
||||
doesn't give enough precision for your application, declare your
|
||||
variables as `mpf_t' instead, set the precision to any number desired,
|
||||
and call the functions in the mpf class for the arithmetic operations.
|
||||
|
||||
4. Positive-integer, hard-to-use, very low overhead functions are in the
|
||||
mpn class. No memory management is performed. The caller must ensure
|
||||
enough space is available for the results. The set of functions is not
|
||||
regular, nor is the calling interface. These functions accept input
|
||||
arguments in the form of pairs consisting of a pointer to the least
|
||||
significant word, and an integral size telling how many limbs (= words)
|
||||
the pointer points to.
|
||||
|
||||
Almost all calculations, in the entire package, are made by calling these
|
||||
low-level functions.
|
||||
|
||||
5. Berkeley MP compatible functions.
|
||||
|
||||
To use these functions, include the file "mp.h". You can test if you are
|
||||
using the GNU version by testing if the symbol __GNU_MP__ is defined.
|
||||
|
||||
For more information on how to use GNU MP, please refer to the documentation.
|
||||
It is composed from the file doc/gmp.texi, and can be displayed on the screen
|
||||
or printed. How to do that, as well how to build the library, is described in
|
||||
the INSTALL file in this directory.
|
||||
|
||||
|
||||
|
||||
REPORTING BUGS
|
||||
|
||||
If you find a bug in the library, please make sure to tell us about it!
|
||||
|
||||
You should first check the GNU MP web pages at http://gmplib.org/, under
|
||||
"Status of the current release". There will be patches for all known serious
|
||||
bugs there.
|
||||
|
||||
Report bugs to gmp-bugs@gmplib.org. What information is needed in a useful bug
|
||||
report is described in the manual. The same address can be used for suggesting
|
||||
modifications and enhancements.
|
||||
|
||||
|
||||
|
||||
|
||||
----------------
|
||||
Local variables:
|
||||
mode: text
|
||||
fill-column: 78
|
||||
End:
|
2280
deps/GMP/gmp/include/gmp.h
vendored
Normal file
BIN
deps/GMP/gmp/lib/win32/libgmp-10.dll
vendored
Normal file
BIN
deps/GMP/gmp/lib/win32/libgmp-10.lib
vendored
Normal file
BIN
deps/GMP/gmp/lib/win64/libgmp-10.dll
vendored
Normal file
BIN
deps/GMP/gmp/lib/win64/libgmp-10.lib
vendored
Normal file
29
deps/MPFR/MPFR.cmake
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/mpfr)
|
||||
set(_dstdir ${DESTDIR}/usr/local)
|
||||
|
||||
if (MSVC)
|
||||
set(_output ${_dstdir}/include/mpfr.h
|
||||
${_dstdir}/include/mpf2mpfr.h
|
||||
${_dstdir}/lib/libmpfr-4.lib
|
||||
${_dstdir}/bin/libmpfr-4.dll)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${_output}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpfr.h ${_dstdir}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpf2mpfr.h ${_dstdir}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.lib ${_dstdir}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.dll ${_dstdir}/bin/
|
||||
)
|
||||
|
||||
add_custom_target(dep_MPFR SOURCES ${_output})
|
||||
|
||||
else ()
|
||||
ExternalProject_Add(dep_MPFR
|
||||
URL http://ftp.vim.org/ftp/gnu/mpfr/mpfr-3.1.6.tar.bz2 https://www.mpfr.org/mpfr-3.1.6/mpfr-3.1.6.tar.bz2 # mirrors are allowed
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND ./configure --prefix=${DESTDIR}/usr/local --with-gmp=${DESTDIR}/usr/local --with-pic
|
||||
BUILD_COMMAND make -j
|
||||
INSTALL_COMMAND make install
|
||||
DEPENDS dep_GMP
|
||||
)
|
||||
endif ()
|
175
deps/MPFR/mpfr/include/mpf2mpfr.h
vendored
Normal file
@ -0,0 +1,175 @@
|
||||
/* mpf2mpfr.h -- Compatibility include file with mpf.
|
||||
|
||||
Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
Contributed by the Arenaire and Cacao projects, INRIA.
|
||||
|
||||
This file is part of the GNU MPFR Library.
|
||||
|
||||
The GNU MPFR Library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
The GNU MPFR Library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
|
||||
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef __MPFR_FROM_MPF__
|
||||
#define __MPFR_FROM_MPF__
|
||||
|
||||
/* types */
|
||||
#define mpf_t mpfr_t
|
||||
#define mpf_srcptr mpfr_srcptr
|
||||
#define mpf_ptr mpfr_ptr
|
||||
|
||||
/* Get current Rounding Mode */
|
||||
#ifndef MPFR_DEFAULT_RND
|
||||
# define MPFR_DEFAULT_RND mpfr_get_default_rounding_mode ()
|
||||
#endif
|
||||
|
||||
/* mpf_init initalizes at 0 */
|
||||
#undef mpf_init
|
||||
#define mpf_init(x) mpfr_init_set_ui ((x), 0, MPFR_DEFAULT_RND)
|
||||
#undef mpf_init2
|
||||
#define mpf_init2(x,p) (mpfr_init2((x),(p)), mpfr_set_ui ((x), 0, MPFR_DEFAULT_RND))
|
||||
|
||||
/* functions which don't take as argument the rounding mode */
|
||||
#undef mpf_ceil
|
||||
#define mpf_ceil mpfr_ceil
|
||||
#undef mpf_clear
|
||||
#define mpf_clear mpfr_clear
|
||||
#undef mpf_cmp
|
||||
#define mpf_cmp mpfr_cmp
|
||||
#undef mpf_cmp_si
|
||||
#define mpf_cmp_si mpfr_cmp_si
|
||||
#undef mpf_cmp_ui
|
||||
#define mpf_cmp_ui mpfr_cmp_ui
|
||||
#undef mpf_cmp_d
|
||||
#define mpf_cmp_d mpfr_cmp_d
|
||||
#undef mpf_eq
|
||||
#define mpf_eq mpfr_eq
|
||||
#undef mpf_floor
|
||||
#define mpf_floor mpfr_floor
|
||||
#undef mpf_get_prec
|
||||
#define mpf_get_prec mpfr_get_prec
|
||||
#undef mpf_integer_p
|
||||
#define mpf_integer_p mpfr_integer_p
|
||||
#undef mpf_random2
|
||||
#define mpf_random2 mpfr_random2
|
||||
#undef mpf_set_default_prec
|
||||
#define mpf_set_default_prec mpfr_set_default_prec
|
||||
#undef mpf_get_default_prec
|
||||
#define mpf_get_default_prec mpfr_get_default_prec
|
||||
#undef mpf_set_prec
|
||||
#define mpf_set_prec mpfr_set_prec
|
||||
#undef mpf_set_prec_raw
|
||||
#define mpf_set_prec_raw(x,p) mpfr_prec_round(x,p,MPFR_DEFAULT_RND)
|
||||
#undef mpf_trunc
|
||||
#define mpf_trunc mpfr_trunc
|
||||
#undef mpf_sgn
|
||||
#define mpf_sgn mpfr_sgn
|
||||
#undef mpf_swap
|
||||
#define mpf_swap mpfr_swap
|
||||
#undef mpf_dump
|
||||
#define mpf_dump mpfr_dump
|
||||
|
||||
/* functions which take as argument the rounding mode */
|
||||
#undef mpf_abs
|
||||
#define mpf_abs(x,y) mpfr_abs(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_add
|
||||
#define mpf_add(x,y,z) mpfr_add(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_add_ui
|
||||
#define mpf_add_ui(x,y,z) mpfr_add_ui(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_div
|
||||
#define mpf_div(x,y,z) mpfr_div(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_div_ui
|
||||
#define mpf_div_ui(x,y,z) mpfr_div_ui(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_div_2exp
|
||||
#define mpf_div_2exp(x,y,z) mpfr_div_2exp(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_slong_p
|
||||
#define mpf_fits_slong_p(x) mpfr_fits_ulong_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_ulong_p
|
||||
#define mpf_fits_ulong_p(x) mpfr_fits_ulong_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_sint_p
|
||||
#define mpf_fits_sint_p(x) mpfr_fits_uint_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_uint_p
|
||||
#define mpf_fits_uint_p(x) mpfr_fits_uint_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_sshort_p
|
||||
#define mpf_fits_sshort_p(x) mpfr_fits_ushort_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_ushort_p
|
||||
#define mpf_fits_ushort_p(x) mpfr_fits_ushort_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_get_str
|
||||
#define mpf_get_str(x,y,z,t,u) mpfr_get_str(x,y,z,t,u,MPFR_DEFAULT_RND)
|
||||
#undef mpf_get_d
|
||||
#define mpf_get_d(x) mpfr_get_d(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_get_d_2exp
|
||||
#define mpf_get_d_2exp(e,x) mpfr_get_d_2exp(e,x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_get_ui
|
||||
#define mpf_get_ui(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_get_si
|
||||
#define mpf_get_si(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_inp_str
|
||||
#define mpf_inp_str(x,y,z) mpfr_inp_str(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_str
|
||||
#define mpf_set_str(x,y,z) mpfr_set_str(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_init_set
|
||||
#define mpf_init_set(x,y) mpfr_init_set(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_init_set_d
|
||||
#define mpf_init_set_d(x,y) mpfr_init_set_d(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_init_set_si
|
||||
#define mpf_init_set_si(x,y) mpfr_init_set_si(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_init_set_str
|
||||
#define mpf_init_set_str(x,y,z) mpfr_init_set_str(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_init_set_ui
|
||||
#define mpf_init_set_ui(x,y) mpfr_init_set_ui(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_mul
|
||||
#define mpf_mul(x,y,z) mpfr_mul(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_mul_2exp
|
||||
#define mpf_mul_2exp(x,y,z) mpfr_mul_2exp(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_mul_ui
|
||||
#define mpf_mul_ui(x,y,z) mpfr_mul_ui(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_neg
|
||||
#define mpf_neg(x,y) mpfr_neg(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_out_str
|
||||
#define mpf_out_str(x,y,z,t) mpfr_out_str(x,y,z,t,MPFR_DEFAULT_RND)
|
||||
#undef mpf_pow_ui
|
||||
#define mpf_pow_ui(x,y,z) mpfr_pow_ui(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_reldiff
|
||||
#define mpf_reldiff(x,y,z) mpfr_reldiff(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set
|
||||
#define mpf_set(x,y) mpfr_set(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_d
|
||||
#define mpf_set_d(x,y) mpfr_set_d(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_q
|
||||
#define mpf_set_q(x,y) mpfr_set_q(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_si
|
||||
#define mpf_set_si(x,y) mpfr_set_si(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_ui
|
||||
#define mpf_set_ui(x,y) mpfr_set_ui(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_z
|
||||
#define mpf_set_z(x,y) mpfr_set_z(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_sqrt
|
||||
#define mpf_sqrt(x,y) mpfr_sqrt(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_sqrt_ui
|
||||
#define mpf_sqrt_ui(x,y) mpfr_sqrt_ui(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_sub
|
||||
#define mpf_sub(x,y,z) mpfr_sub(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_sub_ui
|
||||
#define mpf_sub_ui(x,y,z) mpfr_sub_ui(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_ui_div
|
||||
#define mpf_ui_div(x,y,z) mpfr_ui_div(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_ui_sub
|
||||
#define mpf_ui_sub(x,y,z) mpfr_ui_sub(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_urandomb
|
||||
#define mpf_urandomb(x,y,n) mpfr_urandomb(x,y)
|
||||
|
||||
#undef mpz_set_f
|
||||
#define mpz_set_f(z,f) mpfr_get_z(z,f,MPFR_DEFAULT_RND)
|
||||
|
||||
#endif /* __MPFR_FROM_MPF__ */
|
910
deps/MPFR/mpfr/include/mpfr.h
vendored
Normal file
@ -0,0 +1,910 @@
|
||||
/* mpfr.h -- Include file for mpfr.
|
||||
|
||||
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
Contributed by the Arenaire and Cacao projects, INRIA.
|
||||
|
||||
This file is part of the GNU MPFR Library.
|
||||
|
||||
The GNU MPFR Library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
The GNU MPFR Library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
|
||||
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef __MPFR_H
|
||||
#define __MPFR_H
|
||||
|
||||
/* Define MPFR version number */
|
||||
#define MPFR_VERSION_MAJOR 3
|
||||
#define MPFR_VERSION_MINOR 0
|
||||
#define MPFR_VERSION_PATCHLEVEL 0
|
||||
#define MPFR_VERSION_STRING "3.0.0"
|
||||
|
||||
/* Macros dealing with MPFR VERSION */
|
||||
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
|
||||
#define MPFR_VERSION \
|
||||
MPFR_VERSION_NUM(MPFR_VERSION_MAJOR,MPFR_VERSION_MINOR,MPFR_VERSION_PATCHLEVEL)
|
||||
|
||||
/* Check if GMP is included, and try to include it (Works with local GMP) */
|
||||
#ifndef __GMP_H__
|
||||
# include <gmp.h>
|
||||
#endif
|
||||
|
||||
/* Check if stdio.h is included or if the user wants FILE */
|
||||
#if defined (_GMP_H_HAVE_FILE) || defined (MPFR_USE_FILE)
|
||||
# define _MPFR_H_HAVE_FILE 1
|
||||
#endif
|
||||
|
||||
#if defined (_GMP_H_HAVE_VA_LIST)
|
||||
# define _MPFR_H_HAVE_VA_LIST 1
|
||||
#endif
|
||||
|
||||
/* Check if <stdint.h> / <inttypes.h> is included or if the user
|
||||
explicitly wants intmax_t. Automatical detection is done by
|
||||
checking:
|
||||
- INTMAX_C and UINTMAX_C, but not if the compiler is a C++ one
|
||||
(as suggested by Patrick Pelissier) because the test does not
|
||||
work well in this case. See:
|
||||
http://websympa.loria.fr/wwsympa/arc/mpfr/2010-02/msg00025.html
|
||||
We do not check INTMAX_MAX and UINTMAX_MAX because under Solaris,
|
||||
these macros are always defined by <limits.h> (i.e. even when
|
||||
<stdint.h> and <inttypes.h> are not included).
|
||||
- _STDINT_H (defined by the glibc) and _STDINT_H_ (defined under
|
||||
Mac OS X), but this test may not work with all implementations.
|
||||
Portable software should not rely on these tests.
|
||||
*/
|
||||
#if (defined (INTMAX_C) && defined (UINTMAX_C) && !defined(__cplusplus)) || \
|
||||
defined (MPFR_USE_INTMAX_T) || defined (_STDINT_H) || defined (_STDINT_H_)
|
||||
# define _MPFR_H_HAVE_INTMAX_T 1
|
||||
#endif
|
||||
|
||||
/* Definition of rounding modes (DON'T USE MPFR_RNDNA!).
|
||||
Warning! Changing the contents of this enum should be seen as an
|
||||
interface change since the old and the new types are not compatible
|
||||
(the integer type compatible with the enumerated type can even change,
|
||||
see ISO C99, 6.7.2.2#4), and in Makefile.am, AGE should be set to 0.
|
||||
|
||||
MPFR_RNDU must appear just before MPFR_RNDD (see
|
||||
MPFR_IS_RNDUTEST_OR_RNDDNOTTEST in mpfr-impl.h).
|
||||
|
||||
MPFR_RNDF has been added, though not implemented yet, in order to avoid
|
||||
to break the ABI once faithful rounding gets implemented.
|
||||
|
||||
If you change the order of the rounding modes, please update the routines
|
||||
in texceptions.c which assume 0=RNDN, 1=RNDZ, 2=RNDU, 3=RNDD, 4=RNDA.
|
||||
*/
|
||||
typedef enum {
|
||||
MPFR_RNDN=0, /* round to nearest, with ties to even */
|
||||
MPFR_RNDZ, /* round toward zero */
|
||||
MPFR_RNDU, /* round toward +Inf */
|
||||
MPFR_RNDD, /* round toward -Inf */
|
||||
MPFR_RNDA, /* round away from zero */
|
||||
MPFR_RNDF, /* faithful rounding (not implemented yet) */
|
||||
MPFR_RNDNA=-1 /* round to nearest, with ties away from zero (mpfr_round) */
|
||||
} mpfr_rnd_t;
|
||||
|
||||
/* kept for compatibility with MPFR 2.4.x and before */
|
||||
#define GMP_RNDN MPFR_RNDN
|
||||
#define GMP_RNDZ MPFR_RNDZ
|
||||
#define GMP_RNDU MPFR_RNDU
|
||||
#define GMP_RNDD MPFR_RNDD
|
||||
|
||||
/* Define precision : 1 (short), 2 (int) or 3 (long) (DON'T USE IT!)*/
|
||||
#ifndef _MPFR_PREC_FORMAT
|
||||
# if __GMP_MP_SIZE_T_INT == 1
|
||||
# define _MPFR_PREC_FORMAT 2
|
||||
# else
|
||||
# define _MPFR_PREC_FORMAT 3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Let's make mpfr_prec_t signed in order to avoid problems due to the
|
||||
usual arithmetic conversions when mixing mpfr_prec_t and mpfr_exp_t
|
||||
in an expression (for error analysis) if casts are forgotten. */
|
||||
#if _MPFR_PREC_FORMAT == 1
|
||||
typedef short mpfr_prec_t;
|
||||
typedef unsigned short mpfr_uprec_t;
|
||||
#elif _MPFR_PREC_FORMAT == 2
|
||||
typedef int mpfr_prec_t;
|
||||
typedef unsigned int mpfr_uprec_t;
|
||||
#elif _MPFR_PREC_FORMAT == 3
|
||||
typedef long mpfr_prec_t;
|
||||
typedef unsigned long mpfr_uprec_t;
|
||||
#else
|
||||
# error "Invalid MPFR Prec format"
|
||||
#endif
|
||||
|
||||
/* Definition of precision limits without needing <limits.h> */
|
||||
/* Note: the casts allows the expression to yield the wanted behavior
|
||||
for _MPFR_PREC_FORMAT == 1 (due to integer promotion rules). */
|
||||
#define MPFR_PREC_MIN 2
|
||||
#define MPFR_PREC_MAX ((mpfr_prec_t)((mpfr_uprec_t)(~(mpfr_uprec_t)0)>>1))
|
||||
|
||||
/* Definition of sign */
|
||||
typedef int mpfr_sign_t;
|
||||
|
||||
/* Definition of the exponent: same as in GMP. */
|
||||
typedef mp_exp_t mpfr_exp_t;
|
||||
|
||||
/* Definition of the standard exponent limits */
|
||||
#define MPFR_EMAX_DEFAULT ((mpfr_exp_t) (((unsigned long) 1 << 30) - 1))
|
||||
#define MPFR_EMIN_DEFAULT (-(MPFR_EMAX_DEFAULT))
|
||||
|
||||
/* Definition of the main structure */
|
||||
typedef struct {
|
||||
mpfr_prec_t _mpfr_prec;
|
||||
mpfr_sign_t _mpfr_sign;
|
||||
mpfr_exp_t _mpfr_exp;
|
||||
mp_limb_t *_mpfr_d;
|
||||
} __mpfr_struct;
|
||||
|
||||
/* Compatibility with previous types of MPFR */
|
||||
#ifndef mp_rnd_t
|
||||
# define mp_rnd_t mpfr_rnd_t
|
||||
#endif
|
||||
#ifndef mp_prec_t
|
||||
# define mp_prec_t mpfr_prec_t
|
||||
#endif
|
||||
|
||||
/*
|
||||
The represented number is
|
||||
_sign*(_d[k-1]/B+_d[k-2]/B^2+...+_d[0]/B^k)*2^_exp
|
||||
where k=ceil(_mp_prec/GMP_NUMB_BITS) and B=2^GMP_NUMB_BITS.
|
||||
|
||||
For the msb (most significant bit) normalized representation, we must have
|
||||
_d[k-1]>=B/2, unless the number is singular.
|
||||
|
||||
We must also have the last k*GMP_NUMB_BITS-_prec bits set to zero.
|
||||
*/
|
||||
|
||||
typedef __mpfr_struct mpfr_t[1];
|
||||
typedef __mpfr_struct *mpfr_ptr;
|
||||
typedef __gmp_const __mpfr_struct *mpfr_srcptr;
|
||||
|
||||
/* For those who need a direct and fast access to the sign field.
|
||||
However it is not in the API, thus use it at your own risk: it might
|
||||
not be supported, or change name, in further versions!
|
||||
Unfortunately, it must be defined here (instead of MPFR's internal
|
||||
header file mpfr-impl.h) because it is used by some macros below.
|
||||
*/
|
||||
#define MPFR_SIGN(x) ((x)->_mpfr_sign)
|
||||
|
||||
/* Stack interface */
|
||||
typedef enum {
|
||||
MPFR_NAN_KIND = 0,
|
||||
MPFR_INF_KIND = 1, MPFR_ZERO_KIND = 2, MPFR_REGULAR_KIND = 3
|
||||
} mpfr_kind_t;
|
||||
|
||||
/* GMP defines:
|
||||
+ size_t: Standard size_t
|
||||
+ __GMP_ATTRIBUTE_PURE Attribute for math functions.
|
||||
+ __GMP_NOTHROW For C++: can't throw .
|
||||
+ __GMP_EXTERN_INLINE Attribute for inline function.
|
||||
* __gmp_const const (Supports for K&R compiler only for mpfr.h).
|
||||
+ __GMP_DECLSPEC_EXPORT compiling to go into a DLL
|
||||
+ __GMP_DECLSPEC_IMPORT compiling to go into a application
|
||||
*/
|
||||
/* Extra MPFR defines */
|
||||
#define __MPFR_SENTINEL_ATTR
|
||||
#if defined (__GNUC__)
|
||||
# if __GNUC__ >= 4
|
||||
# undef __MPFR_SENTINEL_ATTR
|
||||
# define __MPFR_SENTINEL_ATTR __attribute__ ((sentinel))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Prototypes: Support of K&R compiler */
|
||||
#if defined (__GMP_PROTO)
|
||||
# define _MPFR_PROTO __GMP_PROTO
|
||||
#elif defined (__STDC__) || defined (__cplusplus)
|
||||
# define _MPFR_PROTO(x) x
|
||||
#else
|
||||
# define _MPFR_PROTO(x) ()
|
||||
#endif
|
||||
/* Support for WINDOWS Dll:
|
||||
Check if we are inside a MPFR build, and if so export the functions.
|
||||
Otherwise does the same thing as GMP */
|
||||
#if defined(__MPFR_WITHIN_MPFR) && __GMP_LIBGMP_DLL
|
||||
# define __MPFR_DECLSPEC __GMP_DECLSPEC_EXPORT
|
||||
#else
|
||||
# define __MPFR_DECLSPEC __GMP_DECLSPEC
|
||||
#endif
|
||||
|
||||
/* Note: In order to be declared, some functions need a specific
|
||||
system header to be included *before* "mpfr.h". If the user
|
||||
forgets to include the header, the MPFR function prototype in
|
||||
the user object file is not correct. To avoid wrong results,
|
||||
we raise a linker error in that case by changing their internal
|
||||
name in the library (prefixed by __gmpfr instead of mpfr). See
|
||||
the lines of the form "#define mpfr_xxx __gmpfr_xxx" below. */
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__MPFR_DECLSPEC __gmp_const char * mpfr_get_version _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC __gmp_const char * mpfr_get_patches _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_buildopt_tls_p _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_buildopt_decimal_p _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emin _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_set_emin _MPFR_PROTO ((mpfr_exp_t));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emin_min _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emin_max _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emax _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_set_emax _MPFR_PROTO ((mpfr_exp_t));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emax_min _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emax_max _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_set_default_rounding_mode _MPFR_PROTO((mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC mpfr_rnd_t mpfr_get_default_rounding_mode _MPFR_PROTO((void));
|
||||
__MPFR_DECLSPEC __gmp_const char *
|
||||
mpfr_print_rnd_mode _MPFR_PROTO((mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_clear_flags _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_clear_underflow _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_clear_overflow _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_clear_nanflag _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_clear_inexflag _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_clear_erangeflag _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_set_underflow _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_set_overflow _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_set_nanflag _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_set_inexflag _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_set_erangeflag _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_underflow_p _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_overflow_p _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_nanflag_p _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_inexflag_p _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_erangeflag_p _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_check_range _MPFR_PROTO ((mpfr_ptr, int, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_init2 _MPFR_PROTO ((mpfr_ptr, mpfr_prec_t));
|
||||
__MPFR_DECLSPEC void mpfr_init _MPFR_PROTO ((mpfr_ptr));
|
||||
__MPFR_DECLSPEC void mpfr_clear _MPFR_PROTO ((mpfr_ptr));
|
||||
|
||||
__MPFR_DECLSPEC void
|
||||
mpfr_inits2 _MPFR_PROTO ((mpfr_prec_t, mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR;
|
||||
__MPFR_DECLSPEC void
|
||||
mpfr_inits _MPFR_PROTO ((mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR;
|
||||
__MPFR_DECLSPEC void
|
||||
mpfr_clears _MPFR_PROTO ((mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR;
|
||||
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_prec_round _MPFR_PROTO ((mpfr_ptr, mpfr_prec_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_can_round _MPFR_PROTO ((mpfr_srcptr, mpfr_exp_t, mpfr_rnd_t, mpfr_rnd_t,
|
||||
mpfr_prec_t));
|
||||
__MPFR_DECLSPEC mpfr_prec_t mpfr_min_prec _MPFR_PROTO ((mpfr_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_exp _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_set_exp _MPFR_PROTO ((mpfr_ptr, mpfr_exp_t));
|
||||
__MPFR_DECLSPEC mpfr_prec_t mpfr_get_prec _MPFR_PROTO((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC void mpfr_set_prec _MPFR_PROTO((mpfr_ptr, mpfr_prec_t));
|
||||
__MPFR_DECLSPEC void mpfr_set_prec_raw _MPFR_PROTO((mpfr_ptr, mpfr_prec_t));
|
||||
__MPFR_DECLSPEC void mpfr_set_default_prec _MPFR_PROTO((mpfr_prec_t));
|
||||
__MPFR_DECLSPEC mpfr_prec_t mpfr_get_default_prec _MPFR_PROTO((void));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_set_d _MPFR_PROTO ((mpfr_ptr, double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_set_flt _MPFR_PROTO ((mpfr_ptr, float, mpfr_rnd_t));
|
||||
#ifdef MPFR_WANT_DECIMAL_FLOATS
|
||||
__MPFR_DECLSPEC int mpfr_set_decimal64 _MPFR_PROTO ((mpfr_ptr, _Decimal64,
|
||||
mpfr_rnd_t));
|
||||
#endif
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_ld _MPFR_PROTO ((mpfr_ptr, long double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_z _MPFR_PROTO ((mpfr_ptr, mpz_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_z_2exp _MPFR_PROTO ((mpfr_ptr, mpz_srcptr, mpfr_exp_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC void mpfr_set_nan _MPFR_PROTO ((mpfr_ptr));
|
||||
__MPFR_DECLSPEC void mpfr_set_inf _MPFR_PROTO ((mpfr_ptr, int));
|
||||
__MPFR_DECLSPEC void mpfr_set_zero _MPFR_PROTO ((mpfr_ptr, int));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_f _MPFR_PROTO ((mpfr_ptr, mpf_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_get_f _MPFR_PROTO ((mpf_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_set_si _MPFR_PROTO ((mpfr_ptr, long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_ui _MPFR_PROTO ((mpfr_ptr, unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_si_2exp _MPFR_PROTO ((mpfr_ptr, long, mpfr_exp_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_ui_2exp _MPFR_PROTO ((mpfr_ptr,unsigned long,mpfr_exp_t,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_q _MPFR_PROTO ((mpfr_ptr, mpq_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_str _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_init_set_str _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, int,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set4 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t, int));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_abs _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_neg _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_signbit _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_setsign _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_copysign _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
#ifdef _MPFR_H_HAVE_INTMAX_T
|
||||
#define mpfr_set_sj __gmpfr_set_sj
|
||||
#define mpfr_set_sj_2exp __gmpfr_set_sj_2exp
|
||||
#define mpfr_set_uj __gmpfr_set_uj
|
||||
#define mpfr_set_uj_2exp __gmpfr_set_uj_2exp
|
||||
#define mpfr_get_sj __gmpfr_mpfr_get_sj
|
||||
#define mpfr_get_uj __gmpfr_mpfr_get_uj
|
||||
__MPFR_DECLSPEC int mpfr_set_sj _MPFR_PROTO ((mpfr_t, intmax_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_sj_2exp _MPFR_PROTO ((mpfr_t, intmax_t, intmax_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_set_uj _MPFR_PROTO ((mpfr_t, uintmax_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_uj_2exp _MPFR_PROTO ((mpfr_t, uintmax_t, intmax_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC intmax_t mpfr_get_sj _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC uintmax_t mpfr_get_uj _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
|
||||
#endif
|
||||
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_z_2exp _MPFR_PROTO ((mpz_ptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC float mpfr_get_flt _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC double mpfr_get_d _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
|
||||
#ifdef MPFR_WANT_DECIMAL_FLOATS
|
||||
__MPFR_DECLSPEC _Decimal64 mpfr_get_decimal64 _MPFR_PROTO ((mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
#endif
|
||||
__MPFR_DECLSPEC long double mpfr_get_ld _MPFR_PROTO ((mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC double mpfr_get_d1 _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC double mpfr_get_d_2exp _MPFR_PROTO ((long*, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC long double mpfr_get_ld_2exp _MPFR_PROTO ((long*, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC long mpfr_get_si _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC unsigned long mpfr_get_ui _MPFR_PROTO ((mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC char*mpfr_get_str _MPFR_PROTO ((char*, mpfr_exp_t*, int, size_t,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_get_z _MPFR_PROTO ((mpz_ptr z, mpfr_srcptr f,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_free_str _MPFR_PROTO ((char *));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_urandom _MPFR_PROTO ((mpfr_ptr, gmp_randstate_t,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_urandomb _MPFR_PROTO ((mpfr_ptr, gmp_randstate_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_nextabove _MPFR_PROTO ((mpfr_ptr));
|
||||
__MPFR_DECLSPEC void mpfr_nextbelow _MPFR_PROTO ((mpfr_ptr));
|
||||
__MPFR_DECLSPEC void mpfr_nexttoward _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr));
|
||||
|
||||
#ifdef _MPFR_H_HAVE_FILE
|
||||
#define mpfr_inp_str __gmpfr_inp_str
|
||||
#define mpfr_out_str __gmpfr_out_str
|
||||
__MPFR_DECLSPEC size_t mpfr_inp_str _MPFR_PROTO ((mpfr_ptr, FILE*, int,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC size_t mpfr_out_str _MPFR_PROTO ((FILE*, int, size_t,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
#define mpfr_fprintf __gmpfr_fprintf
|
||||
__MPFR_DECLSPEC int mpfr_fprintf _MPFR_PROTO ((FILE*, __gmp_const char*,
|
||||
...));
|
||||
#endif
|
||||
__MPFR_DECLSPEC int mpfr_printf _MPFR_PROTO ((__gmp_const char*, ...));
|
||||
__MPFR_DECLSPEC int mpfr_asprintf _MPFR_PROTO ((char**, __gmp_const char*,
|
||||
...));
|
||||
__MPFR_DECLSPEC int mpfr_sprintf _MPFR_PROTO ((char*, __gmp_const char*,
|
||||
...));
|
||||
__MPFR_DECLSPEC int mpfr_snprintf _MPFR_PROTO ((char*, size_t,
|
||||
__gmp_const char*, ...));
|
||||
|
||||
#ifdef _MPFR_H_HAVE_VA_LIST
|
||||
#ifdef _MPFR_H_HAVE_FILE
|
||||
#define mpfr_vfprintf __gmpfr_vfprintf
|
||||
__MPFR_DECLSPEC int mpfr_vfprintf _MPFR_PROTO ((FILE*, __gmp_const char*,
|
||||
va_list));
|
||||
#endif /* _MPFR_H_HAVE_FILE */
|
||||
#define mpfr_vprintf __gmpfr_vprintf
|
||||
#define mpfr_vasprintf __gmpfr_vasprintf
|
||||
#define mpfr_vsprintf __gmpfr_vsprintf
|
||||
#define mpfr_vsnprintf __gmpfr_vsnprintf
|
||||
__MPFR_DECLSPEC int mpfr_vprintf _MPFR_PROTO ((__gmp_const char*, va_list));
|
||||
__MPFR_DECLSPEC int mpfr_vasprintf _MPFR_PROTO ((char**, __gmp_const char*,
|
||||
va_list));
|
||||
__MPFR_DECLSPEC int mpfr_vsprintf _MPFR_PROTO ((char*, __gmp_const char*,
|
||||
va_list));
|
||||
__MPFR_DECLSPEC int mpfr_vsnprintf _MPFR_PROTO ((char*, size_t,
|
||||
__gmp_const char*, va_list));
|
||||
#endif /* _MPFR_H_HAVE_VA_LIST */
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_pow _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_pow_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_pow_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_ui_pow_ui _MPFR_PROTO ((mpfr_ptr, unsigned long int,
|
||||
unsigned long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_ui_pow _MPFR_PROTO ((mpfr_ptr, unsigned long int,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_pow_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpz_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_sqrt _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sqrt_ui _MPFR_PROTO ((mpfr_ptr, unsigned long,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_rec_sqrt _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_add _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_add_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_ui_sub _MPFR_PROTO ((mpfr_ptr, unsigned long,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_ui_div _MPFR_PROTO ((mpfr_ptr, unsigned long,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_add_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_si_sub _MPFR_PROTO ((mpfr_ptr, long int,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_si_div _MPFR_PROTO ((mpfr_ptr, long int,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_add_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_d_sub _MPFR_PROTO ((mpfr_ptr, double,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_d_div _MPFR_PROTO ((mpfr_ptr, double,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_sqr _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_const_pi _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_const_log2 _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_const_euler _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_const_catalan _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_agm _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_log _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_log2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_log10 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_log1p _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_exp2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_exp10 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_expm1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_eint _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_li2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_cmp _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_cmp3 _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr, int));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_d _MPFR_PROTO ((mpfr_srcptr, double));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_ld _MPFR_PROTO ((mpfr_srcptr, long double));
|
||||
__MPFR_DECLSPEC int mpfr_cmpabs _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_ui _MPFR_PROTO ((mpfr_srcptr, unsigned long));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_si _MPFR_PROTO ((mpfr_srcptr, long));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_ui_2exp _MPFR_PROTO ((mpfr_srcptr, unsigned long,
|
||||
mpfr_exp_t));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_si_2exp _MPFR_PROTO ((mpfr_srcptr, long,
|
||||
mpfr_exp_t));
|
||||
__MPFR_DECLSPEC void mpfr_reldiff _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_eq _MPFR_PROTO((mpfr_srcptr, mpfr_srcptr,
|
||||
unsigned long));
|
||||
__MPFR_DECLSPEC int mpfr_sgn _MPFR_PROTO ((mpfr_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_mul_2exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_2exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul_2ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_2ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul_2si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_2si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_rint _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_round _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_trunc _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_ceil _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_floor _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_rint_round _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_rint_trunc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_rint_ceil _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_rint_floor _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_frac _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_modf _MPFR_PROTO ((mpfr_ptr, mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_remquo _MPFR_PROTO ((mpfr_ptr, long*, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_remainder _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fmod _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_fits_ulong_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_slong_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_uint_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_sint_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_ushort_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_sshort_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_uintmax_p _MPFR_PROTO((mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_intmax_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_extract _MPFR_PROTO ((mpz_ptr, mpfr_srcptr,
|
||||
unsigned int));
|
||||
__MPFR_DECLSPEC void mpfr_swap _MPFR_PROTO ((mpfr_ptr, mpfr_ptr));
|
||||
__MPFR_DECLSPEC void mpfr_dump _MPFR_PROTO ((mpfr_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_nan_p _MPFR_PROTO((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_inf_p _MPFR_PROTO((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_number_p _MPFR_PROTO((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_integer_p _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_zero_p _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_regular_p _MPFR_PROTO ((mpfr_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_greater_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_greaterequal_p _MPFR_PROTO ((mpfr_srcptr,
|
||||
mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_less_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_lessequal_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_lessgreater_p _MPFR_PROTO((mpfr_srcptr,mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_equal_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_unordered_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_atanh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_acosh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_asinh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cosh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sinh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_tanh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sinh_cosh _MPFR_PROTO ((mpfr_ptr, mpfr_ptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_sech _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_csch _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_coth _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_acos _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_asin _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_atan _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sin _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sin_cos _MPFR_PROTO ((mpfr_ptr, mpfr_ptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cos _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_tan _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_atan2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sec _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_csc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cot _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_hypot _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_erf _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_erfc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cbrt _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_root _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,unsigned long,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_gamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_lngamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_lgamma _MPFR_PROTO((mpfr_ptr,int*,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_digamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_zeta _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_zeta_ui _MPFR_PROTO ((mpfr_ptr,unsigned long,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fac_ui _MPFR_PROTO ((mpfr_ptr, unsigned long int,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_j0 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_j1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_jn _MPFR_PROTO ((mpfr_ptr, long, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_y0 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_y1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_yn _MPFR_PROTO ((mpfr_ptr, long, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_ai _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_min _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_max _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_dim _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_mul_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpz_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpz_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_add_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpz_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpz_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_z _MPFR_PROTO ((mpfr_srcptr, mpz_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_mul_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpq_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpq_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_add_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpq_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpq_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_q _MPFR_PROTO ((mpfr_srcptr, mpq_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_cmp_f _MPFR_PROTO ((mpfr_srcptr, mpf_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_fma _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fms _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sum _MPFR_PROTO ((mpfr_ptr, mpfr_ptr *__gmp_const,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_free_cache _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_subnormalize _MPFR_PROTO ((mpfr_ptr, int,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_strtofr _MPFR_PROTO ((mpfr_ptr, __gmp_const char *,
|
||||
char **, int, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC size_t mpfr_custom_get_size _MPFR_PROTO ((mpfr_prec_t));
|
||||
__MPFR_DECLSPEC void mpfr_custom_init _MPFR_PROTO ((void *, mpfr_prec_t));
|
||||
__MPFR_DECLSPEC void * mpfr_custom_get_significand _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_custom_get_exp _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC void mpfr_custom_move _MPFR_PROTO ((mpfr_ptr, void *));
|
||||
__MPFR_DECLSPEC void mpfr_custom_init_set _MPFR_PROTO ((mpfr_ptr, int,
|
||||
mpfr_exp_t, mpfr_prec_t, void *));
|
||||
__MPFR_DECLSPEC int mpfr_custom_get_kind _MPFR_PROTO ((mpfr_srcptr));
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* DON'T USE THIS! (For MPFR-public macros only, see below.)
|
||||
The mpfr_sgn macro uses the fact that __MPFR_EXP_NAN and __MPFR_EXP_ZERO
|
||||
are the smallest values.
|
||||
FIXME: In the following macros, the cast of an unsigned type with MSB set
|
||||
to the signed type mpfr_exp_t yields an integer overflow, which can give
|
||||
unexpected results with future compilers and aggressive optimisations.
|
||||
Why not working only with signed types, using INT_MIN and LONG_MIN? */
|
||||
#if __GMP_MP_SIZE_T_INT
|
||||
#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+2))
|
||||
#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+1))
|
||||
#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+3))
|
||||
#else
|
||||
#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+2))
|
||||
#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+1))
|
||||
#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+3))
|
||||
#endif
|
||||
|
||||
/* Define MPFR_USE_EXTENSION to avoid "gcc -pedantic" warnings. */
|
||||
#ifndef MPFR_EXTENSION
|
||||
# if defined(MPFR_USE_EXTENSION)
|
||||
# define MPFR_EXTENSION __extension__
|
||||
# else
|
||||
# define MPFR_EXTENSION
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Warning! This macro doesn't work with K&R C (e.g., compare the "gcc -E"
|
||||
output with and without -traditional) and shouldn't be used internally.
|
||||
For public use only, but see the MPFR manual. */
|
||||
#define MPFR_DECL_INIT(_x, _p) \
|
||||
MPFR_EXTENSION mp_limb_t __gmpfr_local_tab_##_x[((_p)-1)/GMP_NUMB_BITS+1]; \
|
||||
MPFR_EXTENSION mpfr_t _x = {{(_p),1,__MPFR_EXP_NAN,__gmpfr_local_tab_##_x}}
|
||||
|
||||
/* Fast access macros to replace function interface.
|
||||
If the USER don't want to use the macro interface, let him make happy
|
||||
even if it produces faster and smaller code. */
|
||||
#ifndef MPFR_USE_NO_MACRO
|
||||
|
||||
/* Inlining theses functions is both faster and smaller */
|
||||
#define mpfr_nan_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_NAN)
|
||||
#define mpfr_inf_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_INF)
|
||||
#define mpfr_zero_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_ZERO)
|
||||
#define mpfr_regular_p(_x) ((_x)->_mpfr_exp > __MPFR_EXP_INF)
|
||||
#define mpfr_sgn(_x) \
|
||||
((_x)->_mpfr_exp < __MPFR_EXP_INF ? \
|
||||
(mpfr_nan_p (_x) ? mpfr_set_erangeflag () : (void) 0), 0 : \
|
||||
MPFR_SIGN (_x))
|
||||
|
||||
/* Prevent them from using as lvalues */
|
||||
#define MPFR_VALUE_OF(x) (0 ? (x) : (x))
|
||||
#define mpfr_get_prec(_x) MPFR_VALUE_OF((_x)->_mpfr_prec)
|
||||
#define mpfr_get_exp(_x) MPFR_VALUE_OF((_x)->_mpfr_exp)
|
||||
/* Note: if need be, the MPFR_VALUE_OF can be used for other expressions
|
||||
(of any type). Thanks to Wojtek Lerch and Tim Rentsch for the idea. */
|
||||
|
||||
#define mpfr_round(a,b) mpfr_rint((a), (b), MPFR_RNDNA)
|
||||
#define mpfr_trunc(a,b) mpfr_rint((a), (b), MPFR_RNDZ)
|
||||
#define mpfr_ceil(a,b) mpfr_rint((a), (b), MPFR_RNDU)
|
||||
#define mpfr_floor(a,b) mpfr_rint((a), (b), MPFR_RNDD)
|
||||
|
||||
#define mpfr_cmp_ui(b,i) mpfr_cmp_ui_2exp((b),(i),0)
|
||||
#define mpfr_cmp_si(b,i) mpfr_cmp_si_2exp((b),(i),0)
|
||||
#define mpfr_set(a,b,r) mpfr_set4(a,b,r,MPFR_SIGN(b))
|
||||
#define mpfr_abs(a,b,r) mpfr_set4(a,b,r,1)
|
||||
#define mpfr_copysign(a,b,c,r) mpfr_set4(a,b,r,MPFR_SIGN(c))
|
||||
#define mpfr_setsign(a,b,s,r) mpfr_set4(a,b,r,(s) ? -1 : 1)
|
||||
#define mpfr_signbit(x) (MPFR_SIGN(x) < 0)
|
||||
#define mpfr_cmp(b, c) mpfr_cmp3(b, c, 1)
|
||||
#define mpfr_mul_2exp(y,x,n,r) mpfr_mul_2ui((y),(x),(n),(r))
|
||||
#define mpfr_div_2exp(y,x,n,r) mpfr_div_2ui((y),(x),(n),(r))
|
||||
|
||||
|
||||
/* When using GCC, optimize certain common comparisons and affectations.
|
||||
+ Remove ICC since it defines __GNUC__ but produces a
|
||||
huge number of warnings if you use this code.
|
||||
VL: I couldn't reproduce a single warning when enabling these macros
|
||||
with icc 10.1 20080212 on Itanium. But with this version, __ICC isn't
|
||||
defined (__INTEL_COMPILER is, though), so that these macros are enabled
|
||||
anyway. Checking with other ICC versions is needed. Possibly detect
|
||||
whether warnings are produced or not with a configure test.
|
||||
+ Remove C++ too, since it complains too much. */
|
||||
#if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
|
||||
#if (__GNUC__ >= 2)
|
||||
#undef mpfr_cmp_ui
|
||||
/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0. */
|
||||
#define mpfr_cmp_ui(_f,_u) \
|
||||
(__builtin_constant_p (_u) && (_u) == 0 ? \
|
||||
mpfr_sgn (_f) : \
|
||||
mpfr_cmp_ui_2exp ((_f),(_u),0))
|
||||
#undef mpfr_cmp_si
|
||||
#define mpfr_cmp_si(_f,_s) \
|
||||
(__builtin_constant_p (_s) && (_s) >= 0 ? \
|
||||
mpfr_cmp_ui ((_f), (_s)) : \
|
||||
mpfr_cmp_si_2exp ((_f), (_s), 0))
|
||||
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
|
||||
#undef mpfr_set_ui
|
||||
#define mpfr_set_ui(_f,_u,_r) \
|
||||
(__builtin_constant_p (_u) && (_u) == 0 ? \
|
||||
__extension__ ({ \
|
||||
mpfr_ptr _p = (_f); \
|
||||
_p->_mpfr_sign = 1; \
|
||||
_p->_mpfr_exp = __MPFR_EXP_ZERO; \
|
||||
(void) (_r); 0; }) : \
|
||||
mpfr_set_ui_2exp ((_f), (_u), 0, (_r)))
|
||||
#endif
|
||||
#undef mpfr_set_si
|
||||
#define mpfr_set_si(_f,_s,_r) \
|
||||
(__builtin_constant_p (_s) && (_s) >= 0 ? \
|
||||
mpfr_set_ui ((_f), (_s), (_r)) : \
|
||||
mpfr_set_si_2exp ((_f), (_s), 0, (_r)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Macro version of mpfr_stack interface for fast access */
|
||||
#define mpfr_custom_get_size(p) ((size_t) \
|
||||
(((p)+GMP_NUMB_BITS-1)/GMP_NUMB_BITS*sizeof (mp_limb_t)))
|
||||
#define mpfr_custom_init(m,p) do {} while (0)
|
||||
#define mpfr_custom_get_significand(x) ((void*)((x)->_mpfr_d))
|
||||
#define mpfr_custom_get_exp(x) ((x)->_mpfr_exp)
|
||||
#define mpfr_custom_move(x,m) do { ((x)->_mpfr_d = (mp_limb_t*)(m)); } while (0)
|
||||
#define mpfr_custom_init_set(x,k,e,p,m) do { \
|
||||
mpfr_ptr _x = (x); \
|
||||
mpfr_exp_t _e; \
|
||||
mpfr_kind_t _t; \
|
||||
int _s, _k; \
|
||||
_k = (k); \
|
||||
if (_k >= 0) { \
|
||||
_t = (mpfr_kind_t) _k; \
|
||||
_s = 1; \
|
||||
} else { \
|
||||
_t = (mpfr_kind_t) -k; \
|
||||
_s = -1; \
|
||||
} \
|
||||
_e = _t == MPFR_REGULAR_KIND ? (e) : \
|
||||
_t == MPFR_NAN_KIND ? __MPFR_EXP_NAN : \
|
||||
_t == MPFR_INF_KIND ? __MPFR_EXP_INF : __MPFR_EXP_ZERO; \
|
||||
_x->_mpfr_prec = (p); \
|
||||
_x->_mpfr_sign = _s; \
|
||||
_x->_mpfr_exp = _e; \
|
||||
_x->_mpfr_d = (mp_limb_t*) (m); \
|
||||
} while (0)
|
||||
#define mpfr_custom_get_kind(x) \
|
||||
( (x)->_mpfr_exp > __MPFR_EXP_INF ? (int)MPFR_REGULAR_KIND*MPFR_SIGN (x) \
|
||||
: (x)->_mpfr_exp == __MPFR_EXP_INF ? (int)MPFR_INF_KIND*MPFR_SIGN (x) \
|
||||
: (x)->_mpfr_exp == __MPFR_EXP_NAN ? (int)MPFR_NAN_KIND \
|
||||
: (int) MPFR_ZERO_KIND * MPFR_SIGN (x) )
|
||||
|
||||
|
||||
#endif /* MPFR_USE_NO_MACRO */
|
||||
|
||||
/* Theses are defined to be macros */
|
||||
#define mpfr_init_set_si(x, i, rnd) \
|
||||
( mpfr_init(x), mpfr_set_si((x), (i), (rnd)) )
|
||||
#define mpfr_init_set_ui(x, i, rnd) \
|
||||
( mpfr_init(x), mpfr_set_ui((x), (i), (rnd)) )
|
||||
#define mpfr_init_set_d(x, d, rnd) \
|
||||
( mpfr_init(x), mpfr_set_d((x), (d), (rnd)) )
|
||||
#define mpfr_init_set_ld(x, d, rnd) \
|
||||
( mpfr_init(x), mpfr_set_ld((x), (d), (rnd)) )
|
||||
#define mpfr_init_set_z(x, i, rnd) \
|
||||
( mpfr_init(x), mpfr_set_z((x), (i), (rnd)) )
|
||||
#define mpfr_init_set_q(x, i, rnd) \
|
||||
( mpfr_init(x), mpfr_set_q((x), (i), (rnd)) )
|
||||
#define mpfr_init_set(x, y, rnd) \
|
||||
( mpfr_init(x), mpfr_set((x), (y), (rnd)) )
|
||||
#define mpfr_init_set_f(x, y, rnd) \
|
||||
( mpfr_init(x), mpfr_set_f((x), (y), (rnd)) )
|
||||
|
||||
/* Compatibility layer -- obsolete functions and macros */
|
||||
#define mpfr_cmp_abs mpfr_cmpabs
|
||||
#define mpfr_round_prec(x,r,p) mpfr_prec_round(x,p,r)
|
||||
#define __gmp_default_rounding_mode (mpfr_get_default_rounding_mode())
|
||||
#define __mpfr_emin (mpfr_get_emin())
|
||||
#define __mpfr_emax (mpfr_get_emax())
|
||||
#define __mpfr_default_fp_bit_precision (mpfr_get_default_fp_bit_precision())
|
||||
#define MPFR_EMIN_MIN mpfr_get_emin_min()
|
||||
#define MPFR_EMIN_MAX mpfr_get_emin_max()
|
||||
#define MPFR_EMAX_MIN mpfr_get_emax_min()
|
||||
#define MPFR_EMAX_MAX mpfr_get_emax_max()
|
||||
#define mpfr_version (mpfr_get_version())
|
||||
#ifndef mpz_set_fr
|
||||
# define mpz_set_fr mpfr_get_z
|
||||
#endif
|
||||
#define mpfr_add_one_ulp(x,r) \
|
||||
(mpfr_sgn (x) > 0 ? mpfr_nextabove (x) : mpfr_nextbelow (x))
|
||||
#define mpfr_sub_one_ulp(x,r) \
|
||||
(mpfr_sgn (x) > 0 ? mpfr_nextbelow (x) : mpfr_nextabove (x))
|
||||
#define mpfr_get_z_exp mpfr_get_z_2exp
|
||||
#define mpfr_custom_get_mantissa mpfr_custom_get_significand
|
||||
|
||||
#endif /* __MPFR_H*/
|
BIN
deps/MPFR/mpfr/lib/win32/libmpfr-4.dll
vendored
Normal file
BIN
deps/MPFR/mpfr/lib/win32/libmpfr-4.lib
vendored
Normal file
BIN
deps/MPFR/mpfr/lib/win64/libmpfr-4.dll
vendored
Normal file
BIN
deps/MPFR/mpfr/lib/win64/libmpfr-4.lib
vendored
Normal file
674
deps/MPFR/mpfr/mpfr.COPYING
vendored
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
165
deps/MPFR/mpfr/mpfr.COPYING.LESSER
vendored
Normal file
@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
91
deps/MPFR/mpfr/mpfr.README
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
Contributed by the Arenaire and Cacao projects, INRIA.
|
||||
|
||||
This file is part of the GNU MPFR Library.
|
||||
|
||||
The GNU MPFR Library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
The GNU MPFR Library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
|
||||
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
##############################################################################
|
||||
|
||||
The GNU MPFR distribution contains the following files:
|
||||
(This does not apply to code retrieved by Subversion.)
|
||||
|
||||
AUTHORS - the authors of the library
|
||||
BUGS - bugs in MPFR - please read this file!
|
||||
COPYING - the GNU General Public License, version 3
|
||||
COPYING.LESSER - the GNU Lesser General Public License, version 3
|
||||
ChangeLog - the log of changes
|
||||
FAQ.html - frequently asked questions about MPFR
|
||||
INSTALL - how to install MPFR (see also mpfr.texi)
|
||||
Makefile* - files for building the library
|
||||
NEWS - new features with respect to previous versions
|
||||
PATCHES - empty file (until patches are applied)
|
||||
README - this file
|
||||
TODO - what remains to do (any help is welcome!)
|
||||
VERSION - version of MPFR (next release version if taken by Subversion)
|
||||
ac*.m4 - automatic configuration files
|
||||
ansi2knr.* - convert ANSI C to Kernighan & Ritchie C (source and man page)
|
||||
*.c - source files
|
||||
*.h - header files
|
||||
compile - auxiliary installation file
|
||||
config.* - auxiliary installation files
|
||||
configure* - configuration files
|
||||
depcomp - auxiliary installation file
|
||||
examples/ - directory containing examples
|
||||
fdl.texi - the GNU Free Documentation License
|
||||
get_patches.sh - rebuild get_patches.c when patches have been applied
|
||||
install-sh - installation file
|
||||
ltmain.sh - auxiliary installation file
|
||||
m4/ - directory containing additional configuration files
|
||||
missing - auxiliary installation file
|
||||
mparam_h.in - header file template
|
||||
mpfr.info - info file for MPFR
|
||||
mpfr.texi - texinfo documentation for MPFR (source)
|
||||
tests/ - test directory
|
||||
texinfo.tex - TeX macros to handle mpfr.texi
|
||||
|
||||
According to the special exception to the GNU General Public License,
|
||||
the autotools files compile, config.sub, config.guess, ltmain.sh,
|
||||
m4/libtool.m4 and missing are distributed under the same licence of
|
||||
GNU MPFR.
|
||||
|
||||
|
||||
You can get the latest source code by Subversion at InriaGforge:
|
||||
|
||||
svn checkout svn://scm.gforge.inria.fr/svn/mpfr/trunk mpfr
|
||||
|
||||
or
|
||||
|
||||
svn checkout https://scm.gforge.inria.fr/svn/mpfr/trunk mpfr
|
||||
|
||||
(the last argument can be any directory name). You can use
|
||||
|
||||
svn ls svn://scm.gforge.inria.fr/svn/mpfr/branches
|
||||
svn ls svn://scm.gforge.inria.fr/svn/mpfr/tags
|
||||
|
||||
to get the list of branches or tags (releases), then checkout a
|
||||
particular branch or tag instead of the trunk. Alternatively, you
|
||||
can now use the "https:" scheme (a.k.a. DAV) instead of "svn:".
|
||||
For more information about Subversion, please see:
|
||||
|
||||
* http://svnbook.red-bean.com/ (the official Subversion book);
|
||||
* http://gcc.gnu.org/wiki/SvnHelp (written for GCC developers,
|
||||
but interesting general information can be found there);
|
||||
* http://subversion.tigris.org/faq.html (the Subversion FAQ).
|
||||
|
||||
Subversion users should read the file "README.dev".
|
||||
|
||||
Note: the old CVS repository at cvs-sop.inria.fr is now closed.
|
101
deps/OpenCSG/CMakeLists.txt.in
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(OpenCSG)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
set(GLEW_USE_STATIC_LIBS ON)
|
||||
elseif (MSVC)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
set(GLEW_VERBOSE ON)
|
||||
find_package(GLEW 1.13.0 REQUIRED)
|
||||
|
||||
set(_srcfiles
|
||||
src/area.cpp
|
||||
src/batch.cpp
|
||||
src/context.cpp
|
||||
src/channelManager.cpp
|
||||
src/frameBufferObject.cpp
|
||||
src/frameBufferObjectExt.cpp
|
||||
src/occlusionQuery.cpp
|
||||
src/opencsgRender.cpp
|
||||
src/openglHelper.cpp
|
||||
src/pBufferTexture.cpp
|
||||
src/primitive.cpp
|
||||
src/primitiveHelper.cpp
|
||||
src/renderGoldfeather.cpp
|
||||
src/renderSCS.cpp
|
||||
src/scissorMemo.cpp
|
||||
src/settings.cpp
|
||||
src/stencilManager.cpp
|
||||
RenderTexture/RenderTexture.cpp
|
||||
include/opencsg.h
|
||||
src/opencsgConfig.h
|
||||
src/area.h
|
||||
src/batch.h
|
||||
src/context.h
|
||||
src/channelManager.h
|
||||
src/frameBufferObject.h
|
||||
src/frameBufferObjectExt.h
|
||||
src/occlusionQuery.h
|
||||
src/offscreenBuffer.h
|
||||
src/opencsgRender.h
|
||||
src/openglHelper.h
|
||||
src/pBufferTexture.h
|
||||
src/primitiveHelper.h
|
||||
src/scissorMemo.h
|
||||
src/settings.h
|
||||
src/stencilManager.h
|
||||
)
|
||||
|
||||
add_library(opencsg ${_srcfiles})
|
||||
target_include_directories(opencsg PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
|
||||
target_include_directories(opencsg PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
|
||||
target_link_libraries(opencsg PRIVATE GLEW::GLEW OpenGL::GL)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
VERSION 1.4.2
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
|
||||
install(TARGETS opencsg
|
||||
EXPORT ${PROJECT_NAME}Targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
export(EXPORT ${PROJECT_NAME}Targets
|
||||
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
NAMESPACE ${PROJECT_NAME}:: )
|
||||
|
||||
set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||
|
||||
install(EXPORT ${PROJECT_NAME}Targets
|
||||
FILE
|
||||
"${PROJECT_NAME}Config.cmake"
|
||||
NAMESPACE
|
||||
${PROJECT_NAME}::
|
||||
DESTINATION
|
||||
${ConfigPackageLocation}
|
||||
)
|
||||
install(
|
||||
FILES
|
||||
${PROJECT_SOURCE_DIR}/include/opencsg.h
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/opencsg
|
||||
)
|
||||
install(
|
||||
FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
DESTINATION
|
||||
${ConfigPackageLocation}
|
||||
)
|
15
deps/OpenCSG/OpenCSG.cmake
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
prusaslicer_add_cmake_project(OpenCSG
|
||||
GIT_REPOSITORY https://github.com/floriankirsch/OpenCSG.git
|
||||
GIT_TAG 83e274457b46c9ad11a4ee599203250b1618f3b9 #v1.4.2
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in ./CMakeLists.txt
|
||||
DEPENDS dep_GLEW
|
||||
)
|
||||
|
||||
if (TARGET dep_ZLIB)
|
||||
add_dependencies(dep_OpenCSG dep_ZLIB)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_OpenCSG)
|
||||
endif ()
|
51
deps/ZLIB/0001-Respect-BUILD_SHARED_LIBS.patch
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
From 0c64e33bc2e4e7c011f5a64f5d9c7571a434cc86 Mon Sep 17 00:00:00 2001
|
||||
From: tamasmeszaros <meszaros.q@gmail.com>
|
||||
Date: Sat, 16 Nov 2019 13:43:17 +0100
|
||||
Subject: [PATCH] Respect BUILD_SHARED_LIBS
|
||||
|
||||
---
|
||||
CMakeLists.txt | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0fe939d..01dfea1 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -183,10 +183,12 @@ if(MINGW)
|
||||
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
|
||||
endif(MINGW)
|
||||
|
||||
-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
-set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
|
||||
-set_target_properties(zlib PROPERTIES SOVERSION 1)
|
||||
+add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
+if (BUILD_SHARED_LIBS)
|
||||
+ target_sources(zlib PRIVATE ${ZLIB_DLL_SRCS})
|
||||
+ set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
|
||||
+ set_target_properties(zlib PROPERTIES SOVERSION 1)
|
||||
+endif()
|
||||
|
||||
if(NOT CYGWIN)
|
||||
# This property causes shared libraries on Linux to have the full version
|
||||
@@ -201,7 +203,7 @@ endif()
|
||||
|
||||
if(UNIX)
|
||||
# On unix-like platforms the library is almost always called libz
|
||||
- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
|
||||
+ set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
|
||||
if(NOT APPLE)
|
||||
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
|
||||
endif()
|
||||
@@ -211,7 +213,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32)
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||
- install(TARGETS zlib zlibstatic
|
||||
+ install(TARGETS zlib
|
||||
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
|
||||
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
|
||||
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
|
||||
--
|
||||
2.16.2.windows.1
|
||||
|
10
deps/ZLIB/ZLIB.cmake
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
prusaslicer_add_cmake_project(ZLIB
|
||||
GIT_REPOSITORY https://github.com/madler/zlib.git
|
||||
GIT_TAG v1.2.11
|
||||
PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
|
||||
${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-Respect-BUILD_SHARED_LIBS.patch
|
||||
CMAKE_ARGS
|
||||
-DSKIP_INSTALL_FILES=ON # Prevent installation of man pages et al.
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
)
|
||||
|
2
deps/deps-macos.cmake
vendored
@ -89,7 +89,7 @@ ExternalProject_Add(dep_libcurl
|
||||
ExternalProject_Add(dep_wxwidgets
|
||||
EXCLUDE_FROM_ALL 1
|
||||
GIT_REPOSITORY "https://github.com/prusa3d/wxWidgets"
|
||||
GIT_TAG v3.1.1-patched
|
||||
GIT_TAG v3.1.3-patched
|
||||
BUILD_IN_SOURCE 1
|
||||
# PATCH_COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/wxwidgets-pngprefix.h" src/png/pngprefix.h
|
||||
CONFIGURE_COMMAND env "CXXFLAGS=${DEP_WERRORS_SDK}" "CFLAGS=${DEP_WERRORS_SDK}" ./configure
|
||||
|
6
deps/deps-unix-common.cmake
vendored
@ -7,7 +7,10 @@ else ()
|
||||
set(TBB_MINGW_WORKAROUND "")
|
||||
endif ()
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(ZLIB QUIET)
|
||||
if (NOT ZLIB_FOUND)
|
||||
include(ZLIB/ZLIB.cmake)
|
||||
endif ()
|
||||
|
||||
ExternalProject_Add(dep_tbb
|
||||
EXCLUDE_FROM_ALL 1
|
||||
@ -51,7 +54,6 @@ ExternalProject_Add(dep_nlopt
|
||||
-DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
|
||||
${DEP_CMAKE_OPTS}
|
||||
)
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
ExternalProject_Add(dep_qhull
|
||||
EXCLUDE_FROM_ALL 1
|
||||
|
65
deps/deps-windows.cmake
vendored
@ -134,7 +134,7 @@ ExternalProject_Add(dep_cereal
|
||||
ExternalProject_Add(dep_nlopt
|
||||
EXCLUDE_FROM_ALL 1
|
||||
URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz"
|
||||
URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
|
||||
URL_HASH SHA256=c81bf6d981c328f3e634709dc84746e32ff5cfb715f698ead2de4d57e30a0e70
|
||||
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
|
||||
# if (DEP_VS_VER MORE 15)
|
||||
# CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
|
||||
@ -154,38 +154,37 @@ ExternalProject_Add(dep_nlopt
|
||||
|
||||
add_debug_dep(dep_nlopt)
|
||||
|
||||
ExternalProject_Add(dep_zlib
|
||||
EXCLUDE_FROM_ALL 1
|
||||
URL "https://zlib.net/zlib-1.2.11.tar.xz"
|
||||
URL_HASH SHA256=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066
|
||||
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
|
||||
# if (DEP_VS_VER MORE 15)
|
||||
# CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
|
||||
# endif()
|
||||
CMAKE_ARGS
|
||||
-DSKIP_INSTALL_FILES=ON # Prevent installation of man pages et al.
|
||||
"-DINSTALL_BIN_DIR=${CMAKE_CURRENT_BINARY_DIR}\\fallout" # I found no better way of preventing zlib from creating & installing DLLs :-/
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
"-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local"
|
||||
BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
include(ZLIB/ZLIB.cmake)
|
||||
# ExternalProject_Add(dep_zlib
|
||||
# EXCLUDE_FROM_ALL 1
|
||||
# URL "https://zlib.net/zlib-1.2.11.tar.xz"
|
||||
# URL_HASH SHA256=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066
|
||||
# CMAKE_GENERATOR "${DEP_MSVC_GEN}"
|
||||
# CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
|
||||
# CMAKE_ARGS
|
||||
# -DSKIP_INSTALL_FILES=ON # Prevent installation of man pages et al.
|
||||
# "-DINSTALL_BIN_DIR=${CMAKE_CURRENT_BINARY_DIR}\\fallout" # I found no better way of preventing zlib from creating & installing DLLs :-/
|
||||
# -DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
# "-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local"
|
||||
# BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
|
||||
# INSTALL_COMMAND ""
|
||||
# )
|
||||
|
||||
add_debug_dep(dep_zlib)
|
||||
add_debug_dep(dep_ZLIB)
|
||||
|
||||
# The following steps are unfortunately needed to remove the _static suffix on libraries
|
||||
ExternalProject_Add_Step(dep_zlib fix_static
|
||||
DEPENDEES install
|
||||
COMMAND "${CMAKE_COMMAND}" -E rename zlibstatic.lib zlib.lib
|
||||
WORKING_DIRECTORY "${DESTDIR}\\usr\\local\\lib\\"
|
||||
)
|
||||
if (${DEP_DEBUG})
|
||||
ExternalProject_Add_Step(dep_zlib fix_static_debug
|
||||
DEPENDEES install
|
||||
COMMAND "${CMAKE_COMMAND}" -E rename zlibstaticd.lib zlibd.lib
|
||||
WORKING_DIRECTORY "${DESTDIR}\\usr\\local\\lib\\"
|
||||
)
|
||||
endif ()
|
||||
# ExternalProject_Add_Step(dep_zlib fix_static
|
||||
# DEPENDEES install
|
||||
# COMMAND "${CMAKE_COMMAND}" -E rename zlibstatic.lib zlib.lib
|
||||
# WORKING_DIRECTORY "${DESTDIR}\\usr\\local\\lib\\"
|
||||
# )
|
||||
# if (${DEP_DEBUG})
|
||||
# ExternalProject_Add_Step(dep_zlib fix_static_debug
|
||||
# DEPENDEES install
|
||||
# COMMAND "${CMAKE_COMMAND}" -E rename zlibstaticd.lib zlibd.lib
|
||||
# WORKING_DIRECTORY "${DESTDIR}\\usr\\local\\lib\\"
|
||||
# )
|
||||
# endif ()
|
||||
|
||||
if (${DEPS_BITS} EQUAL 32)
|
||||
set(DEP_LIBCURL_TARGET "x86")
|
||||
@ -221,8 +220,6 @@ if (${DEP_DEBUG})
|
||||
)
|
||||
endif ()
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
ExternalProject_Add(dep_qhull
|
||||
EXCLUDE_FROM_ALL 1
|
||||
#URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz"
|
||||
@ -280,7 +277,7 @@ ExternalProject_Add(dep_blosc
|
||||
#URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9
|
||||
GIT_REPOSITORY https://github.com/Blosc/c-blosc.git
|
||||
GIT_TAG e63775855294b50820ef44d1b157f4de1cc38d3e #v1.17.0
|
||||
DEPENDS dep_zlib
|
||||
DEPENDS dep_ZLIB
|
||||
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
|
||||
CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
|
||||
CMAKE_ARGS
|
||||
@ -307,7 +304,7 @@ ExternalProject_Add(dep_openexr
|
||||
EXCLUDE_FROM_ALL 1
|
||||
GIT_REPOSITORY https://github.com/openexr/openexr.git
|
||||
GIT_TAG eae0e337c9f5117e78114fd05f7a415819df413a #v2.4.0
|
||||
DEPENDS dep_zlib
|
||||
DEPENDS dep_ZLIB
|
||||
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
|
||||
CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
|
||||
CMAKE_ARGS
|
||||
|
9
resources/icons/revert_all_.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
|
||||
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
|
||||
<g>
|
||||
<path fill="#ED6B21" d="M59.7,265.7c0,0,89.2-138.9,230.3-213.4C431.1-22.2,605-0.7,719,71.5c114,72.3,152.4,133.2,152.4,133.2l98.2-56.5c0,0,20.3-10.2,20.3,13.5v354.5c0,0,0,31.6-23.7,20.3c-19.9-9.5-235.7-133.3-303.6-172.3c-37.3-16.8-4.5-30.4-4.5-30.4l94.8-54.7c0,0-54.1-68.3-133.2-104.5C535,130.3,455.7,125,358.6,162c-63.3,24.1-137.9,85.9-191.6,177.2L59.7,265.7L59.7,265.7z"/>
|
||||
<path fill="#ED6B21" d="M940.3,734.3c0,0-89.2,138.9-230.3,213.4c-141.1,74.5-315,53.1-429-19.2c-114-72.3-152.4-133.2-152.4-133.2l-98.2,56.4c0,0-20.3,10.2-20.3-13.5V483.6c0,0,0-31.6,23.7-20.3c19.9,9.5,235.7,133.3,303.6,172.3c37.3,16.8,4.5,30.4,4.5,30.4l-94.8,54.7c0,0,54.1,68.3,133.2,104.5c84.7,44.5,164,49.8,261.1,12.8c63.3-24.1,137.9-85.9,191.6-177.2L940.3,734.3L940.3,734.3z"/></g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
@ -4,7 +4,7 @@
|
||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<g id="hex_x5F_plus">
|
||||
<g>
|
||||
<polygon fill="#ED6B21" points="2,8 2,11 8,15 14,11 14,8 "/>
|
||||
<polygon fill="#ED6B21" points="1,8 1,11 8,16 15,11 15,8 " style="stroke:white;stroke-width:1"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 482 B |
@ -4,7 +4,7 @@
|
||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<g id="hex_x5F_plus">
|
||||
<g>
|
||||
<polygon fill="#ED6B21" points="8,1 2,5 2,7 2,8 14,8 14,7 14,5 "/>
|
||||
<polygon fill="#ED6B21" points="8,0 1,5 1,7 1,8 15,8 15,7 15,5" style="stroke:white;stroke-width:1"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 454 B After Width: | Height: | Size: 487 B |
25
resources/icons/white/edit_layers_all.svg
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<g id="edit_x5F_layers_x5F_all">
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" x1="2" y1="2" x2="6" y2="2"/>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" x1="2" y1="6" x2="6" y2="6"/>
|
||||
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" x1="2" y1="10" x2="14" y2="10"/>
|
||||
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" x1="2" y1="14" x2="14" y2="14"/>
|
||||
<path fill="#ED6B21" d="M14.62,4.37c-0.01-0.14,0.06-0.34,0.15-0.44l0.13-0.15c0.09-0.11,0.12-0.3,0.07-0.43l-0.2-0.49
|
||||
c-0.05-0.13-0.21-0.24-0.35-0.25l-0.2-0.01c-0.14-0.01-0.33-0.1-0.42-0.21c-0.09-0.1-0.37-0.46-0.38-0.6l-0.01-0.2
|
||||
c-0.01-0.14-0.12-0.3-0.25-0.35l-0.49-0.2C12.52,0.97,12.33,1,12.22,1.1l-0.15,0.13c-0.11,0.09-0.31,0.16-0.44,0.15
|
||||
c-0.14-0.01-0.59-0.06-0.69-0.15L10.78,1.1c-0.11-0.09-0.3-0.12-0.43-0.07l-0.49,0.2C9.73,1.28,9.61,1.44,9.6,1.58l-0.01,0.2
|
||||
C9.58,1.92,9.49,2.11,9.38,2.2c-0.1,0.09-0.46,0.37-0.6,0.38L8.58,2.6c-0.14,0.01-0.3,0.12-0.35,0.25l-0.2,0.49
|
||||
C7.97,3.48,8,3.67,8.1,3.78l0.13,0.15c0.09,0.11,0.16,0.31,0.15,0.44C8.37,4.52,8.32,4.96,8.23,5.07L8.1,5.22
|
||||
C8,5.33,7.97,5.52,8.03,5.65l0.2,0.49C8.28,6.27,8.44,6.39,8.58,6.4l0.2,0.01c0.14,0.01,0.33,0.1,0.42,0.21
|
||||
c0.09,0.1,0.37,0.46,0.38,0.6l0.01,0.2c0.01,0.14,0.12,0.3,0.25,0.35l0.49,0.2C10.48,8.03,10.67,8,10.78,7.9l0.15-0.13
|
||||
c0.11-0.09,0.31-0.16,0.44-0.15c0.14,0.01,0.59,0.06,0.69,0.15l0.15,0.13c0.11,0.09,0.3,0.12,0.43,0.07l0.49-0.2
|
||||
c0.13-0.05,0.24-0.21,0.25-0.35l0.01-0.2c0.01-0.14,0.1-0.33,0.21-0.42s0.46-0.37,0.6-0.38l0.2-0.01c0.14-0.01,0.3-0.12,0.35-0.25
|
||||
l0.2-0.49C15.03,5.52,15,5.33,14.9,5.22l-0.13-0.15C14.68,4.96,14.63,4.51,14.62,4.37z M11.5,6.6c-1.16,0-2.1-0.94-2.1-2.1
|
||||
s0.94-2.1,2.1-2.1s2.1,0.94,2.1,2.1S12.66,6.6,11.5,6.6z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
14
resources/icons/white/edit_layers_some.svg
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<g id="edit_x5F_layers_x5F_some_1_">
|
||||
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" x1="2" y1="11" x2="14" y2="11"/>
|
||||
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" x1="2" y1="14" x2="14" y2="14"/>
|
||||
<path fill="#ED6B21" d="M7.68,8.87c0.18,0.18,0.47,0.18,0.64,0L11.19,6c0.18-0.18,0.12-0.32-0.13-0.32H9.62
|
||||
c-0.25,0-0.45-0.2-0.45-0.45V1.45C9.17,1.2,8.97,1,8.71,1H7.29C7.03,1,6.83,1.2,6.83,1.45v3.77c0,0.25-0.2,0.45-0.45,0.45H4.95
|
||||
C4.7,5.68,4.64,5.82,4.81,6L7.68,8.87z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 931 B |
15
resources/icons/white/funnel.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<g id="extruder_x2B_funnel">
|
||||
<rect x="1" y="1" display="none" fill="#FFFFFF" width="14" height="6"/>
|
||||
<line fill="none" stroke="#ED6B21" stroke-linecap="round" stroke-miterlimit="10" x1="8" y1="9.37" x2="8" y2="15"/>
|
||||
<polygon display="none" fill="#FFFFFF" points="5,7 5,8 8,10 11,8 11,7 "/>
|
||||
<g>
|
||||
<path fill="#FFFFFF" d="M14,2l0,4h-3c-0.55,0-1,0.45-1,1v0.47L8,8.8L6,7.46V7c0-0.55-0.45-1-1-1L2,6l0-4H14 M14,1H2
|
||||
C1.45,1,1,1.45,1,2v4c0,0.55,0.45,1,1,1h3v1l2.45,1.63C7.61,9.74,7.81,9.8,8,9.8c0.19,0,0.39-0.06,0.55-0.17L11,8V7h3
|
||||
c0.55,0,1-0.45,1-1V2C15,1.45,14.55,1,14,1L14,1z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 941 B |
23
resources/icons/white/mirroring_off.svg
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<g id="mirror_x5F_off">
|
||||
<g>
|
||||
<path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
|
||||
M10,3.01l3,0c0.55,0,1,0.45,1,1v8c0,0.55-0.45,1-1,1h-3"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
|
||||
M6,3.01L3,3C2.45,3,2,3.45,2,4v8c0,0.55,0.45,1,1,1h3"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-miterlimit="10" x1="8" y1="1" x2="8" y2="3.5"/>
|
||||
|
||||
<line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-miterlimit="10" stroke-dasharray="3,3" x1="8" y1="6.5" x2="8" y2="11"/>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-miterlimit="10" x1="8" y1="12.5" x2="8" y2="15"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
23
resources/icons/white/mirroring_on.svg
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<g id="mirror_x5F_on">
|
||||
<g>
|
||||
<path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M10,3.01l3,0
|
||||
c0.55,0,1,0.45,1,1v8c0,0.55-0.45,1-1,1h-3"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="none" stroke="#ED6B21" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M6,3.01L3,3
|
||||
C2.45,3,2,3.45,2,4v8c0,0.55,0.45,1,1,1h3"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-miterlimit="10" x1="8" y1="1" x2="8" y2="3.5"/>
|
||||
|
||||
<line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-miterlimit="10" stroke-dasharray="3,3" x1="8" y1="6.5" x2="8" y2="11"/>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-miterlimit="10" x1="8" y1="12.5" x2="8" y2="15"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
25
resources/icons/white/note.svg
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<g id="notes">
|
||||
<g>
|
||||
<path fill="#FFFFFF" d="M11,2l0,12l-9,0L2,2H11 M11,1H2C1.45,1,1,1.45,1,2V14c0,0.55,0.45,1,1,1H11c0.55,0,1-0.45,1-1V2
|
||||
C12,1.45,11.55,1,11,1L11,1z"/>
|
||||
</g>
|
||||
<path fill="#ED6B21" d="M14,3L14,3c-0.55,0-1,0.45-1,1v10c0,0.55,0.45,1,1,1h0c0.55,0,1-0.45,1-1V4C15,3.45,14.55,3,14,3z"/>
|
||||
<polygon fill="#ED6B21" points="15,4 13,4 14,1 "/>
|
||||
<g>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-miterlimit="10" x1="3" y1="4" x2="10" y2="4"/>
|
||||
</g>
|
||||
<g>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-miterlimit="10" x1="3" y1="6" x2="10" y2="6"/>
|
||||
</g>
|
||||
<g>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-miterlimit="10" x1="3" y1="8" x2="10" y2="8"/>
|
||||
</g>
|
||||
<g>
|
||||
<line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-miterlimit="10" x1="3" y1="10" x2="7" y2="10"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
13
resources/icons/white/redo_menu.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.6, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<path id="undo_1_" fill="#FFFFFF" d="M1.95,7.01h10.24L8.86,2.51c-0.31-0.42-0.22-1.01,0.2-1.32c0.42-0.31,1.01-0.22,1.32,0.2
|
||||
l4.44,6.01c0,0.01,0.01,0.01,0.01,0.02c0.01,0.01,0.02,0.03,0.03,0.04c0.01,0.02,0.03,0.05,0.04,0.07c0.01,0.02,0.02,0.03,0.03,0.05
|
||||
c0.01,0.01,0.01,0.03,0.02,0.04c0.01,0.02,0.02,0.05,0.02,0.07c0.01,0.02,0.01,0.04,0.02,0.06c0,0.01,0,0.03,0.01,0.04
|
||||
c0,0.02,0.01,0.05,0.01,0.07c0,0.02,0.01,0.05,0.01,0.07c0,0.01,0,0.01,0,0.02c0,0.01,0,0.01,0,0.02c0,0.02,0,0.05-0.01,0.07
|
||||
c0,0.02,0,0.05-0.01,0.07c0,0.01,0,0.03-0.01,0.04c0,0.02-0.01,0.04-0.02,0.06c-0.01,0.02-0.01,0.05-0.02,0.07
|
||||
c-0.01,0.01-0.01,0.03-0.02,0.04c-0.01,0.02-0.02,0.04-0.03,0.05c-0.01,0.02-0.02,0.04-0.04,0.07c-0.01,0.01-0.02,0.03-0.03,0.04
|
||||
c0,0.01-0.01,0.01-0.01,0.02l-4.54,6.05c-0.19,0.25-0.47,0.38-0.76,0.38c-0.2,0-0.4-0.06-0.57-0.19c-0.42-0.31-0.5-0.91-0.19-1.32
|
||||
l3.41-4.54H1.95C1.42,8.91,1,8.48,1,7.96C1,7.44,1.42,7.01,1.95,7.01z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
13
resources/icons/white/undo_menu.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.6, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<path id="undo_1_" fill="#FFFFFF" d="M14.05,7.01H3.82l3.32-4.51c0.31-0.42,0.22-1.01-0.2-1.32c-0.42-0.31-1.01-0.22-1.32,0.2
|
||||
L1.18,7.4c0,0.01-0.01,0.01-0.01,0.02C1.17,7.43,1.16,7.44,1.15,7.46C1.13,7.48,1.12,7.5,1.11,7.53C1.1,7.54,1.09,7.56,1.08,7.58
|
||||
C1.08,7.59,1.07,7.61,1.06,7.62C1.06,7.65,1.05,7.67,1.04,7.69C1.04,7.71,1.03,7.73,1.02,7.75c0,0.01,0,0.03-0.01,0.04
|
||||
c0,0.02-0.01,0.05-0.01,0.07C1.01,7.89,1,7.92,1,7.94c0,0.01,0,0.01,0,0.02c0,0.01,0,0.01,0,0.02c0,0.02,0,0.05,0.01,0.07
|
||||
c0,0.02,0,0.05,0.01,0.07c0,0.01,0,0.03,0.01,0.04c0,0.02,0.01,0.04,0.02,0.06C1.05,8.26,1.06,8.28,1.07,8.3
|
||||
c0.01,0.01,0.01,0.03,0.02,0.04C1.09,8.36,1.1,8.38,1.11,8.4c0.01,0.02,0.02,0.04,0.04,0.07c0.01,0.01,0.02,0.03,0.03,0.04
|
||||
c0,0.01,0.01,0.01,0.01,0.02l4.54,6.05c0.19,0.25,0.47,0.38,0.76,0.38c0.2,0,0.4-0.06,0.57-0.19c0.42-0.31,0.5-0.91,0.19-1.32
|
||||
L3.84,8.91h10.22c0.52,0,0.95-0.42,0.95-0.95C15,7.44,14.58,7.01,14.05,7.01z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
@ -25,34 +25,6 @@ variants = 0.4; 0.2; 0.6
|
||||
# All presets starting with asterisk, for example *common*, are intermediate and they will
|
||||
# not make it into the user interface.
|
||||
|
||||
[printer:*common*]
|
||||
end_gcode = G1 E-4 F2100.00000\nG91\nG1 Z1 F7200.000\nG90\nG1 X205 Y1\nG1 X200 E4\nG1 F4000\nG1 X190 E2.7 \nG1 F4600\nG1 X110 E2.8\nG1 F5200\nG1 X40 E3 \nG1 E-15.0000 F5000\nG1 E-50.0000 F5400\nG1 E-15.0000 F3000\nG1 E-12.0000 F2000\nG1 F1600\nG1 X0 Y1 E3.0000\nG1 X50 Y1 E-5.0000\nG1 F2000\nG1 X0 Y1 E5.0000\nG1 X50 Y1 E-5.0000\nG1 F2400\nG1 X0 Y1 E5.0000\nG1 X50 Y1 E-5.0000\nG1 F2400\nG1 X0 Y1 E5.0000\nG1 X50 Y1 E-3.0000\nG4 S0\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nG28 X0 ; home X axis\nM84 ; disable motors\n\n
|
||||
extruder_offset = 0x0
|
||||
gcode_flavor = marlin
|
||||
before_layer_gcode = ;BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\n\n
|
||||
layer_gcode = ;AFTER_LAYER_CHANGE\n;[layer_z]
|
||||
host_type = octoprint
|
||||
octoprint_apikey =
|
||||
octoprint_host =
|
||||
pressure_advance = 0
|
||||
retract_before_travel = 1
|
||||
retract_before_wipe = 0%
|
||||
retract_layer_change = 1
|
||||
retract_length = 6
|
||||
retract_length_toolchange = 4
|
||||
retract_lift = 0.6
|
||||
retract_lift_above = 0
|
||||
retract_lift_below = 199
|
||||
retract_restart_extra = 0
|
||||
retract_restart_extra_toolchange = 0
|
||||
retract_speed = 35
|
||||
start_gcode = M115 U3.1.0 ; tell printer latest fw version\nM83 ; extruder relative mode\nM204 S[machine_max_acceleration_extruding] T[machine_max_acceleration_retracting] ; ENDER3 firmware may only supports the old M204 format\nG28 W ; home all\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\nG1 Y-3.0 F1000.0 ; go outside print area\nG92 E0.0\nG1 X150.0 E20 F1000.0 ; intro line\nG92 E0.0
|
||||
use_firmware_retraction = 0
|
||||
use_relative_e_distances = 0
|
||||
use_volumetric_e = 0
|
||||
variable_layer_height = 1
|
||||
wipe = 1
|
||||
z_offset = 0
|
||||
|
||||
|
||||
[printer:*0.4nozzle*]
|
||||
@ -586,4 +558,171 @@ max_fan_speed = 0
|
||||
min_fan_speed = 0
|
||||
bridge_fan_speed = 30
|
||||
top_fan_speed = 0
|
||||
temperature = 238
|
||||
temperature = 245
|
||||
|
||||
[filament:Generic PLA @ENDER3]
|
||||
inherits = *PLA*
|
||||
# alias = Generic PLA
|
||||
filament_vendor = Generic
|
||||
|
||||
[filament:Generic PETG @ENDER3]
|
||||
inherits = *PET*
|
||||
filament_vendor = Generic
|
||||
|
||||
[filament:Generic ABS @ENDER3]
|
||||
inherits = *ABS*
|
||||
# alias = Generic ABS
|
||||
first_layer_bed_temperature = 90
|
||||
bed_temperature = 90
|
||||
filament_vendor = Generic
|
||||
|
||||
[filament:Creality PLA @ENDER3]
|
||||
inherits = *PLA*
|
||||
# alias = Creality PLA
|
||||
filament_vendor = Creality
|
||||
temperature = 205
|
||||
bed_temperature = 40
|
||||
first_layer_temperature = 210
|
||||
first_layer_bed_temperature =40
|
||||
|
||||
[filament:Creality PETG @ENDER3]
|
||||
inherits = *PET*
|
||||
# alias = Creality PETG
|
||||
filament_vendor = Creality
|
||||
temperature = 240
|
||||
bed_temperature = 70
|
||||
first_layer_temperature = 240
|
||||
first_layer_bed_temperature =70
|
||||
max_fan_speed = 40
|
||||
min_fan_speed = 20
|
||||
|
||||
[filament:Creality ABS @ENDER3]
|
||||
inherits = *ABS*
|
||||
# alias = Creality ABS
|
||||
filament_vendor = Creality
|
||||
temperature = 240
|
||||
bed_temperature = 90
|
||||
first_layer_temperature = 240
|
||||
first_layer_bed_temperature =90
|
||||
|
||||
[filament:Prusament PLA @ENDER3]
|
||||
inherits = *PLA*
|
||||
# alias = Prusament PLA
|
||||
filament_vendor = Prusa Polymers
|
||||
temperature = 215
|
||||
bed_temperature = 40
|
||||
first_layer_temperature = 215
|
||||
first_layer_bed_temperature =40
|
||||
filament_cost = 24.99
|
||||
filament_density = 1.24
|
||||
|
||||
[filament:Prusament PETG @ENDER3]
|
||||
inherits = *PET*
|
||||
# alias = Prusament PETG
|
||||
filament_vendor = Prusa Polymers
|
||||
temperature = 245
|
||||
bed_temperature = 70
|
||||
first_layer_temperature = 245
|
||||
first_layer_bed_temperature =70
|
||||
filament_cost = 24.99
|
||||
filament_density = 1.27
|
||||
|
||||
# Common printer preset
|
||||
[printer:*common*]
|
||||
printer_technology = FFF
|
||||
bed_shape = 0x0,200x0,200x200,0x200
|
||||
before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;[layer_z]\n\n
|
||||
between_objects_gcode =
|
||||
deretract_speed = 0
|
||||
extruder_colour = #FFFF00
|
||||
extruder_offset = 0x0
|
||||
gcode_flavor = marlin
|
||||
silent_mode = 0
|
||||
remaining_times = 0
|
||||
machine_max_acceleration_e = 10000
|
||||
machine_max_acceleration_extruding = 2000
|
||||
machine_max_acceleration_retracting = 1500
|
||||
machine_max_acceleration_x = 3000
|
||||
machine_max_acceleration_y = 3000
|
||||
machine_max_acceleration_z = 500
|
||||
machine_max_feedrate_e = 120
|
||||
machine_max_feedrate_x = 500
|
||||
machine_max_feedrate_y = 500
|
||||
machine_max_feedrate_z = 12
|
||||
machine_max_jerk_e = 2.5
|
||||
machine_max_jerk_x = 20
|
||||
machine_max_jerk_y = 20
|
||||
machine_max_jerk_z = 0.4
|
||||
machine_min_extruding_rate = 0
|
||||
machine_min_travel_rate = 0
|
||||
layer_gcode = ;AFTER_LAYER_CHANGE\n;[layer_z]
|
||||
max_layer_height = 0.3
|
||||
min_layer_height = 0.07
|
||||
max_print_height = 200
|
||||
nozzle_diameter = 0.4
|
||||
octoprint_apikey =
|
||||
octoprint_host =
|
||||
printer_notes =
|
||||
printer_settings_id =
|
||||
retract_before_travel = 1
|
||||
retract_before_wipe = 0%
|
||||
retract_layer_change = 1
|
||||
retract_length = 1
|
||||
retract_length_toolchange = 1
|
||||
retract_lift = 0
|
||||
retract_lift_above = 0
|
||||
retract_lift_below = 0
|
||||
retract_restart_extra = 0
|
||||
retract_restart_extra_toolchange = 0
|
||||
retract_speed = 35
|
||||
serial_port =
|
||||
serial_speed = 250000
|
||||
single_extruder_multi_material = 0
|
||||
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\nG1 Z0.15 F240\nG1 X60.0 E9.0 F800.0 ; intro line\nG1 X100.0 E12.5 F800 ; intro line\nG92 E0.0
|
||||
end_gcode = M104 S0 ; 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+30, max_print_height)}{endif} ; Move print head up\nG1 X0 F3000 ; home X axis\nM84 ; disable motors
|
||||
toolchange_gcode =
|
||||
use_firmware_retraction = 0
|
||||
use_relative_e_distances = 1
|
||||
use_volumetric_e = 0
|
||||
variable_layer_height = 1
|
||||
wipe = 1
|
||||
z_offset = 0
|
||||
printer_model =
|
||||
default_print_profile =
|
||||
default_filament_profile =
|
||||
|
||||
[printer:Creality ENDER-3]
|
||||
inherits = *common*
|
||||
printer_model = ENDER3
|
||||
printer_variant = 0.4
|
||||
max_layer_height = 0.25
|
||||
min_layer_height = 0.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_CREALITY\nPRINTER_MODEL_ENDER3
|
||||
bed_shape = 0x0,220x0,220x220,0x220
|
||||
max_print_height = 250
|
||||
machine_max_acceleration_e = 5000
|
||||
machine_max_acceleration_extruding = 500
|
||||
machine_max_acceleration_retracting = 1000
|
||||
machine_max_acceleration_x = 500
|
||||
machine_max_acceleration_y = 500
|
||||
machine_max_acceleration_z = 100
|
||||
machine_max_feedrate_e = 60
|
||||
machine_max_feedrate_x = 500
|
||||
machine_max_feedrate_y = 500
|
||||
machine_max_feedrate_z = 10
|
||||
machine_max_jerk_e = 5
|
||||
machine_max_jerk_x = 8
|
||||
machine_max_jerk_y = 8
|
||||
machine_max_jerk_z = 0.4
|
||||
machine_min_extruding_rate = 0
|
||||
machine_min_travel_rate = 0
|
||||
nozzle_diameter = 0.4
|
||||
retract_before_travel = 2
|
||||
retract_length = 5
|
||||
retract_speed = 60
|
||||
deretract_speed = 40
|
||||
retract_before_wipe = 70%
|
||||
default_print_profile = 0.20mm NORMAL
|
||||
default_filament_profile = Creality PLA
|
||||
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\nG1 Z2 F240\nG1 X2 Y10 F3000\nG1 Z0.28 F240\nG92 E0.0\nG1 Y190 E15.0 F1500.0 ; intro line\nG1 X2.3 F5000\nG1 Y10 E30 F1200.0 ; intro line\nG92 E0.0
|
||||
end_gcode = G1 E-4 F2100.00000\nG91\nG1 Z1 F7200.000\nG90\nG1 X205 Y1\nG1 X200 E4\nG1 F4000\nG1 X190 E2.7 \nG1 F4600\nG1 X110 E2.8\nG1 F5200\nG1 X40 E3 \nG1 E-10.0000 F5000\nG1 E-10.0000 F3000\nG1 E-10.0000 F2000\nG1 F1600\nG1 X0 Y1 E3.0000\nG1 X50 Y1 E-5.0000\nG1 F2000\nG1 X0 Y1 E5.0000\nG1 X50 Y1 E-5.0000\nG1 F2400\nG1 X0 Y1 E5.0000\nG1 X50 Y1 E-5.0000\nG1 F2400\nG1 X0 Y1 E5.0000\nG1 X50 Y1 E-3.0000\nG4 S0\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nG28 X0 ; home X axis\nM84 ; disable motors\n\n
|
@ -111,7 +111,7 @@ compatible_printers =
|
||||
complete_objects = 0
|
||||
default_acceleration = 1000
|
||||
dont_support_bridges = 1
|
||||
elefant_foot_compensation = 0
|
||||
elefant_foot_compensation = 0.2
|
||||
ensure_vertical_shell_thickness = 1
|
||||
top_fill_pattern = rectilinear
|
||||
bottom_fill_pattern = rectilinear
|
||||
@ -234,6 +234,7 @@ extruder_clearance_radius = 35
|
||||
|
||||
# Print parameters common to a 0.25mm diameter nozzle.
|
||||
[print:*0.25nozzle*]
|
||||
elefant_foot_compensation = 0
|
||||
external_perimeter_extrusion_width = 0.25
|
||||
extrusion_width = 0.25
|
||||
first_layer_extrusion_width = 0.3
|
||||
@ -249,6 +250,7 @@ support_material_xy_spacing = 150%
|
||||
output_filename_format = {input_filename_base}_{nozzle_diameter[0]}n_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}.gcode
|
||||
|
||||
[print:*0.25nozzleMK3*]
|
||||
elefant_foot_compensation = 0
|
||||
external_perimeter_extrusion_width = 0.25
|
||||
extrusion_width = 0.25
|
||||
first_layer_extrusion_width = 0.3
|
||||
@ -282,6 +284,7 @@ fill_density = 20%
|
||||
output_filename_format = {input_filename_base}_{nozzle_diameter[0]}n_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}.gcode
|
||||
|
||||
[print:*0.25nozzleMINI*]
|
||||
elefant_foot_compensation = 0
|
||||
external_perimeter_extrusion_width = 0.25
|
||||
extrusion_width = 0.25
|
||||
first_layer_extrusion_width = 0.3
|
||||
@ -1728,7 +1731,7 @@ filament_type = ASA
|
||||
|
||||
[filament:Prusament ASA]
|
||||
inherits = *ABS*
|
||||
filament_vendor = Prusa Research
|
||||
filament_vendor = Prusa Polymers
|
||||
filament_cost = 35.28
|
||||
filament_density = 1.07
|
||||
fan_always_on = 1
|
||||
@ -1776,14 +1779,36 @@ inherits = *ABS*
|
||||
filament_vendor = Generic
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.04
|
||||
filament_notes = "List of materials tested with standard ABS print settings:\n\nEsun ABS\nFil-A-Gehr ABS\nHatchboxABS\nPlasty Mladec ABS"
|
||||
|
||||
[filament:Generic PET]
|
||||
[filament:Esun ABS]
|
||||
inherits = *ABS*
|
||||
filament_vendor = Esun
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.04
|
||||
|
||||
[filament:Hatchbox ABS]
|
||||
inherits = *ABS*
|
||||
filament_vendor = Hatchbox
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.04
|
||||
|
||||
[filament:Plasty Mladec ABS]
|
||||
inherits = *ABS*
|
||||
filament_vendor = Plasty Mladec
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.04
|
||||
|
||||
[filament:Generic PETG]
|
||||
inherits = *PET*
|
||||
filament_vendor = Generic
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
filament_notes = "List of manufacturers tested with standard PET print settings:\n\nE3D Edge\nFillamentum CPE GH100\nPlasty Mladec PETG"
|
||||
|
||||
[filament:Plasty Mladec PETG]
|
||||
inherits = *PET*
|
||||
filament_vendor = Plasty Mladec
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
|
||||
[filament:Generic PLA]
|
||||
inherits = *PLA*
|
||||
@ -1912,7 +1937,7 @@ filament_vendor = Generic
|
||||
[filament:Prusament ASA @MMU2]
|
||||
inherits = *ABS MMU2*
|
||||
# alias = Prusament ASA
|
||||
filament_vendor = Prusa Research
|
||||
filament_vendor = Prusa Polymers
|
||||
filament_cost = 35.28
|
||||
filament_density = 1.07
|
||||
fan_always_on = 1
|
||||
@ -1938,6 +1963,10 @@ inherits = *ABS MMU2*
|
||||
# alias = Prusa ABS
|
||||
filament_vendor = Made for Prusa
|
||||
|
||||
[filament:Plasty Mladec ABS @MMU2]
|
||||
inherits = *ABS MMU2*
|
||||
filament_vendor = Plasty Mladec
|
||||
|
||||
[filament:Prusa HIPS]
|
||||
inherits = *ABS*
|
||||
filament_vendor = Made for Prusa
|
||||
@ -1957,17 +1986,17 @@ min_fan_speed = 20
|
||||
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/}0{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}0{else}10{endif}; Filament gcode"
|
||||
temperature = 220
|
||||
|
||||
[filament:Prusa PET]
|
||||
[filament:Prusa PETG]
|
||||
inherits = *PET*
|
||||
filament_vendor = Made for Prusa
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
filament_notes = "List of manufacturers tested with standard PET print settings:\n\nE3D Edge\nPlasty Mladec PETG"
|
||||
filament_notes = "List of manufacturers tested with standard PETG print settings:\n\nE3D Edge\nPlasty Mladec PETG"
|
||||
compatible_printers_condition = nozzle_diameter[0]!=0.6 and printer_model!="MK2SMM" and printer_model!="MINI" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
|
||||
|
||||
[filament:Prusament PETG]
|
||||
inherits = *PET*
|
||||
filament_vendor = Prusa Research
|
||||
filament_vendor = Prusa Polymers
|
||||
first_layer_temperature = 240
|
||||
temperature = 250
|
||||
filament_cost = 24.99
|
||||
@ -1975,18 +2004,26 @@ filament_density = 1.27
|
||||
filament_type = PETG
|
||||
compatible_printers_condition = nozzle_diameter[0]!=0.6 and printer_model!="MK2SMM" and printer_model!="MINI" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)
|
||||
|
||||
[filament:Prusa PET @0.6 nozzle]
|
||||
[filament:Prusa PETG @0.6 nozzle]
|
||||
inherits = *PET06*
|
||||
# alias = Prusa PET
|
||||
# alias = Prusa PETG
|
||||
filament_vendor = Made for Prusa
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
filament_notes = "List of manufacturers tested with standard PET print settings:\n\nE3D Edge\nPlasty Mladec PETG"
|
||||
filament_notes = "List of manufacturers tested with standard PETG print settings:\n\nE3D Edge\nPlasty Mladec PETG"
|
||||
|
||||
[filament:Prusament PETG @0.6 nozzle]
|
||||
inherits = *PET06*
|
||||
# alias = Prusament PETG
|
||||
filament_vendor = Prusa Research
|
||||
filament_vendor = Prusa Polymers
|
||||
first_layer_temperature = 240
|
||||
temperature = 250
|
||||
filament_cost = 24.99
|
||||
filament_density = 1.27
|
||||
filament_type = PETG
|
||||
|
||||
[filament:Plasty Mladec PETG @0.6 nozzle]
|
||||
inherits = *PET06*
|
||||
filament_vendor = Plasty Mladec
|
||||
first_layer_temperature = 240
|
||||
temperature = 250
|
||||
filament_cost = 24.99
|
||||
@ -1994,7 +2031,7 @@ filament_density = 1.27
|
||||
filament_type = PETG
|
||||
|
||||
[filament:*PET MMU2*]
|
||||
inherits = Prusa PET
|
||||
inherits = Prusa PETG
|
||||
compatible_printers_condition = nozzle_diameter[0]!=0.6 and printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material
|
||||
temperature = 230
|
||||
first_layer_temperature = 230
|
||||
@ -2017,48 +2054,105 @@ inherits = *PET MMU2*
|
||||
compatible_printers_condition = nozzle_diameter[0]==0.6 and printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material
|
||||
filament_max_volumetric_speed = 13
|
||||
|
||||
[filament:Generic PET @MMU2]
|
||||
[filament:Generic PETG @MMU2]
|
||||
inherits = *PET MMU2*
|
||||
# alias = Generic PET
|
||||
# alias = Generic PETG
|
||||
filament_vendor = Generic
|
||||
|
||||
[filament:Prusa PET @MMU2]
|
||||
[filament:Plasty Mladec PETG @MMU2]
|
||||
inherits = *PET MMU2*
|
||||
# alias = Prusa PET
|
||||
filament_vendor = Plasty Mladec
|
||||
|
||||
[filament:Prusa PETG @MMU2]
|
||||
inherits = *PET MMU2*
|
||||
# alias = Prusa PETG
|
||||
filament_vendor = Made for Prusa
|
||||
|
||||
[filament:Prusament PETG @MMU2]
|
||||
inherits = *PET MMU2*
|
||||
filament_type = PETG
|
||||
# alias = Prusament PETG
|
||||
filament_vendor = Prusa Research
|
||||
filament_vendor = Prusa Polymers
|
||||
|
||||
[filament:Generic PET @MMU2 0.6 nozzle]
|
||||
[filament:Generic PETG @MMU2 0.6 nozzle]
|
||||
inherits = *PET MMU2 06*
|
||||
# alias = Generic PET
|
||||
# alias = Generic PETG
|
||||
filament_vendor = Generic
|
||||
|
||||
[filament:Prusa PET @MMU2 0.6 nozzle]
|
||||
[filament:Prusa PETG @MMU2 0.6 nozzle]
|
||||
inherits = *PET MMU2 06*
|
||||
# alias = Prusa PET
|
||||
# alias = Prusa PETG
|
||||
filament_vendor = Made for Prusa
|
||||
|
||||
[filament:Prusament PETG @MMU2 0.6 nozzle]
|
||||
inherits = *PET MMU2 06*
|
||||
filament_type = PETG
|
||||
# alias = Prusament PETG
|
||||
filament_vendor = Prusa Research
|
||||
filament_vendor = Prusa Polymers
|
||||
|
||||
[filament:Plasty Mladec PETG @MMU2 0.6 nozzle]
|
||||
inherits = *PET MMU2 06*
|
||||
filament_type = PETG
|
||||
# alias = Prusament PETG
|
||||
filament_vendor = Plasty Mladec
|
||||
|
||||
[filament:Prusa PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = Made for Prusa
|
||||
filament_cost = 25.4
|
||||
filament_density = 1.24
|
||||
filament_notes = "List of materials tested with standard PLA print settings:\n\nDas Filament\nEsun PLA\nEUMAKERS PLA\nFiberlogy HD-PLA\nFiberlogy PLA\nFloreon3D\nHatchbox PLA\nPlasty Mladec PLA\nPrimavalue PLA\nProto pasta Matte Fiber\nAmazonBasics PLA"
|
||||
|
||||
[filament:Fiberlogy PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = Fiberlogy
|
||||
filament_cost = 25.4
|
||||
filament_density = 1.24
|
||||
|
||||
[filament:Plasty Mladec PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = Plasty Mladec
|
||||
filament_cost = 25.4
|
||||
filament_density = 1.24
|
||||
|
||||
[filament:AmazonBasics PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = AmazonBasics
|
||||
filament_cost = 25.4
|
||||
filament_density = 1.24
|
||||
|
||||
[filament:Hatchbox PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = Hatchbox
|
||||
filament_cost = 25.4
|
||||
filament_density = 1.24
|
||||
|
||||
[filament:Esun PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = Esun
|
||||
filament_cost = 25.4
|
||||
filament_density = 1.24
|
||||
|
||||
[filament:Das Filament PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = Das Filament
|
||||
filament_cost = 25.4
|
||||
filament_density = 1.24
|
||||
|
||||
[filament:EUMAKERS PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = EUMAKERS
|
||||
filament_cost = 25.4
|
||||
filament_density = 1.24
|
||||
|
||||
[filament:Floreon3D PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = Floreon3D
|
||||
filament_cost = 25.4
|
||||
filament_density = 1.24
|
||||
|
||||
[filament:Prusament PLA]
|
||||
inherits = *PLA*
|
||||
filament_vendor = Prusa Research
|
||||
filament_vendor = Prusa Polymers
|
||||
temperature = 215
|
||||
filament_cost = 24.99
|
||||
filament_density = 1.24
|
||||
@ -2090,7 +2184,7 @@ filament_vendor = Made for Prusa
|
||||
|
||||
[filament:Prusament PLA @MMU2]
|
||||
inherits = *PLA MMU2*
|
||||
filament_vendor = Prusa Research
|
||||
filament_vendor = Prusa Polymers
|
||||
|
||||
[filament:SemiFlex or Flexfill 98A]
|
||||
inherits = *FLEX*
|
||||
@ -2313,7 +2407,7 @@ filament_vendor = E3D
|
||||
filament_cost = 56.9
|
||||
filament_density = 1.26
|
||||
filament_type = EDGE
|
||||
filament_notes = "List of manufacturers tested with standard PET print settings:\n\nE3D Edge\nFillamentum CPE GH100\nPlasty Mladec PETG"
|
||||
filament_notes = "List of manufacturers tested with standard PETG print settings:\n\nE3D Edge\nFillamentum CPE GH100\nPlasty Mladec PETG"
|
||||
|
||||
[filament:Fillamentum CPE @MMU1]
|
||||
inherits = *PETMMU1*
|
||||
@ -2328,26 +2422,32 @@ max_fan_speed = 50
|
||||
min_fan_speed = 50
|
||||
temperature = 275
|
||||
|
||||
[filament:Generic PET @MMU1]
|
||||
[filament:Generic PETG @MMU1]
|
||||
inherits = *PETMMU1*
|
||||
# alias = Generic PET
|
||||
# alias = Generic PETG
|
||||
filament_vendor = Generic
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
filament_notes = "List of manufacturers tested with standard PET print settings:\n\nE3D Edge\nFillamentum CPE GH100\nPlasty Mladec PETG"
|
||||
|
||||
[filament:Prusa PET @MMU1]
|
||||
[filament:Plasty Mladec PETG @MMU1]
|
||||
inherits = *PETMMU1*
|
||||
# alias = Prusa PET
|
||||
# alias = Generic PETG
|
||||
filament_vendor = Plasty Mladec
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
|
||||
[filament:Prusa PETG @MMU1]
|
||||
inherits = *PETMMU1*
|
||||
# alias = Prusa PETG
|
||||
filament_vendor = Made for Prusa
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
filament_notes = "List of manufacturers tested with standard PET print settings:\n\nE3D Edge\nPlasty Mladec PETG"
|
||||
filament_notes = "List of manufacturers tested with standard PETG print settings:\n\nE3D Edge\nPlasty Mladec PETG"
|
||||
|
||||
[filament:Prusament PETG @MMU1]
|
||||
inherits = *PETMMU1*
|
||||
# alias = Prusament PETG
|
||||
filament_vendor = Prusa Research
|
||||
filament_vendor = Prusa Polymers
|
||||
first_layer_temperature = 240
|
||||
temperature = 250
|
||||
filament_cost = 24.99
|
||||
@ -2394,21 +2494,49 @@ compatible_printers_condition = printer_model=="MK2SMM"
|
||||
|
||||
## Filaments MINI
|
||||
|
||||
[filament:Generic PET @MINI]
|
||||
inherits = Generic PET; *PETMINI*
|
||||
# alias = Generic PET
|
||||
[filament:Generic PETG @MINI]
|
||||
inherits = Generic PETG; *PETMINI*
|
||||
filament_vendor = Generic
|
||||
# alias = Generic PETG
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
compatible_printers_condition = printer_model=="MINI" and nozzle_diameter[0]!=0.6
|
||||
|
||||
[filament:Plasty Mladec PETG @MINI]
|
||||
inherits = Generic PETG; *PETMINI*
|
||||
filament_vendor = Plasty Mladec
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
compatible_printers_condition = printer_model=="MINI" and nozzle_diameter[0]!=0.6
|
||||
|
||||
[filament:Generic ABS @MINI]
|
||||
inherits = Generic ABS; *ABSMINI*
|
||||
filament_vendor = Generic
|
||||
# alias = Generic ABS
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.08
|
||||
|
||||
[filament:Esun ABS @MINI]
|
||||
inherits = Generic ABS; *ABSMINI*
|
||||
filament_vendor = Esun
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.08
|
||||
|
||||
[filament:Hatchbox ABS @MINI]
|
||||
inherits = Generic ABS; *ABSMINI*
|
||||
filament_vendor = Hatchbox
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.08
|
||||
|
||||
[filament:Plasty Mladec ABS @MINI]
|
||||
inherits = Generic ABS; *ABSMINI*
|
||||
filament_vendor = Plasty Mladec
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.08
|
||||
|
||||
[filament:Prusament PETG @MINI]
|
||||
inherits = Prusament PETG; *PETMINI*
|
||||
filament_vendor = Prusa Polymers
|
||||
# alias = Prusament PETG
|
||||
first_layer_temperature = 240
|
||||
temperature = 250
|
||||
@ -2424,9 +2552,14 @@ temperature = 250
|
||||
filament_density = 1.27
|
||||
filament_cost = 24.99
|
||||
|
||||
[filament:Generic PET @0.6 nozzle MINI]
|
||||
inherits = Generic PET; *PETMINI06*
|
||||
# alias = Generic PET
|
||||
[filament:Generic PETG @0.6 nozzle MINI]
|
||||
inherits = Generic PETG; *PETMINI06*
|
||||
# alias = Generic PETG
|
||||
|
||||
[filament:Plasty Mladec PETG @0.6 nozzle MINI]
|
||||
inherits = Generic PETG; *PETMINI06*
|
||||
filament_vendor = Plasty Mladec
|
||||
# alias = Generic PETG
|
||||
|
||||
[filament:Prusament ASA @MINI]
|
||||
inherits = Prusament ASA; *ABSMINI*
|
||||
@ -2697,17 +2830,17 @@ filament_cost = 56.9
|
||||
filament_density = 1.26
|
||||
filament_type = EDGE
|
||||
|
||||
[filament:Prusa PET @MINI]
|
||||
[filament:Prusa PETG @MINI]
|
||||
inherits = *PETMINI*
|
||||
# alias = Prusa PET
|
||||
# alias = Prusa PETG
|
||||
filament_vendor = Made for Prusa
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
compatible_printers_condition = printer_model=="MINI" and nozzle_diameter[0]!=0.6
|
||||
|
||||
[filament:Prusa PET @0.6 nozzle MINI]
|
||||
[filament:Prusa PETG @0.6 nozzle MINI]
|
||||
inherits = *PETMINI06*
|
||||
# alias = Prusa PET
|
||||
# alias = Prusa PETG
|
||||
filament_vendor = Made for Prusa
|
||||
filament_cost = 27.82
|
||||
filament_density = 1.27
|
||||
@ -2876,21 +3009,21 @@ inherits = *common 0.025*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Grey Tough @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 7
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Azure Blue Tough @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 7
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
|
||||
[sla_material:Prusa Maroon Tough @0.025]
|
||||
@ -2898,56 +3031,56 @@ inherits = *common 0.025*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Beige Tough @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Pink Tough @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 7
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa White Tough @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 6.5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Transparent Tough @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 15
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Green Dental Casting @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 12
|
||||
initial_exposure_time = 40
|
||||
material_type = Casting
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Transparent Green Tough @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Clear ABS like @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 30
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
## [sla_material:Prusa ABS like White @0.025]
|
||||
## inherits = *common 0.025*
|
||||
@ -2959,35 +3092,35 @@ inherits = *common 0.025*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 30
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Super Low Odor Cyan Tough @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Super Low Odor Magenta Tough @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Super Low Odor Yellow Tough @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Orange-Yellow Teeth Model @0.025]
|
||||
inherits = *common 0.025*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 30
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
|
||||
########### Materials 0.05
|
||||
@ -3216,91 +3349,91 @@ inherits = *common 0.05*
|
||||
exposure_time = 7
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Orange Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 7.5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Grey Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 8.5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Black Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
## [sla_material:Prusa Super Low Odor Beige Tough @0.05]
|
||||
## inherits = *common 0.05*
|
||||
## exposure_time = 7.5
|
||||
## initial_exposure_time = 35
|
||||
## material_type = Tough
|
||||
## material_vendor = Prusa
|
||||
## material_vendor = Made for Prusa
|
||||
|
||||
## [sla_material:Prusa Super Low Odor White Tough @0.05]
|
||||
## inherits = *common 0.05*
|
||||
## exposure_time = 6.5
|
||||
## initial_exposure_time = 35
|
||||
## material_type = Tough
|
||||
## material_vendor = Prusa
|
||||
## material_vendor = Made for Prusa
|
||||
|
||||
## [sla_material:Prusa Super Low Odor Grey Tough @0.05]
|
||||
## inherits = *common 0.05*
|
||||
## exposure_time = 6.5
|
||||
## initial_exposure_time = 35
|
||||
## material_type = Tough
|
||||
## material_vendor = Prusa
|
||||
## material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Super Low Odor Cyan Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Super Low Odor Magenta Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Super Low Odor Yellow Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
## [sla_material:Prusa Black High Tenacity @0.05]
|
||||
## inherits = *common 0.05*
|
||||
## exposure_time = 7
|
||||
## initial_exposure_time = 35
|
||||
## material_type = Tough
|
||||
## material_vendor = Prusa
|
||||
## material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Orange-Yellow Teeth Model @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 7
|
||||
initial_exposure_time = 30
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Green Dental Casting @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 50
|
||||
material_type = Casting
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
## [sla_material:Prusa Yellow Solid @0.05]
|
||||
## inherits = *common 0.05*
|
||||
@ -3312,49 +3445,49 @@ inherits = *common 0.05*
|
||||
exposure_time = 7.5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Transparent Green Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Transparent Red Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Maroon Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 7.5
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Pink Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 8
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Azure Blue Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 8
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Transparent Tough @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 7
|
||||
initial_exposure_time = 15
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
## [sla_material:Prusa Yellow Flexible @0.05]
|
||||
## inherits = *common 0.05*
|
||||
@ -3366,7 +3499,7 @@ inherits = *common 0.05*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 15
|
||||
material_type = Flexible
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
## [sla_material:Prusa White Flexible @0.05]
|
||||
## inherits = *common 0.05*
|
||||
@ -3378,7 +3511,7 @@ inherits = *common 0.05*
|
||||
exposure_time = 5
|
||||
initial_exposure_time = 15
|
||||
material_type = Flexible
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
## [sla_material:Prusa Black Flexible @0.05]
|
||||
## inherits = *common 0.05*
|
||||
@ -3395,7 +3528,7 @@ inherits = *common 0.05*
|
||||
exposure_time = 8
|
||||
initial_exposure_time = 30
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
## [sla_material:Prusa ABS like White @0.05]
|
||||
## inherits = *common 0.05*
|
||||
@ -3407,14 +3540,14 @@ inherits = *common 0.05*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 45
|
||||
material_type = Casting
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Grey High Tenacity @0.05]
|
||||
inherits = *common 0.05*
|
||||
exposure_time = 7
|
||||
initial_exposure_time = 30
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
########### Materials 0.035
|
||||
|
||||
@ -3423,7 +3556,7 @@ inherits = *common 0.035*
|
||||
exposure_time = 6
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
########### Materials 0.1
|
||||
|
||||
@ -3448,70 +3581,70 @@ inherits = *common 0.1*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 45
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Beige Tough @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 45
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Pink Tough @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 45
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Azure Blue Tough @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 45
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Maroon Tough @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 45
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa White Tough @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 45
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Black Tough @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 13
|
||||
initial_exposure_time = 55
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Transparent Tough @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 8
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Green Dental Casting @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 15
|
||||
initial_exposure_time = 50
|
||||
material_type = Casting
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[sla_material:Prusa Transparent Green Tough @0.1]
|
||||
inherits = *common 0.1*
|
||||
exposure_time = 7
|
||||
initial_exposure_time = 35
|
||||
material_type = Tough
|
||||
material_vendor = Prusa
|
||||
material_vendor = Made for Prusa
|
||||
|
||||
[printer:*common*]
|
||||
printer_technology = FFF
|
||||
|
@ -1,2 +1,3 @@
|
||||
add_subdirectory(slasupporttree)
|
||||
add_subdirectory(openvdb)
|
||||
#add_subdirectory(slasupporttree)
|
||||
#add_subdirectory(openvdb)
|
||||
add_subdirectory(meshboolean)
|
||||
|
13
sandboxes/meshboolean/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
||||
if (SLIC3R_STATIC)
|
||||
set(CGAL_Boost_USE_STATIC_LIBS ON)
|
||||
endif ()
|
||||
|
||||
find_package(CGAL REQUIRED)
|
||||
|
||||
add_executable(meshboolean MeshBoolean.cpp)
|
||||
|
||||
target_link_libraries(meshboolean libslic3r CGAL::CGAL)
|
||||
|
||||
if (WIN32)
|
||||
prusaslicer_copy_dlls(meshboolean)
|
||||
endif()
|
85
sandboxes/meshboolean/MeshBoolean.cpp
Normal file
@ -0,0 +1,85 @@
|
||||
#include <libslic3r/TriangleMesh.hpp>
|
||||
#undef PI
|
||||
#include <igl/readOFF.h>
|
||||
//#undef IGL_STATIC_LIBRARY
|
||||
#include <igl/copyleft/cgal/mesh_boolean.h>
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <iostream>
|
||||
|
||||
#include <admesh/stl.h>
|
||||
|
||||
#include <boost/nowide/cstdio.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
bool its_write_obj(const Eigen::MatrixXd &V, Eigen::MatrixXi &F, const char *file)
|
||||
{
|
||||
|
||||
FILE *fp = boost::nowide::fopen(file, "w");
|
||||
if (fp == nullptr) {
|
||||
BOOST_LOG_TRIVIAL(error) << "stl_write_obj: Couldn't open " << file << " for writing";
|
||||
return false;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < V.rows(); ++ i)
|
||||
fprintf(fp, "v %lf %lf %lf\n", V(i, 0), V(i, 1), V(i, 2));
|
||||
for (size_t i = 0; i < F.rows(); ++ i)
|
||||
fprintf(fp, "f %d %d %d\n", F(i, 0) + 1, F(i, 1) + 1, F(i, 2) + 1);
|
||||
fclose(fp);
|
||||
return true;
|
||||
}
|
||||
|
||||
void mesh_boolean_test(const std::string &fname)
|
||||
{
|
||||
using namespace Eigen;
|
||||
using namespace std;
|
||||
// igl::readOFF(TUTORIAL_SHARED_PATH "/cheburashka.off",VA,FA);
|
||||
// igl::readOFF(TUTORIAL_SHARED_PATH "/decimated-knight.off",VB,FB);
|
||||
// Plot the mesh with pseudocolors
|
||||
// igl::opengl::glfw::Viewer viewer;
|
||||
|
||||
// Initialize
|
||||
// update(viewer);
|
||||
|
||||
//igl::copyleft::cgal::mesh_boolean(VA,FA,VB,FB,boolean_type,VC,FC,J);
|
||||
|
||||
|
||||
std::cout << fname.c_str() << std::endl;
|
||||
TriangleMesh mesh;
|
||||
|
||||
mesh.ReadSTLFile(fname.c_str());
|
||||
mesh.repair(true);
|
||||
its_write_obj(mesh.its, (fname + "-imported0.obj").c_str());
|
||||
|
||||
|
||||
Eigen::MatrixXd VA,VB,VC;
|
||||
Eigen::VectorXi J,I;
|
||||
Eigen::MatrixXi FA,FB,FC;
|
||||
igl::MeshBooleanType boolean_type(igl::MESH_BOOLEAN_TYPE_UNION);
|
||||
|
||||
|
||||
typedef Eigen::Map<const Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor | Eigen::DontAlign>> MapMatrixXfUnaligned;
|
||||
typedef Eigen::Map<const Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor | Eigen::DontAlign>> MapMatrixXiUnaligned;
|
||||
|
||||
Eigen::MatrixXd V = MapMatrixXfUnaligned(mesh.its.vertices.front().data(), mesh.its.vertices.size(), 3).cast<double>();
|
||||
Eigen::MatrixXi F = MapMatrixXiUnaligned(mesh.its.indices.front().data(), mesh.its.indices.size(), 3);
|
||||
|
||||
its_write_obj(V, F, (fname + "-imported.obj").c_str());
|
||||
// Self-union to clean up
|
||||
igl::copyleft::cgal::mesh_boolean(V, F, Eigen::MatrixXd(), Eigen::MatrixXi(), boolean_type, VC, FC);
|
||||
|
||||
its_write_obj(VC, FC, (fname + "-fixed.obj").c_str());
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
||||
int main(const int argc, const char * argv[])
|
||||
{
|
||||
if (argc < 1) return -1;
|
||||
|
||||
Slic3r::mesh_boolean_test(argv[1]);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(Slic3r-native)
|
||||
|
||||
add_subdirectory(build-utils)
|
||||
@ -143,18 +144,18 @@ if (SLIC3R_GUI)
|
||||
|
||||
if (MSVC)
|
||||
# Generate debug symbols even in release mode.
|
||||
#target_link_options(slic3r PUBLIC "$<$<CONFIG:RELEASE>:/DEBUG>")
|
||||
target_link_libraries(slic3r user32.lib Setupapi.lib OpenGL32.Lib GlU32.Lib)
|
||||
target_link_libraries(slic3r_lib user32.lib Setupapi.lib OpenGL32.Lib GlU32.Lib)
|
||||
target_link_options(slic3r PUBLIC "$<$<CONFIG:RELEASE>:/DEBUG>")
|
||||
target_link_libraries(slic3r user32.lib Setupapi.lib)
|
||||
target_link_libraries(slic3r_lib user32.lib Setupapi.lib)
|
||||
elseif (MINGW)
|
||||
target_link_libraries(slic3r opengl32 ws2_32 uxtheme setupapi)
|
||||
target_link_libraries(slic3r ws2_32 uxtheme setupapi)
|
||||
target_link_libraries(slic3r_lib -lopengl32)
|
||||
elseif (APPLE)
|
||||
target_link_libraries(slic3r "-framework OpenGL")
|
||||
target_link_libraries(slic3r_lib "-framework OpenGL")
|
||||
else ()
|
||||
target_link_libraries(slic3r -ldl -lGL -lGLU)
|
||||
target_link_libraries(slic3r_lib -ldl -lGL -lGLU)
|
||||
target_link_libraries(slic3r -ldl)
|
||||
target_link_libraries(slic3r_lib -ldl)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
@ -210,6 +211,11 @@ if (WIN32)
|
||||
VERBATIM
|
||||
)
|
||||
endif ()
|
||||
|
||||
# This has to be a separate target due to the windows command line lenght limits
|
||||
add_custom_target(slic3rDllsCopy ALL DEPENDS slic3r)
|
||||
prusaslicer_copy_dlls(slic3rDllsCopy)
|
||||
|
||||
elseif (XCODE)
|
||||
# Because of Debug/Release/etc. configurations (similar to MSVC) the slic3r binary is located in an extra level
|
||||
add_custom_command(TARGET slic3r POST_BUILD
|
||||
|
@ -601,11 +601,12 @@ void stl_remove_unconnected_facets(stl_file *stl)
|
||||
stl->neighbors_start[facet].which_vertex_not[edge[1]],
|
||||
stl->neighbors_start[facet].which_vertex_not[edge[2]]
|
||||
};
|
||||
|
||||
// Update statistics on edge connectivity.
|
||||
if (neighbor[0] == -1)
|
||||
stl_update_connects_remove_1(neighbor[1]);
|
||||
if (neighbor[1] == -1)
|
||||
stl_update_connects_remove_1(neighbor[0]);
|
||||
if ((neighbor[0] == -1) && (neighbor[1] != -1))
|
||||
stl_update_connects_remove_1(neighbor[1]);
|
||||
if ((neighbor[1] == -1) && (neighbor[0] != -1))
|
||||
stl_update_connects_remove_1(neighbor[0]);
|
||||
|
||||
if (neighbor[0] >= 0) {
|
||||
if (neighbor[1] >= 0) {
|
||||
|
@ -1,8 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
add_definitions(-D_BSD_SOURCE -D_DEFAULT_SOURCE) # To enable various useful macros and functions on Unices
|
||||
remove_definitions(-D_UNICODE -DUNICODE)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
@ -15,5 +15,5 @@ add_library(hidapi STATIC ${HIDAPI_IMPL})
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# Don't link the udev library, as there are two versions out there (libudev.so.0, libudev.so.1), so they are linked explicitely.
|
||||
# target_link_libraries(hidapi udev)
|
||||
target_link_libraries(hidapi)
|
||||
target_link_libraries(hidapi dl)
|
||||
endif()
|
||||
|
5
src/hidapi/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
** hidapi is a c++ library for communicating with USB and Bluetooth HID devices on Linux, Mac and Windows.**
|
||||
|
||||
For more information go to https://github.com/libusb/hidapi
|
||||
|
||||
THIS DIRECTORY CONTAINS THE hidapi-0.9.0 7da5cc9 SOURCE DISTRIBUTION.
|
@ -679,133 +679,73 @@ ClipperLib::PolyTree union_pt(ExPolygons &&subject, bool safety_offset_)
|
||||
return _clipper_do<ClipperLib::PolyTree>(ClipperLib::ctUnion, std::move(subject), Polygons(), ClipperLib::pftEvenOdd, safety_offset_);
|
||||
}
|
||||
|
||||
Polygons
|
||||
union_pt_chained(const Polygons &subject, bool safety_offset_)
|
||||
{
|
||||
ClipperLib::PolyTree polytree = union_pt(subject, safety_offset_);
|
||||
|
||||
Polygons retval;
|
||||
traverse_pt(polytree.Childs, &retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static ClipperLib::PolyNodes order_nodes(const ClipperLib::PolyNodes &nodes)
|
||||
// Simple spatial ordering of Polynodes
|
||||
ClipperLib::PolyNodes order_nodes(const ClipperLib::PolyNodes &nodes)
|
||||
{
|
||||
// collect ordering points
|
||||
Points ordering_points;
|
||||
ordering_points.reserve(nodes.size());
|
||||
|
||||
for (const ClipperLib::PolyNode *node : nodes)
|
||||
ordering_points.emplace_back(Point(node->Contour.front().X, node->Contour.front().Y));
|
||||
|
||||
ordering_points.emplace_back(
|
||||
Point(node->Contour.front().X, node->Contour.front().Y));
|
||||
|
||||
// perform the ordering
|
||||
ClipperLib::PolyNodes ordered_nodes = chain_clipper_polynodes(ordering_points, nodes);
|
||||
|
||||
ClipperLib::PolyNodes ordered_nodes =
|
||||
chain_clipper_polynodes(ordering_points, nodes);
|
||||
|
||||
return ordered_nodes;
|
||||
}
|
||||
|
||||
enum class e_ordering {
|
||||
ORDER_POLYNODES,
|
||||
DONT_ORDER_POLYNODES
|
||||
};
|
||||
|
||||
template<e_ordering o>
|
||||
void foreach_node(const ClipperLib::PolyNodes &nodes,
|
||||
std::function<void(const ClipperLib::PolyNode *)> fn);
|
||||
|
||||
template<> void foreach_node<e_ordering::DONT_ORDER_POLYNODES>(
|
||||
const ClipperLib::PolyNodes & nodes,
|
||||
std::function<void(const ClipperLib::PolyNode *)> fn)
|
||||
static void traverse_pt_noholes(const ClipperLib::PolyNodes &nodes, Polygons *out)
|
||||
{
|
||||
for (auto &n : nodes) fn(n);
|
||||
foreach_node<e_ordering::ON>(nodes, [&out](const ClipperLib::PolyNode *node)
|
||||
{
|
||||
traverse_pt_noholes(node->Childs, out);
|
||||
out->emplace_back(ClipperPath_to_Slic3rPolygon(node->Contour));
|
||||
if (node->IsHole()) out->back().reverse(); // ccw
|
||||
});
|
||||
}
|
||||
|
||||
template<> void foreach_node<e_ordering::ORDER_POLYNODES>(
|
||||
const ClipperLib::PolyNodes & nodes,
|
||||
std::function<void(const ClipperLib::PolyNode *)> fn)
|
||||
{
|
||||
auto ordered_nodes = order_nodes(nodes);
|
||||
for (auto &n : ordered_nodes) fn(n);
|
||||
}
|
||||
|
||||
template<e_ordering o>
|
||||
void _traverse_pt(const ClipperLib::PolyNodes &nodes, Polygons *retval)
|
||||
static void traverse_pt_old(ClipperLib::PolyNodes &nodes, Polygons* retval)
|
||||
{
|
||||
/* use a nearest neighbor search to order these children
|
||||
TODO: supply start_near to chained_path() too? */
|
||||
|
||||
// collect ordering points
|
||||
Points ordering_points;
|
||||
ordering_points.reserve(nodes.size());
|
||||
for (ClipperLib::PolyNodes::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
|
||||
Point p((*it)->Contour.front().X, (*it)->Contour.front().Y);
|
||||
ordering_points.push_back(p);
|
||||
}
|
||||
|
||||
// perform the ordering
|
||||
ClipperLib::PolyNodes ordered_nodes = chain_clipper_polynodes(ordering_points, nodes);
|
||||
|
||||
// push results recursively
|
||||
foreach_node<o>(nodes, [&retval](const ClipperLib::PolyNode *node) {
|
||||
for (ClipperLib::PolyNodes::iterator it = ordered_nodes.begin(); it != ordered_nodes.end(); ++it) {
|
||||
// traverse the next depth
|
||||
_traverse_pt<o>(node->Childs, retval);
|
||||
retval->emplace_back(ClipperPath_to_Slic3rPolygon(node->Contour));
|
||||
if (node->IsHole()) retval->back().reverse(); // ccw
|
||||
});
|
||||
traverse_pt_old((*it)->Childs, retval);
|
||||
retval->push_back(ClipperPath_to_Slic3rPolygon((*it)->Contour));
|
||||
if ((*it)->IsHole()) retval->back().reverse(); // ccw
|
||||
}
|
||||
}
|
||||
|
||||
template<e_ordering o>
|
||||
void _traverse_pt(const ClipperLib::PolyNode *tree, ExPolygons *retval)
|
||||
Polygons union_pt_chained(const Polygons &subject, bool safety_offset_)
|
||||
{
|
||||
if (!retval || !tree) return;
|
||||
ClipperLib::PolyTree polytree = union_pt(subject, safety_offset_);
|
||||
|
||||
ExPolygons &retv = *retval;
|
||||
Polygons retval;
|
||||
traverse_pt_old(polytree.Childs, &retval);
|
||||
return retval;
|
||||
|
||||
std::function<void(const ClipperLib::PolyNode*, ExPolygon&)> hole_fn;
|
||||
// TODO: This needs to be tested:
|
||||
// ClipperLib::PolyTree polytree = union_pt(subject, safety_offset_);
|
||||
|
||||
auto contour_fn = [&retv, &hole_fn](const ClipperLib::PolyNode *pptr) {
|
||||
ExPolygon poly;
|
||||
poly.contour.points = ClipperPath_to_Slic3rPolygon(pptr->Contour);
|
||||
auto fn = std::bind(hole_fn, std::placeholders::_1, poly);
|
||||
foreach_node<o>(pptr->Childs, fn);
|
||||
retv.push_back(poly);
|
||||
};
|
||||
|
||||
hole_fn = [&contour_fn](const ClipperLib::PolyNode *pptr, ExPolygon& poly)
|
||||
{
|
||||
poly.holes.emplace_back();
|
||||
poly.holes.back().points = ClipperPath_to_Slic3rPolygon(pptr->Contour);
|
||||
foreach_node<o>(pptr->Childs, contour_fn);
|
||||
};
|
||||
|
||||
contour_fn(tree);
|
||||
}
|
||||
|
||||
template<e_ordering o>
|
||||
void _traverse_pt(const ClipperLib::PolyNodes &nodes, ExPolygons *retval)
|
||||
{
|
||||
// Here is the actual traverse
|
||||
foreach_node<o>(nodes, [&retval](const ClipperLib::PolyNode *node) {
|
||||
_traverse_pt<o>(node, retval);
|
||||
});
|
||||
}
|
||||
|
||||
void traverse_pt(const ClipperLib::PolyNode *tree, ExPolygons *retval)
|
||||
{
|
||||
_traverse_pt<e_ordering::ORDER_POLYNODES>(tree, retval);
|
||||
}
|
||||
|
||||
void traverse_pt_unordered(const ClipperLib::PolyNode *tree, ExPolygons *retval)
|
||||
{
|
||||
_traverse_pt<e_ordering::DONT_ORDER_POLYNODES>(tree, retval);
|
||||
}
|
||||
|
||||
void traverse_pt(const ClipperLib::PolyNodes &nodes, Polygons *retval)
|
||||
{
|
||||
_traverse_pt<e_ordering::ORDER_POLYNODES>(nodes, retval);
|
||||
}
|
||||
|
||||
void traverse_pt(const ClipperLib::PolyNodes &nodes, ExPolygons *retval)
|
||||
{
|
||||
_traverse_pt<e_ordering::ORDER_POLYNODES>(nodes, retval);
|
||||
}
|
||||
|
||||
void traverse_pt_unordered(const ClipperLib::PolyNodes &nodes, Polygons *retval)
|
||||
{
|
||||
_traverse_pt<e_ordering::DONT_ORDER_POLYNODES>(nodes, retval);
|
||||
}
|
||||
|
||||
void traverse_pt_unordered(const ClipperLib::PolyNodes &nodes, ExPolygons *retval)
|
||||
{
|
||||
_traverse_pt<e_ordering::DONT_ORDER_POLYNODES>(nodes, retval);
|
||||
// Polygons retval;
|
||||
// traverse_pt_noholes(polytree.Childs, &retval);
|
||||
// return retval;
|
||||
}
|
||||
|
||||
Polygons simplify_polygons(const Polygons &subject, bool preserve_collinear)
|
||||
|
@ -230,13 +230,95 @@ ClipperLib::PolyTree union_pt(Slic3r::ExPolygons &&subject, bool safety_offset_
|
||||
|
||||
Slic3r::Polygons union_pt_chained(const Slic3r::Polygons &subject, bool safety_offset_ = false);
|
||||
|
||||
void traverse_pt(const ClipperLib::PolyNodes &nodes, Slic3r::Polygons *retval);
|
||||
void traverse_pt(const ClipperLib::PolyNodes &nodes, Slic3r::ExPolygons *retval);
|
||||
void traverse_pt(const ClipperLib::PolyNode *tree, Slic3r::ExPolygons *retval);
|
||||
ClipperLib::PolyNodes order_nodes(const ClipperLib::PolyNodes &nodes);
|
||||
|
||||
// Implementing generalized loop (foreach) over a list of nodes which can be
|
||||
// ordered or unordered (performance gain) based on template parameter
|
||||
enum class e_ordering {
|
||||
ON,
|
||||
OFF
|
||||
};
|
||||
|
||||
// Create a template struct, template functions can not be partially specialized
|
||||
template<e_ordering o, class Fn> struct _foreach_node {
|
||||
void operator()(const ClipperLib::PolyNodes &nodes, Fn &&fn);
|
||||
};
|
||||
|
||||
// Specialization with NO ordering
|
||||
template<class Fn> struct _foreach_node<e_ordering::OFF, Fn> {
|
||||
void operator()(const ClipperLib::PolyNodes &nodes, Fn &&fn)
|
||||
{
|
||||
for (auto &n : nodes) fn(n);
|
||||
}
|
||||
};
|
||||
|
||||
// Specialization with ordering
|
||||
template<class Fn> struct _foreach_node<e_ordering::ON, Fn> {
|
||||
void operator()(const ClipperLib::PolyNodes &nodes, Fn &&fn)
|
||||
{
|
||||
auto ordered_nodes = order_nodes(nodes);
|
||||
for (auto &n : nodes) fn(n);
|
||||
}
|
||||
};
|
||||
|
||||
// Wrapper function for the foreach_node which can deduce arguments automatically
|
||||
template<e_ordering o, class Fn>
|
||||
void foreach_node(const ClipperLib::PolyNodes &nodes, Fn &&fn)
|
||||
{
|
||||
_foreach_node<o, Fn>()(nodes, std::forward<Fn>(fn));
|
||||
}
|
||||
|
||||
// Collecting polygons of the tree into a list of Polygons, holes have clockwise
|
||||
// orientation.
|
||||
template<e_ordering ordering = e_ordering::OFF>
|
||||
void traverse_pt(const ClipperLib::PolyNode *tree, Polygons *out)
|
||||
{
|
||||
if (!tree) return; // terminates recursion
|
||||
|
||||
// Push the contour of the current level
|
||||
out->emplace_back(ClipperPath_to_Slic3rPolygon(tree->Contour));
|
||||
|
||||
// Do the recursion for all the children.
|
||||
traverse_pt<ordering>(tree->Childs, out);
|
||||
}
|
||||
|
||||
// Collecting polygons of the tree into a list of ExPolygons.
|
||||
template<e_ordering ordering = e_ordering::OFF>
|
||||
void traverse_pt(const ClipperLib::PolyNode *tree, ExPolygons *out)
|
||||
{
|
||||
if (!tree) return;
|
||||
else if(tree->IsHole()) {
|
||||
// Levels of holes are skipped and handled together with the
|
||||
// contour levels.
|
||||
traverse_pt<ordering>(tree->Childs, out);
|
||||
return;
|
||||
}
|
||||
|
||||
ExPolygon level;
|
||||
level.contour = ClipperPath_to_Slic3rPolygon(tree->Contour);
|
||||
|
||||
foreach_node<ordering>(tree->Childs,
|
||||
[out, &level] (const ClipperLib::PolyNode *node) {
|
||||
|
||||
// Holes are collected here.
|
||||
level.holes.emplace_back(ClipperPath_to_Slic3rPolygon(node->Contour));
|
||||
|
||||
// By doing a recursion, a new level expoly is created with the contour
|
||||
// and holes of the lower level. Doing this for all the childs.
|
||||
traverse_pt<ordering>(node->Childs, out);
|
||||
});
|
||||
|
||||
out->emplace_back(level);
|
||||
}
|
||||
|
||||
template<e_ordering o = e_ordering::OFF, class ExOrJustPolygons>
|
||||
void traverse_pt(const ClipperLib::PolyNodes &nodes, ExOrJustPolygons *retval)
|
||||
{
|
||||
foreach_node<o>(nodes, [&retval](const ClipperLib::PolyNode *node) {
|
||||
traverse_pt<o>(node, retval);
|
||||
});
|
||||
}
|
||||
|
||||
void traverse_pt_unordered(const ClipperLib::PolyNodes &nodes, Slic3r::Polygons *retval);
|
||||
void traverse_pt_unordered(const ClipperLib::PolyNodes &nodes, Slic3r::ExPolygons *retval);
|
||||
void traverse_pt_unordered(const ClipperLib::PolyNode *tree, Slic3r::ExPolygons *retval);
|
||||
|
||||
/* OTHER */
|
||||
Slic3r::Polygons simplify_polygons(const Slic3r::Polygons &subject, bool preserve_collinear = false);
|
||||
|
@ -671,7 +671,7 @@ void ConfigBase::load_from_gcode_file(const std::string &file)
|
||||
}
|
||||
ifs.seekg(0, ifs.end);
|
||||
auto file_length = ifs.tellg();
|
||||
auto data_length = std::min<std::fstream::streampos>(65535, file_length);
|
||||
auto data_length = std::min<std::fstream::pos_type>(65535, file_length);
|
||||
ifs.seekg(file_length - data_length, ifs.beg);
|
||||
std::vector<char> data(size_t(data_length) + 1, 0);
|
||||
ifs.read(data.data(), data_length);
|
||||
|
@ -472,7 +472,7 @@ static inline void smooth_compensation_banded(const Points &contour, float band,
|
||||
float l2 = (pthis - pprev).squaredNorm();
|
||||
if (l2 < dist_min2) {
|
||||
float l = sqrt(l2);
|
||||
int jprev = exchange(j, prev_idx_modulo(j, contour));
|
||||
int jprev = std::exchange(j, prev_idx_modulo(j, contour));
|
||||
while (j != i) {
|
||||
const Vec2f pp = contour[j].cast<float>();
|
||||
const float lthis = (pp - pprev).norm();
|
||||
@ -487,7 +487,7 @@ static inline void smooth_compensation_banded(const Points &contour, float band,
|
||||
prev = use_min ? std::min(prev, compensation[j]) : compensation[j];
|
||||
pprev = pp;
|
||||
l = lnext;
|
||||
jprev = exchange(j, prev_idx_modulo(j, contour));
|
||||
jprev = std::exchange(j, prev_idx_modulo(j, contour));
|
||||
}
|
||||
}
|
||||
|
||||
@ -497,7 +497,7 @@ static inline void smooth_compensation_banded(const Points &contour, float band,
|
||||
l2 = (pprev - pthis).squaredNorm();
|
||||
if (l2 < dist_min2) {
|
||||
float l = sqrt(l2);
|
||||
int jprev = exchange(j, next_idx_modulo(j, contour));
|
||||
int jprev = std::exchange(j, next_idx_modulo(j, contour));
|
||||
while (j != i) {
|
||||
const Vec2f pp = contour[j].cast<float>();
|
||||
const float lthis = (pp - pprev).norm();
|
||||
@ -512,7 +512,7 @@ static inline void smooth_compensation_banded(const Points &contour, float band,
|
||||
next = use_min ? std::min(next, compensation[j]) : compensation[j];
|
||||
pprev = pp;
|
||||
l = lnext;
|
||||
jprev = exchange(j, next_idx_modulo(j, contour));
|
||||
jprev = std::exchange(j, next_idx_modulo(j, contour));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,12 @@ namespace pt = boost::property_tree;
|
||||
// VERSION NUMBERS
|
||||
// 0 : .3mf, files saved by older slic3r or other applications. No version definition in them.
|
||||
// 1 : Introduction of 3mf versioning. No other change in data saved into 3mf files.
|
||||
// 2 : Meshes saved in their local system; Volumes' matrices and source data added to Metadata/Slic3r_PE_model.config file.
|
||||
const unsigned int VERSION_3MF = 2;
|
||||
// 2 : Volumes' matrices and source data added to Metadata/Slic3r_PE_model.config file, meshes transformed back to their coordinate system on loading.
|
||||
// WARNING !! -> the version number has been rolled back to 1
|
||||
// the next change should use 3
|
||||
const unsigned int VERSION_3MF = 1;
|
||||
// Allow loading version 2 file as well.
|
||||
const unsigned int VERSION_3MF_COMPATIBLE = 2;
|
||||
const char* SLIC3RPE_3MF_VERSION = "slic3rpe:Version3mf"; // definition of the metadata name saved into .model file
|
||||
|
||||
const std::string MODEL_FOLDER = "3D/";
|
||||
@ -51,7 +55,7 @@ const std::string MODEL_CONFIG_FILE = "Metadata/Slic3r_PE_model.config";
|
||||
const std::string LAYER_HEIGHTS_PROFILE_FILE = "Metadata/Slic3r_PE_layer_heights_profile.txt";
|
||||
const std::string LAYER_CONFIG_RANGES_FILE = "Metadata/Prusa_Slicer_layer_config_ranges.xml";
|
||||
const std::string SLA_SUPPORT_POINTS_FILE = "Metadata/Slic3r_PE_sla_support_points.txt";
|
||||
const std::string CUSTOM_GCODE_PER_HEIGHT_FILE = "Metadata/Prusa_Slicer_custom_gcode_per_height.xml";
|
||||
const std::string CUSTOM_GCODE_PER_PRINT_Z_FILE = "Metadata/Prusa_Slicer_custom_gcode_per_print_z.xml";
|
||||
|
||||
const char* MODEL_TAG = "model";
|
||||
const char* RESOURCES_TAG = "resources";
|
||||
@ -418,7 +422,7 @@ namespace Slic3r {
|
||||
void _extract_layer_config_ranges_from_archive(mz_zip_archive& archive, const mz_zip_archive_file_stat& stat);
|
||||
void _extract_sla_support_points_from_archive(mz_zip_archive& archive, const mz_zip_archive_file_stat& stat);
|
||||
|
||||
void _extract_custom_gcode_per_height_from_archive(mz_zip_archive& archive, const mz_zip_archive_file_stat& stat);
|
||||
void _extract_custom_gcode_per_print_z_from_archive(mz_zip_archive& archive, const mz_zip_archive_file_stat& stat);
|
||||
|
||||
void _extract_print_config_from_archive(mz_zip_archive& archive, const mz_zip_archive_file_stat& stat, DynamicPrintConfig& config, const std::string& archive_filename);
|
||||
bool _extract_model_config_from_archive(mz_zip_archive& archive, const mz_zip_archive_file_stat& stat, Model& model);
|
||||
@ -629,10 +633,10 @@ namespace Slic3r {
|
||||
// extract slic3r print config file
|
||||
_extract_print_config_from_archive(archive, stat, config, filename);
|
||||
}
|
||||
if (boost::algorithm::iequals(name, CUSTOM_GCODE_PER_HEIGHT_FILE))
|
||||
if (boost::algorithm::iequals(name, CUSTOM_GCODE_PER_PRINT_Z_FILE))
|
||||
{
|
||||
// extract slic3r layer config ranges file
|
||||
_extract_custom_gcode_per_height_from_archive(archive, stat);
|
||||
_extract_custom_gcode_per_print_z_from_archive(archive, stat);
|
||||
}
|
||||
else if (boost::algorithm::iequals(name, MODEL_CONFIG_FILE))
|
||||
{
|
||||
@ -1064,7 +1068,7 @@ namespace Slic3r {
|
||||
return true;
|
||||
}
|
||||
|
||||
void _3MF_Importer::_extract_custom_gcode_per_height_from_archive(::mz_zip_archive &archive, const mz_zip_archive_file_stat &stat)
|
||||
void _3MF_Importer::_extract_custom_gcode_per_print_z_from_archive(::mz_zip_archive &archive, const mz_zip_archive_file_stat &stat)
|
||||
{
|
||||
if (stat.m_uncomp_size > 0)
|
||||
{
|
||||
@ -1079,24 +1083,23 @@ namespace Slic3r {
|
||||
pt::ptree main_tree;
|
||||
pt::read_xml(iss, main_tree);
|
||||
|
||||
if (main_tree.front().first != "custom_gcodes_per_height")
|
||||
if (main_tree.front().first != "custom_gcodes_per_print_z")
|
||||
return;
|
||||
pt::ptree code_tree = main_tree.front().second;
|
||||
|
||||
if (!m_model->custom_gcode_per_height.empty())
|
||||
m_model->custom_gcode_per_height.clear();
|
||||
m_model->custom_gcode_per_print_z.clear();
|
||||
|
||||
for (const auto& code : code_tree)
|
||||
{
|
||||
if (code.first != "code")
|
||||
continue;
|
||||
pt::ptree tree = code.second;
|
||||
double height = tree.get<double>("<xmlattr>.height");
|
||||
std::string gcode = tree.get<std::string>("<xmlattr>.gcode");
|
||||
int extruder = tree.get<int>("<xmlattr>.extruder");
|
||||
std::string color = tree.get<std::string>("<xmlattr>.color");
|
||||
double print_z = tree.get<double> ("<xmlattr>.print_z" );
|
||||
std::string gcode = tree.get<std::string> ("<xmlattr>.gcode" );
|
||||
int extruder = tree.get<int> ("<xmlattr>.extruder" );
|
||||
std::string color = tree.get<std::string> ("<xmlattr>.color" );
|
||||
|
||||
m_model->custom_gcode_per_height.push_back(Model::CustomGCode(height, gcode, extruder, color)) ;
|
||||
m_model->custom_gcode_per_print_z.push_back(Model::CustomGCode{print_z, gcode, extruder, color}) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1512,10 +1515,12 @@ namespace Slic3r {
|
||||
{
|
||||
m_version = (unsigned int)atoi(m_curr_characters.c_str());
|
||||
|
||||
if (m_check_version && (m_version > VERSION_3MF))
|
||||
if (m_check_version && (m_version > VERSION_3MF_COMPATIBLE))
|
||||
{
|
||||
std::string msg = _(L("The selected 3mf file has been saved with a newer version of " + std::string(SLIC3R_APP_NAME) + " and is not compatible."));
|
||||
throw version_error(msg.c_str());
|
||||
// std::string msg = _(L("The selected 3mf file has been saved with a newer version of " + std::string(SLIC3R_APP_NAME) + " and is not compatible."));
|
||||
// throw version_error(msg.c_str());
|
||||
const std::string msg = (boost::format(_(L("The selected 3mf file has been saved with a newer version of %1% and is not compatible."))) % std::string(SLIC3R_APP_NAME)).str();
|
||||
throw version_error(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1696,20 +1701,21 @@ namespace Slic3r {
|
||||
return false;
|
||||
}
|
||||
|
||||
Slic3r::Geometry::Transformation transform;
|
||||
if (m_version > 1)
|
||||
Transform3d volume_matrix_to_object = Transform3d::Identity();
|
||||
bool has_transform = false;
|
||||
// extract the volume transformation from the volume's metadata, if present
|
||||
for (const Metadata& metadata : volume_data.metadata)
|
||||
{
|
||||
// extract the volume transformation from the volume's metadata, if present
|
||||
for (const Metadata& metadata : volume_data.metadata)
|
||||
if (metadata.key == MATRIX_KEY)
|
||||
{
|
||||
if (metadata.key == MATRIX_KEY)
|
||||
{
|
||||
transform.set_from_string(metadata.value);
|
||||
break;
|
||||
}
|
||||
volume_matrix_to_object = Slic3r::Geometry::transform3d_from_string(metadata.value);
|
||||
has_transform = ! volume_matrix_to_object.isApprox(Transform3d::Identity(), 1e-10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Transform3d inv_matrix = transform.get_matrix().inverse();
|
||||
#if !ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
Transform3d inv_matrix = volume_matrix_to_object.inverse();
|
||||
#endif // !ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
|
||||
// splits volume out of imported geometry
|
||||
TriangleMesh triangle_mesh;
|
||||
@ -1729,11 +1735,15 @@ namespace Slic3r {
|
||||
for (unsigned int v = 0; v < 3; ++v)
|
||||
{
|
||||
unsigned int tri_id = geometry.triangles[src_start_id + ii + v] * 3;
|
||||
#if ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
facet.vertex[v] = Vec3f(geometry.vertices[tri_id + 0], geometry.vertices[tri_id + 1], geometry.vertices[tri_id + 2]);
|
||||
#else
|
||||
Vec3f vertex(geometry.vertices[tri_id + 0], geometry.vertices[tri_id + 1], geometry.vertices[tri_id + 2]);
|
||||
if (m_version > 1)
|
||||
facet.vertex[v] = has_transform ?
|
||||
// revert the vertices to the original mesh reference system
|
||||
vertex = (inv_matrix * vertex.cast<double>()).cast<float>();
|
||||
::memcpy(facet.vertex[v].data(), (const void*)vertex.data(), 3 * sizeof(float));
|
||||
(inv_matrix * vertex.cast<double>()).cast<float>() :
|
||||
vertex;
|
||||
#endif // ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
}
|
||||
}
|
||||
|
||||
@ -1741,9 +1751,15 @@ namespace Slic3r {
|
||||
triangle_mesh.repair();
|
||||
|
||||
ModelVolume* volume = object.add_volume(std::move(triangle_mesh));
|
||||
#if ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
// stores the volume matrix taken from the metadata, if present
|
||||
if (has_transform)
|
||||
volume->source.transform = Slic3r::Geometry::Transformation(volume_matrix_to_object);
|
||||
#else
|
||||
// apply the volume matrix taken from the metadata, if present
|
||||
if (m_version > 1)
|
||||
volume->set_transformation(transform);
|
||||
if (has_transform)
|
||||
volume->set_transformation(Slic3r::Geometry::Transformation(volume_matrix_to_object));
|
||||
#endif //ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
volume->calculate_convex_hull();
|
||||
|
||||
// apply the remaining volume's metadata
|
||||
@ -1883,7 +1899,7 @@ namespace Slic3r {
|
||||
bool _add_sla_support_points_file_to_archive(mz_zip_archive& archive, Model& model);
|
||||
bool _add_print_config_file_to_archive(mz_zip_archive& archive, const DynamicPrintConfig &config);
|
||||
bool _add_model_config_file_to_archive(mz_zip_archive& archive, const Model& model, const IdToObjectDataMap &objects_data);
|
||||
bool _add_custom_gcode_per_height_file_to_archive(mz_zip_archive& archive, Model& model);
|
||||
bool _add_custom_gcode_per_print_z_file_to_archive(mz_zip_archive& archive, Model& model);
|
||||
};
|
||||
|
||||
#if ENABLE_THUMBNAIL_GENERATOR
|
||||
@ -1986,9 +2002,9 @@ namespace Slic3r {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Adds custom gcode per height file ("Metadata/Prusa_Slicer_custom_gcode_per_height.xml").
|
||||
// Adds custom gcode per height file ("Metadata/Prusa_Slicer_custom_gcode_per_print_z.xml").
|
||||
// All custom gcode per height of whole Model are stored here
|
||||
if (!_add_custom_gcode_per_height_file_to_archive(archive, model))
|
||||
if (!_add_custom_gcode_per_print_z_file_to_archive(archive, model))
|
||||
{
|
||||
close_zip_writer(&archive);
|
||||
boost::filesystem::remove(filename);
|
||||
@ -2468,6 +2484,9 @@ namespace Slic3r {
|
||||
bool _3MF_Exporter::_add_model_config_file_to_archive(mz_zip_archive& archive, const Model& model, const IdToObjectDataMap &objects_data)
|
||||
{
|
||||
std::stringstream stream;
|
||||
// Store mesh transformation in full precision, as the volumes are stored transformed and they need to be transformed back
|
||||
// when loaded as accurately as possible.
|
||||
stream << std::setprecision(std::numeric_limits<double>::max_digits10);
|
||||
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
|
||||
stream << "<" << CONFIG_TAG << ">\n";
|
||||
|
||||
@ -2514,7 +2533,11 @@ namespace Slic3r {
|
||||
|
||||
// stores volume's local matrix
|
||||
stream << " <" << METADATA_TAG << " " << TYPE_ATTR << "=\"" << VOLUME_TYPE << "\" " << KEY_ATTR << "=\"" << MATRIX_KEY << "\" " << VALUE_ATTR << "=\"";
|
||||
#if ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
Transform3d matrix = volume->get_matrix() * volume->source.transform.get_matrix();
|
||||
#else
|
||||
const Transform3d& matrix = volume->get_matrix();
|
||||
#endif // ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
for (int r = 0; r < 4; ++r)
|
||||
{
|
||||
for (int c = 0; c < 4; ++c)
|
||||
@ -2565,20 +2588,20 @@ namespace Slic3r {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool _3MF_Exporter::_add_custom_gcode_per_height_file_to_archive( mz_zip_archive& archive, Model& model)
|
||||
bool _3MF_Exporter::_add_custom_gcode_per_print_z_file_to_archive( mz_zip_archive& archive, Model& model)
|
||||
{
|
||||
std::string out = "";
|
||||
|
||||
if (!model.custom_gcode_per_height.empty())
|
||||
if (!model.custom_gcode_per_print_z.empty())
|
||||
{
|
||||
pt::ptree tree;
|
||||
pt::ptree& main_tree = tree.add("custom_gcodes_per_height", "");
|
||||
pt::ptree& main_tree = tree.add("custom_gcodes_per_print_z", "");
|
||||
|
||||
for (const Model::CustomGCode& code : model.custom_gcode_per_height)
|
||||
for (const Model::CustomGCode& code : model.custom_gcode_per_print_z)
|
||||
{
|
||||
pt::ptree& code_tree = main_tree.add("code", "");
|
||||
// store minX and maxZ
|
||||
code_tree.put("<xmlattr>.height" , code.height );
|
||||
code_tree.put("<xmlattr>.print_z" , code.print_z );
|
||||
code_tree.put("<xmlattr>.gcode" , code.gcode );
|
||||
code_tree.put("<xmlattr>.extruder" , code.extruder );
|
||||
code_tree.put("<xmlattr>.color" , code.color );
|
||||
@ -2597,9 +2620,9 @@ bool _3MF_Exporter::_add_custom_gcode_per_height_file_to_archive( mz_zip_archive
|
||||
|
||||
if (!out.empty())
|
||||
{
|
||||
if (!mz_zip_writer_add_mem(&archive, CUSTOM_GCODE_PER_HEIGHT_FILE.c_str(), (const void*)out.data(), out.length(), MZ_DEFAULT_COMPRESSION))
|
||||
if (!mz_zip_writer_add_mem(&archive, CUSTOM_GCODE_PER_PRINT_Z_FILE.c_str(), (const void*)out.data(), out.length(), MZ_DEFAULT_COMPRESSION))
|
||||
{
|
||||
add_error("Unable to add custom Gcodes per height file to archive");
|
||||
add_error("Unable to add custom Gcodes per print_z file to archive");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -41,8 +41,11 @@ namespace pt = boost::property_tree;
|
||||
// Added x and y components of rotation
|
||||
// Added x, y and z components of scale
|
||||
// Added x, y and z components of mirror
|
||||
// 3 : Meshes saved in their local system; Added volumes' matrices and source data
|
||||
const unsigned int VERSION_AMF = 3;
|
||||
// 3 : Added volumes' matrices and source data, meshes transformed back to their coordinate system on loading.
|
||||
// WARNING !! -> the version number has been rolled back to 2
|
||||
// the next change should use 4
|
||||
const unsigned int VERSION_AMF = 2;
|
||||
const unsigned int VERSION_AMF_COMPATIBLE = 3;
|
||||
const char* SLIC3RPE_AMF_VERSION = "slic3rpe_amf_version";
|
||||
|
||||
const char* SLIC3R_CONFIG_TYPE = "slic3rpe_config";
|
||||
@ -228,6 +231,8 @@ struct AMFParserContext
|
||||
ModelVolume *m_volume;
|
||||
// Faces collected for the current m_volume.
|
||||
std::vector<int> m_volume_facets;
|
||||
// Transformation matrix of a volume mesh from its coordinate system to Object's coordinate system.
|
||||
Transform3d m_volume_transform;
|
||||
// Current material allocated for an amf/metadata subtree.
|
||||
ModelMaterial *m_material;
|
||||
// Current instance allocated for an amf/constellation/instance subtree.
|
||||
@ -319,6 +324,7 @@ void AMFParserContext::startElement(const char *name, const char **atts)
|
||||
else if (strcmp(name, "volume") == 0) {
|
||||
assert(! m_volume);
|
||||
m_volume = m_object->add_volume(TriangleMesh());
|
||||
m_volume_transform = Transform3d::Identity();
|
||||
node_type_new = NODE_TYPE_VOLUME;
|
||||
}
|
||||
} else if (m_path[2] == NODE_TYPE_INSTANCE) {
|
||||
@ -578,27 +584,37 @@ void AMFParserContext::endElement(const char * /* name */)
|
||||
stl.stats.original_num_facets = stl.stats.number_of_facets;
|
||||
stl_allocate(&stl);
|
||||
|
||||
Slic3r::Geometry::Transformation transform;
|
||||
if (m_version > 2)
|
||||
transform = m_volume->get_transformation();
|
||||
|
||||
Transform3d inv_matrix = transform.get_matrix().inverse();
|
||||
|
||||
bool has_transform = ! m_volume_transform.isApprox(Transform3d::Identity(), 1e-10);
|
||||
#if !ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
Transform3d inv_matrix = m_volume_transform.inverse();
|
||||
#endif // !ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
for (size_t i = 0; i < m_volume_facets.size();) {
|
||||
stl_facet &facet = stl.facet_start[i/3];
|
||||
for (unsigned int v = 0; v < 3; ++v)
|
||||
{
|
||||
unsigned int tri_id = m_volume_facets[i++] * 3;
|
||||
#if ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
facet.vertex[v] = Vec3f(m_object_vertices[tri_id + 0], m_object_vertices[tri_id + 1], m_object_vertices[tri_id + 2]);
|
||||
#else
|
||||
Vec3f vertex(m_object_vertices[tri_id + 0], m_object_vertices[tri_id + 1], m_object_vertices[tri_id + 2]);
|
||||
if (m_version > 2)
|
||||
facet.vertex[v] = has_transform ?
|
||||
// revert the vertices to the original mesh reference system
|
||||
vertex = (inv_matrix * vertex.cast<double>()).cast<float>();
|
||||
::memcpy((void*)facet.vertex[v].data(), (const void*)vertex.data(), 3 * sizeof(float));
|
||||
(inv_matrix * vertex.cast<double>()).cast<float>() :
|
||||
vertex;
|
||||
#endif // ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
}
|
||||
}
|
||||
}
|
||||
stl_get_size(&stl);
|
||||
mesh.repair();
|
||||
m_volume->set_mesh(std::move(mesh));
|
||||
#if ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
// stores the volume matrix taken from the metadata, if present
|
||||
if (has_transform)
|
||||
m_volume->source.transform = Slic3r::Geometry::Transformation(m_volume_transform);
|
||||
#else
|
||||
if (has_transform)
|
||||
m_volume->set_transformation(m_volume_transform);
|
||||
#endif // ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
if (m_volume->source.input_file.empty() && (m_volume->type() == ModelVolumeType::MODEL_PART))
|
||||
{
|
||||
m_volume->source.object_idx = (int)m_model.objects.size() - 1;
|
||||
@ -637,7 +653,7 @@ void AMFParserContext::endElement(const char * /* name */)
|
||||
int extruder = atoi(m_value[2].c_str());
|
||||
const std::string& color = m_value[3];
|
||||
|
||||
m_model.custom_gcode_per_height.push_back(Model::CustomGCode(height, gcode, extruder, color));
|
||||
m_model.custom_gcode_per_print_z.push_back(Model::CustomGCode{height, gcode, extruder, color});
|
||||
|
||||
for (std::string& val: m_value)
|
||||
val.clear();
|
||||
@ -718,9 +734,7 @@ void AMFParserContext::endElement(const char * /* name */)
|
||||
m_volume->set_type(ModelVolume::type_from_string(m_value[1]));
|
||||
}
|
||||
else if (strcmp(opt_key, "matrix") == 0) {
|
||||
Geometry::Transformation transform;
|
||||
transform.set_from_string(m_value[1]);
|
||||
m_volume->set_transformation(transform);
|
||||
m_volume_transform = Slic3r::Geometry::transform3d_from_string(m_value[1]);
|
||||
}
|
||||
else if (strcmp(opt_key, "source_file") == 0) {
|
||||
m_volume->source.input_file = m_value[1];
|
||||
@ -910,10 +924,12 @@ bool extract_model_from_archive(mz_zip_archive& archive, const mz_zip_archive_fi
|
||||
|
||||
ctx.endDocument();
|
||||
|
||||
if (check_version && (ctx.m_version > VERSION_AMF))
|
||||
if (check_version && (ctx.m_version > VERSION_AMF_COMPATIBLE))
|
||||
{
|
||||
std::string msg = _(L("The selected amf file has been saved with a newer version of " + std::string(SLIC3R_APP_NAME) + " and is not compatible."));
|
||||
throw std::runtime_error(msg.c_str());
|
||||
// std::string msg = _(L("The selected amf file has been saved with a newer version of " + std::string(SLIC3R_APP_NAME) + " and is not compatible."));
|
||||
// throw std::runtime_error(msg.c_str());
|
||||
const std::string msg = (boost::format(_(L("The selected amf file has been saved with a newer version of %1% and is not compatible."))) % std::string(SLIC3R_APP_NAME)).str();
|
||||
throw std::runtime_error(msg);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1142,7 +1158,12 @@ bool store_amf(std::string &path, Model *model, const DynamicPrintConfig *config
|
||||
stream << " <metadata type=\"slic3r.modifier\">1</metadata>\n";
|
||||
stream << " <metadata type=\"slic3r.volume_type\">" << ModelVolume::type_to_string(volume->type()) << "</metadata>\n";
|
||||
stream << " <metadata type=\"slic3r.matrix\">";
|
||||
#if ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
const Transform3d& matrix = volume->get_matrix() * volume->source.transform.get_matrix();
|
||||
#else
|
||||
const Transform3d& matrix = volume->get_matrix();
|
||||
#endif // ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
stream << std::setprecision(std::numeric_limits<double>::max_digits10);
|
||||
for (int r = 0; r < 4; ++r)
|
||||
{
|
||||
for (int c = 0; c < 4; ++c)
|
||||
@ -1162,6 +1183,7 @@ bool store_amf(std::string &path, Model *model, const DynamicPrintConfig *config
|
||||
stream << " <metadata type=\"slic3r.source_offset_y\">" << volume->source.mesh_offset(1) << "</metadata>\n";
|
||||
stream << " <metadata type=\"slic3r.source_offset_z\">" << volume->source.mesh_offset(2) << "</metadata>\n";
|
||||
}
|
||||
stream << std::setprecision(std::numeric_limits<float>::max_digits10);
|
||||
const indexed_triangle_set &its = volume->mesh().its;
|
||||
for (size_t i = 0; i < its.indices.size(); ++i) {
|
||||
stream << " <triangle>\n";
|
||||
@ -1218,21 +1240,21 @@ bool store_amf(std::string &path, Model *model, const DynamicPrintConfig *config
|
||||
stream << " </constellation>\n";
|
||||
}
|
||||
|
||||
if (!model->custom_gcode_per_height.empty())
|
||||
if (!model->custom_gcode_per_print_z.empty())
|
||||
{
|
||||
std::string out = "";
|
||||
pt::ptree tree;
|
||||
|
||||
pt::ptree& main_tree = tree.add("custom_gcodes_per_height", "");
|
||||
|
||||
for (const Model::CustomGCode& code : model->custom_gcode_per_height)
|
||||
for (const Model::CustomGCode& code : model->custom_gcode_per_print_z)
|
||||
{
|
||||
pt::ptree& code_tree = main_tree.add("code", "");
|
||||
// store minX and maxZ
|
||||
code_tree.put("<xmlattr>.height", code.height);
|
||||
code_tree.put("<xmlattr>.gcode", code.gcode);
|
||||
code_tree.put("<xmlattr>.extruder", code.extruder);
|
||||
code_tree.put("<xmlattr>.color", code.color);
|
||||
code_tree.put("<xmlattr>.print_z" , code.print_z );
|
||||
code_tree.put("<xmlattr>.gcode" , code.gcode );
|
||||
code_tree.put("<xmlattr>.extruder" , code.extruder );
|
||||
code_tree.put("<xmlattr>.color" , code.color );
|
||||
}
|
||||
|
||||
if (!tree.empty())
|
||||
@ -1241,7 +1263,7 @@ bool store_amf(std::string &path, Model *model, const DynamicPrintConfig *config
|
||||
pt::write_xml(oss, tree);
|
||||
out = oss.str();
|
||||
|
||||
int del_header_pos = out.find("<custom_gcodes_per_height");
|
||||
size_t del_header_pos = out.find("<custom_gcodes_per_height");
|
||||
if (del_header_pos != std::string::npos)
|
||||
out.erase(out.begin(), out.begin() + del_header_pos);
|
||||
|
||||
|
@ -495,37 +495,37 @@ std::string WipeTowerIntegration::prime(GCode &gcodegen)
|
||||
{
|
||||
std::string gcode;
|
||||
|
||||
if (&m_priming != nullptr) {
|
||||
// Disable linear advance for the wipe tower operations.
|
||||
//gcode += (gcodegen.config().gcode_flavor == gcfRepRap ? std::string("M572 D0 S0\n") : std::string("M900 K0\n"));
|
||||
|
||||
for (const WipeTower::ToolChangeResult& tcr : m_priming) {
|
||||
if (!tcr.extrusions.empty())
|
||||
gcode += append_tcr(gcodegen, tcr, tcr.new_tool);
|
||||
// Disable linear advance for the wipe tower operations.
|
||||
//gcode += (gcodegen.config().gcode_flavor == gcfRepRap ? std::string("M572 D0 S0\n") : std::string("M900 K0\n"));
|
||||
|
||||
for (const WipeTower::ToolChangeResult& tcr : m_priming) {
|
||||
if (!tcr.extrusions.empty())
|
||||
gcode += append_tcr(gcodegen, tcr, tcr.new_tool);
|
||||
|
||||
|
||||
// Let the tool change be executed by the wipe tower class.
|
||||
// Inform the G-code writer about the changes done behind its back.
|
||||
//gcode += tcr.gcode;
|
||||
// Let the m_writer know the current extruder_id, but ignore the generated G-code.
|
||||
// unsigned int current_extruder_id = tcr.extrusions.back().tool;
|
||||
// gcodegen.writer().toolchange(current_extruder_id);
|
||||
// gcodegen.placeholder_parser().set("current_extruder", current_extruder_id);
|
||||
// Let the tool change be executed by the wipe tower class.
|
||||
// Inform the G-code writer about the changes done behind its back.
|
||||
//gcode += tcr.gcode;
|
||||
// Let the m_writer know the current extruder_id, but ignore the generated G-code.
|
||||
// unsigned int current_extruder_id = tcr.extrusions.back().tool;
|
||||
// gcodegen.writer().toolchange(current_extruder_id);
|
||||
// gcodegen.placeholder_parser().set("current_extruder", current_extruder_id);
|
||||
|
||||
}
|
||||
|
||||
// A phony move to the end position at the wipe tower.
|
||||
/* gcodegen.writer().travel_to_xy(Vec2d(m_priming.back().end_pos.x, m_priming.back().end_pos.y));
|
||||
gcodegen.set_last_pos(wipe_tower_point_to_object_point(gcodegen, m_priming.back().end_pos));
|
||||
// Prepare a future wipe.
|
||||
gcodegen.m_wipe.path.points.clear();
|
||||
// Start the wipe at the current position.
|
||||
gcodegen.m_wipe.path.points.emplace_back(wipe_tower_point_to_object_point(gcodegen, m_priming.back().end_pos));
|
||||
// Wipe end point: Wipe direction away from the closer tower edge to the further tower edge.
|
||||
gcodegen.m_wipe.path.points.emplace_back(wipe_tower_point_to_object_point(gcodegen,
|
||||
WipeTower::xy((std::abs(m_left - m_priming.back().end_pos.x) < std::abs(m_right - m_priming.back().end_pos.x)) ? m_right : m_left,
|
||||
m_priming.back().end_pos.y)));*/
|
||||
}
|
||||
|
||||
// A phony move to the end position at the wipe tower.
|
||||
/* gcodegen.writer().travel_to_xy(Vec2d(m_priming.back().end_pos.x, m_priming.back().end_pos.y));
|
||||
gcodegen.set_last_pos(wipe_tower_point_to_object_point(gcodegen, m_priming.back().end_pos));
|
||||
// Prepare a future wipe.
|
||||
gcodegen.m_wipe.path.points.clear();
|
||||
// Start the wipe at the current position.
|
||||
gcodegen.m_wipe.path.points.emplace_back(wipe_tower_point_to_object_point(gcodegen, m_priming.back().end_pos));
|
||||
// Wipe end point: Wipe direction away from the closer tower edge to the further tower edge.
|
||||
gcodegen.m_wipe.path.points.emplace_back(wipe_tower_point_to_object_point(gcodegen,
|
||||
WipeTower::xy((std::abs(m_left - m_priming.back().end_pos.x) < std::abs(m_right - m_priming.back().end_pos.x)) ? m_right : m_left,
|
||||
m_priming.back().end_pos.y)));*/
|
||||
|
||||
return gcode;
|
||||
}
|
||||
|
||||
@ -630,7 +630,7 @@ std::vector<GCode::LayerToPrint> GCode::collect_layers_to_print(const PrintObjec
|
||||
|
||||
if (layer_to_print.print_z() > maximal_print_z + 2. * EPSILON)
|
||||
throw std::runtime_error(_(L("Empty layers detected, the output would not be printable.")) + "\n\n" +
|
||||
_(L("Object name: ")) + object.model_object()->name + "\n" + _(L("Print z: ")) +
|
||||
_(L("Object name")) + ": " + object.model_object()->name + "\n" + _(L("Print z")) + ": " +
|
||||
std::to_string(layers_to_print.back().print_z()) + "\n\n" + _(L("This is "
|
||||
"usually caused by negligibly small extrusions or by a faulty model. Try to repair "
|
||||
" the model or change its orientation on the bed.")));
|
||||
@ -803,6 +803,7 @@ void GCode::_do_export(Print &print, FILE *file)
|
||||
// resets time estimators
|
||||
m_normal_time_estimator.reset();
|
||||
m_normal_time_estimator.set_dialect(print.config().gcode_flavor);
|
||||
m_normal_time_estimator.set_extrusion_axis(print.config().get_extrusion_axis()[0]);
|
||||
m_silent_time_estimator_enabled = (print.config().gcode_flavor == gcfMarlin) && print.config().silent_mode;
|
||||
|
||||
// Until we have a UI support for the other firmwares than the Marlin, use the hardcoded default values
|
||||
@ -833,6 +834,7 @@ void GCode::_do_export(Print &print, FILE *file)
|
||||
{
|
||||
m_silent_time_estimator.reset();
|
||||
m_silent_time_estimator.set_dialect(print.config().gcode_flavor);
|
||||
m_silent_time_estimator.set_extrusion_axis(print.config().get_extrusion_axis()[0]);
|
||||
/* "Stealth mode" values can be just a copy of "normal mode" values
|
||||
* (when they aren't input for a printer preset).
|
||||
* Thus, use back value from values, instead of second one, which could be absent
|
||||
@ -882,6 +884,9 @@ void GCode::_do_export(Print &print, FILE *file)
|
||||
}
|
||||
m_analyzer.set_extruder_offsets(extruder_offsets);
|
||||
|
||||
// tell analyzer about the extrusion axis
|
||||
m_analyzer.set_extrusion_axis(print.config().get_extrusion_axis()[0]);
|
||||
|
||||
// send extruders count to analyzer to allow it to detect invalid extruder idxs
|
||||
const ConfigOptionStrings* extruders_opt = dynamic_cast<const ConfigOptionStrings*>(print.config().option("extruder_colour"));
|
||||
const ConfigOptionStrings* filamemts_opt = dynamic_cast<const ConfigOptionStrings*>(print.config().option("filament_colour"));
|
||||
@ -932,7 +937,7 @@ void GCode::_do_export(Print &print, FILE *file)
|
||||
|
||||
// Initialize custom gcode
|
||||
Model* model = print.get_object(0)->model_object()->get_model();
|
||||
m_custom_g_code_heights = model->custom_gcode_per_height;
|
||||
m_custom_gcode_per_print_z = model->custom_gcode_per_print_z;
|
||||
|
||||
// Initialize autospeed.
|
||||
{
|
||||
@ -1141,20 +1146,22 @@ void GCode::_do_export(Print &print, FILE *file)
|
||||
}
|
||||
print.throw_if_canceled();
|
||||
|
||||
// #ys_FIXME_no_exported_codes
|
||||
/*
|
||||
/* To avoid change filament for non-used extruder for Multi-material,
|
||||
* check model->custom_gcode_per_height using tool_ordering values
|
||||
* */
|
||||
if (!m_custom_g_code_heights. empty())
|
||||
* check model->custom_gcode_per_print_z using tool_ordering values
|
||||
* /
|
||||
if (!m_custom_gcode_per_print_z. empty())
|
||||
{
|
||||
bool delete_executed = false;
|
||||
auto it = m_custom_g_code_heights.end();
|
||||
while (it != m_custom_g_code_heights.begin())
|
||||
auto it = m_custom_gcode_per_print_z.end();
|
||||
while (it != m_custom_gcode_per_print_z.begin())
|
||||
{
|
||||
--it;
|
||||
if (it->gcode != ColorChangeCode)
|
||||
continue;
|
||||
|
||||
auto it_layer_tools = std::lower_bound(tool_ordering.begin(), tool_ordering.end(), LayerTools(it->height));
|
||||
auto it_layer_tools = std::lower_bound(tool_ordering.begin(), tool_ordering.end(), LayerTools(it->print_z));
|
||||
|
||||
bool used_extruder = false;
|
||||
for (; it_layer_tools != tool_ordering.end(); it_layer_tools++)
|
||||
@ -1171,16 +1178,16 @@ void GCode::_do_export(Print &print, FILE *file)
|
||||
|
||||
/* If we are there, current extruder wouldn't be used,
|
||||
* so this color change is a redundant move.
|
||||
* Delete this item from m_custom_g_code_heights
|
||||
* */
|
||||
it = m_custom_g_code_heights.erase(it);
|
||||
* Delete this item from m_custom_gcode_per_print_z
|
||||
* /
|
||||
it = m_custom_gcode_per_print_z.erase(it);
|
||||
delete_executed = true;
|
||||
}
|
||||
|
||||
if (delete_executed)
|
||||
model->custom_gcode_per_height = m_custom_g_code_heights;
|
||||
model->custom_gcode_per_print_z = m_custom_gcode_per_print_z;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
m_cooling_buffer->set_current_extruder(initial_extruder_id);
|
||||
|
||||
@ -1478,7 +1485,7 @@ void GCode::_do_export(Print &print, FILE *file)
|
||||
dst.first += buf;
|
||||
++ dst.second;
|
||||
};
|
||||
print.m_print_statistics.filament_stats.insert(std::pair<size_t, float>(extruder.id(), (float)used_filament));
|
||||
print.m_print_statistics.filament_stats.insert(std::pair<size_t, float>{extruder.id(), (float)used_filament});
|
||||
append(out_filament_used_mm, "%.1lf", used_filament);
|
||||
append(out_filament_used_cm3, "%.1lf", extruded_volume * 0.001);
|
||||
if (filament_weight > 0.) {
|
||||
@ -1852,15 +1859,15 @@ void GCode::process_layer(
|
||||
std::string custom_code = "";
|
||||
std::string pause_print_msg = "";
|
||||
int m600_before_extruder = -1;
|
||||
while (!m_custom_g_code_heights.empty() && m_custom_g_code_heights.front().height-EPSILON < layer.print_z) {
|
||||
custom_code = m_custom_g_code_heights.front().gcode;
|
||||
while (!m_custom_gcode_per_print_z.empty() && m_custom_gcode_per_print_z.front().print_z - EPSILON < layer.print_z) {
|
||||
custom_code = m_custom_gcode_per_print_z.front().gcode;
|
||||
|
||||
if (custom_code == ColorChangeCode && m_custom_g_code_heights.front().extruder > 0)
|
||||
m600_before_extruder = m_custom_g_code_heights.front().extruder - 1;
|
||||
if (custom_code == ColorChangeCode && m_custom_gcode_per_print_z.front().extruder > 0)
|
||||
m600_before_extruder = m_custom_gcode_per_print_z.front().extruder - 1;
|
||||
if (custom_code == PausePrintCode)
|
||||
pause_print_msg = m_custom_g_code_heights.front().color;
|
||||
pause_print_msg = m_custom_gcode_per_print_z.front().color;
|
||||
|
||||
m_custom_g_code_heights.erase(m_custom_g_code_heights.begin());
|
||||
m_custom_gcode_per_print_z.erase(m_custom_gcode_per_print_z.begin());
|
||||
colorprint_change = true;
|
||||
}
|
||||
|
||||
|
@ -384,7 +384,7 @@ protected:
|
||||
* Updated before the export and erased during the process,
|
||||
* so no toolchange occurs twice.
|
||||
* */
|
||||
std::vector<Model::CustomGCode> m_custom_g_code_heights;
|
||||
std::vector<Model::CustomGCode> m_custom_gcode_per_print_z;
|
||||
|
||||
// ordered list of object, to give them a unique id.
|
||||
std::vector<const PrintObject*> m_ordered_objects;
|
||||
|
@ -108,16 +108,6 @@ GCodeAnalyzer::GCodeMove::GCodeMove(GCodeMove::EType type, const GCodeAnalyzer::
|
||||
{
|
||||
}
|
||||
|
||||
GCodeAnalyzer::GCodeAnalyzer()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
void GCodeAnalyzer::set_extruder_offsets(const GCodeAnalyzer::ExtruderOffsetsMap& extruder_offsets)
|
||||
{
|
||||
m_extruder_offsets = extruder_offsets;
|
||||
}
|
||||
|
||||
void GCodeAnalyzer::set_extruders_count(unsigned int count)
|
||||
{
|
||||
m_extruders_count = count;
|
||||
@ -125,11 +115,6 @@ void GCodeAnalyzer::set_extruders_count(unsigned int count)
|
||||
m_extruder_color[i] = i;
|
||||
}
|
||||
|
||||
void GCodeAnalyzer::set_gcode_flavor(const GCodeFlavor& flavor)
|
||||
{
|
||||
m_gcode_flavor = flavor;
|
||||
}
|
||||
|
||||
void GCodeAnalyzer::reset()
|
||||
{
|
||||
_set_units(Millimeters);
|
||||
|
@ -124,12 +124,14 @@ private:
|
||||
std::string m_process_output;
|
||||
|
||||
public:
|
||||
GCodeAnalyzer();
|
||||
GCodeAnalyzer() { reset(); }
|
||||
|
||||
void set_extruder_offsets(const ExtruderOffsetsMap& extruder_offsets);
|
||||
void set_extruder_offsets(const ExtruderOffsetsMap& extruder_offsets) { m_extruder_offsets = extruder_offsets; }
|
||||
void set_extruders_count(unsigned int count);
|
||||
|
||||
void set_gcode_flavor(const GCodeFlavor& flavor);
|
||||
void set_extrusion_axis(char axis) { m_parser.set_extrusion_axis(axis); }
|
||||
|
||||
void set_gcode_flavor(const GCodeFlavor& flavor) { m_gcode_flavor = flavor; }
|
||||
|
||||
// Reinitialize the analyzer
|
||||
void reset();
|
||||
|
@ -119,6 +119,7 @@ public:
|
||||
float f() const { return m_position[F]; }
|
||||
|
||||
char extrusion_axis() const { return m_extrusion_axis; }
|
||||
void set_extrusion_axis(char axis) { m_extrusion_axis = axis; }
|
||||
|
||||
private:
|
||||
const char* parse_line_internal(const char *ptr, GCodeLine &gline, std::pair<const char*, const char*> &command);
|
||||
|
@ -342,6 +342,8 @@ namespace Slic3r {
|
||||
void increment_g1_line_id();
|
||||
void reset_g1_line_id();
|
||||
|
||||
void set_extrusion_axis(char axis) { m_parser.set_extrusion_axis(axis); }
|
||||
|
||||
void set_extruder_id(unsigned int id);
|
||||
unsigned int get_extruder_id() const;
|
||||
void reset_extruder_id();
|
||||
|
@ -10,6 +10,11 @@
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
// Additional Codes which can be set by user using DoubleSlider
|
||||
static constexpr char ColorChangeCode[] = "M600";
|
||||
static constexpr char PausePrintCode[] = "M601";
|
||||
static constexpr char ExtruderChangeCode[] = "tool_change";
|
||||
|
||||
class GCodeWriter {
|
||||
public:
|
||||
GCodeConfig config;
|
||||
|
@ -954,11 +954,8 @@ void assemble_transform(Transform3d& transform, const Vec3d& translation, const
|
||||
{
|
||||
transform = Transform3d::Identity();
|
||||
transform.translate(translation);
|
||||
transform.rotate(Eigen::AngleAxisd(rotation(2), Vec3d::UnitZ()));
|
||||
transform.rotate(Eigen::AngleAxisd(rotation(1), Vec3d::UnitY()));
|
||||
transform.rotate(Eigen::AngleAxisd(rotation(0), Vec3d::UnitX()));
|
||||
transform.scale(scale);
|
||||
transform.scale(mirror);
|
||||
transform.rotate(Eigen::AngleAxisd(rotation(2), Vec3d::UnitZ()) * Eigen::AngleAxisd(rotation(1), Vec3d::UnitY()) * Eigen::AngleAxisd(rotation(0), Vec3d::UnitX()));
|
||||
transform.scale(scale.cwiseProduct(mirror));
|
||||
}
|
||||
|
||||
Transform3d assemble_transform(const Vec3d& translation, const Vec3d& rotation, const Vec3d& scale, const Vec3d& mirror)
|
||||
@ -1166,32 +1163,6 @@ void Transformation::set_from_transform(const Transform3d& transform)
|
||||
// std::cout << "something went wrong in extracting data from matrix" << std::endl;
|
||||
}
|
||||
|
||||
void Transformation::set_from_string(const std::string& transform_str)
|
||||
{
|
||||
Transform3d transform = Transform3d::Identity();
|
||||
|
||||
if (!transform_str.empty())
|
||||
{
|
||||
std::vector<std::string> mat_elements_str;
|
||||
boost::split(mat_elements_str, transform_str, boost::is_any_of(" "), boost::token_compress_on);
|
||||
|
||||
unsigned int size = (unsigned int)mat_elements_str.size();
|
||||
if (size == 16)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
for (unsigned int r = 0; r < 4; ++r)
|
||||
{
|
||||
for (unsigned int c = 0; c < 4; ++c)
|
||||
{
|
||||
transform(r, c) = ::atof(mat_elements_str[i++].c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set_from_transform(transform);
|
||||
}
|
||||
|
||||
void Transformation::reset()
|
||||
{
|
||||
m_offset = Vec3d::Zero();
|
||||
@ -1282,6 +1253,33 @@ Transformation Transformation::volume_to_bed_transformation(const Transformation
|
||||
return out;
|
||||
}
|
||||
|
||||
// For parsing a transformation matrix from 3MF / AMF.
|
||||
Transform3d transform3d_from_string(const std::string& transform_str)
|
||||
{
|
||||
Transform3d transform = Transform3d::Identity();
|
||||
|
||||
if (!transform_str.empty())
|
||||
{
|
||||
std::vector<std::string> mat_elements_str;
|
||||
boost::split(mat_elements_str, transform_str, boost::is_any_of(" "), boost::token_compress_on);
|
||||
|
||||
unsigned int size = (unsigned int)mat_elements_str.size();
|
||||
if (size == 16)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
for (unsigned int r = 0; r < 4; ++r)
|
||||
{
|
||||
for (unsigned int c = 0; c < 4; ++c)
|
||||
{
|
||||
transform(r, c) = ::atof(mat_elements_str[i++].c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return transform;
|
||||
}
|
||||
|
||||
Eigen::Quaterniond rotation_xyz_diff(const Vec3d &rot_xyz_from, const Vec3d &rot_xyz_to)
|
||||
{
|
||||
return
|
||||
|
@ -335,7 +335,6 @@ public:
|
||||
void set_mirror(Axis axis, double mirror);
|
||||
|
||||
void set_from_transform(const Transform3d& transform);
|
||||
void set_from_string(const std::string& transform_str);
|
||||
|
||||
void reset();
|
||||
|
||||
@ -360,6 +359,9 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
// For parsing a transformation matrix from 3MF / AMF.
|
||||
extern Transform3d transform3d_from_string(const std::string& transform_str);
|
||||
|
||||
// Rotation when going from the first coordinate system with rotation rot_xyz_from applied
|
||||
// to a coordinate system with rot_xyz_to applied.
|
||||
extern Eigen::Quaterniond rotation_xyz_diff(const Vec3d &rot_xyz_from, const Vec3d &rot_xyz_to);
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#include "SVG.hpp"
|
||||
#include <Eigen/Dense>
|
||||
#include "GCodeWriter.hpp"
|
||||
#include "GCode/PreviewData.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
@ -43,7 +45,7 @@ Model& Model::assign_copy(const Model &rhs)
|
||||
}
|
||||
|
||||
// copy custom code per height
|
||||
this->custom_gcode_per_height = rhs.custom_gcode_per_height;
|
||||
this->custom_gcode_per_print_z = rhs.custom_gcode_per_print_z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -64,7 +66,7 @@ Model& Model::assign_copy(Model &&rhs)
|
||||
rhs.objects.clear();
|
||||
|
||||
// copy custom code per height
|
||||
this->custom_gcode_per_height = rhs.custom_gcode_per_height;
|
||||
this->custom_gcode_per_print_z = rhs.custom_gcode_per_print_z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -124,6 +126,8 @@ Model Model::read_from_file(const std::string& input_file, DynamicPrintConfig* c
|
||||
if (add_default_instances)
|
||||
model.add_default_instances();
|
||||
|
||||
update_custom_gcode_per_print_z_from_config(model.custom_gcode_per_print_z, config);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
@ -159,6 +163,8 @@ Model Model::read_from_archive(const std::string& input_file, DynamicPrintConfig
|
||||
if (add_default_instances)
|
||||
model.add_default_instances();
|
||||
|
||||
update_custom_gcode_per_print_z_from_config(model.custom_gcode_per_print_z, config);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
@ -595,16 +601,15 @@ std::string Model::propose_export_file_name_and_path(const std::string &new_exte
|
||||
std::vector<std::pair<double, DynamicPrintConfig>> Model::get_custom_tool_changes(double default_layer_height, size_t num_extruders) const
|
||||
{
|
||||
std::vector<std::pair<double, DynamicPrintConfig>> custom_tool_changes;
|
||||
if (!custom_gcode_per_height.empty()) {
|
||||
for (const CustomGCode& custom_gcode : custom_gcode_per_height)
|
||||
if (custom_gcode.gcode == ExtruderChangeCode) {
|
||||
DynamicPrintConfig config;
|
||||
// If extruder count in PrinterSettings was changed, use default (0) extruder for extruders, more than num_extruders
|
||||
config.set_key_value("extruder", new ConfigOptionInt(custom_gcode.extruder > num_extruders ? 0 : custom_gcode.extruder));
|
||||
// For correct extruders(tools) changing, we should decrease custom_gcode.height value by one default layer height
|
||||
custom_tool_changes.push_back({ custom_gcode.height - default_layer_height, config });
|
||||
}
|
||||
}
|
||||
for (const CustomGCode& custom_gcode : custom_gcode_per_print_z)
|
||||
if (custom_gcode.gcode == ExtruderChangeCode) {
|
||||
DynamicPrintConfig config;
|
||||
// If extruder count in PrinterSettings was changed, use default (0) extruder for extruders, more than num_extruders
|
||||
config.set_key_value("extruder", new ConfigOptionInt(custom_gcode.extruder > num_extruders ? 0 : custom_gcode.extruder));
|
||||
// For correct extruders(tools) changing, we should decrease custom_gcode.height value by one default layer height
|
||||
custom_tool_changes.push_back({ custom_gcode.print_z - default_layer_height, config });
|
||||
}
|
||||
|
||||
return custom_tool_changes;
|
||||
}
|
||||
|
||||
@ -1297,6 +1302,8 @@ void ModelObject::split(ModelObjectPtrs* new_objects)
|
||||
}
|
||||
|
||||
new_vol->set_offset(Vec3d::Zero());
|
||||
// reset the source to disable reload from disk
|
||||
new_vol->source = ModelVolume::Source();
|
||||
new_objects->emplace_back(new_object);
|
||||
delete mesh;
|
||||
}
|
||||
@ -1352,6 +1359,8 @@ void ModelObject::bake_xy_rotation_into_meshes(size_t instance_idx)
|
||||
model_volume->set_mirror(Vec3d(1., 1., 1.));
|
||||
// Move the reference point of the volume to compensate for the change of the instance trafo.
|
||||
model_volume->set_offset(volume_offset_correction * volume_trafo.get_offset());
|
||||
// reset the source to disable reload from disk
|
||||
model_volume->source = ModelVolume::Source();
|
||||
}
|
||||
|
||||
this->invalidate_bounding_box();
|
||||
@ -1663,6 +1672,8 @@ size_t ModelVolume::split(unsigned int max_extruders)
|
||||
this->calculate_convex_hull();
|
||||
// Assign a new unique ID, so that a new GLVolume will be generated.
|
||||
this->set_new_unique_id();
|
||||
// reset the source to disable reload from disk
|
||||
this->source = ModelVolume::Source();
|
||||
}
|
||||
else
|
||||
this->object->volumes.insert(this->object->volumes.begin() + (++ivolume), new ModelVolume(object, *this, std::move(*mesh)));
|
||||
@ -1933,6 +1944,30 @@ extern bool model_has_advanced_features(const Model &model)
|
||||
return false;
|
||||
}
|
||||
|
||||
extern void update_custom_gcode_per_print_z_from_config(std::vector<Model::CustomGCode>& custom_gcode_per_print_z, DynamicPrintConfig* config)
|
||||
{
|
||||
if (!config->has("colorprint_heights"))
|
||||
return;
|
||||
|
||||
const std::vector<std::string>& colors = GCodePreviewData::ColorPrintColors();
|
||||
|
||||
const auto& colorprint_values = config->option<ConfigOptionFloats>("colorprint_heights")->values;
|
||||
|
||||
if (!colorprint_values.empty())
|
||||
{
|
||||
custom_gcode_per_print_z.clear();
|
||||
custom_gcode_per_print_z.reserve(colorprint_values.size());
|
||||
int i = 0;
|
||||
for (auto val : colorprint_values)
|
||||
custom_gcode_per_print_z.emplace_back(Model::CustomGCode{ val, ColorChangeCode, 1, colors[(++i)%7] });
|
||||
}
|
||||
|
||||
/* There is one and only place this configuration option is used now.
|
||||
* It wouldn't be used in the future, so erase it.
|
||||
* */
|
||||
config->erase("colorprint_heights");
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
// Verify whether the IDs of Model / ModelObject / ModelVolume / ModelInstance / ModelMaterial are valid and unique.
|
||||
void check_model_ids_validity(const Model &model)
|
||||
|
@ -399,8 +399,13 @@ public:
|
||||
int object_idx{ -1 };
|
||||
int volume_idx{ -1 };
|
||||
Vec3d mesh_offset{ Vec3d::Zero() };
|
||||
#if ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
Geometry::Transformation transform;
|
||||
|
||||
template<class Archive> void serialize(Archive& ar) { ar(input_file, object_idx, volume_idx, mesh_offset, transform); }
|
||||
#else
|
||||
template<class Archive> void serialize(Archive& ar) { ar(input_file, object_idx, volume_idx, mesh_offset); }
|
||||
#endif // ENABLE_KEEP_LOADED_VOLUME_TRANSFORM_AS_STAND_ALONE
|
||||
};
|
||||
Source source;
|
||||
|
||||
@ -466,6 +471,7 @@ public:
|
||||
|
||||
const Geometry::Transformation& get_transformation() const { return m_transformation; }
|
||||
void set_transformation(const Geometry::Transformation& transformation) { m_transformation = transformation; }
|
||||
void set_transformation(const Transform3d &trafo) { m_transformation.set_from_transform(trafo); }
|
||||
|
||||
const Vec3d& get_offset() const { return m_transformation.get_offset(); }
|
||||
double get_offset(Axis axis) const { return m_transformation.get_offset(axis); }
|
||||
@ -749,33 +755,30 @@ public:
|
||||
// Extensions for color print
|
||||
struct CustomGCode
|
||||
{
|
||||
CustomGCode(double height, const std::string& code, int extruder, const std::string& color) :
|
||||
height(height), gcode(code), extruder(extruder), color(color) {}
|
||||
|
||||
bool operator<(const CustomGCode& other) const { return other.height > this->height; }
|
||||
bool operator<(const CustomGCode& other) const { return other.print_z > this->print_z; }
|
||||
bool operator==(const CustomGCode& other) const
|
||||
{
|
||||
return (other.height == this->height) &&
|
||||
(other.gcode == this->gcode) &&
|
||||
(other.extruder == this->extruder )&&
|
||||
(other.color == this->color );
|
||||
return (other.print_z == this->print_z ) &&
|
||||
(other.gcode == this->gcode ) &&
|
||||
(other.extruder == this->extruder ) &&
|
||||
(other.color == this->color );
|
||||
}
|
||||
bool operator!=(const CustomGCode& other) const
|
||||
{
|
||||
return (other.height != this->height) ||
|
||||
(other.gcode != this->gcode) ||
|
||||
(other.extruder != this->extruder )||
|
||||
(other.color != this->color );
|
||||
return (other.print_z != this->print_z ) ||
|
||||
(other.gcode != this->gcode ) ||
|
||||
(other.extruder != this->extruder ) ||
|
||||
(other.color != this->color );
|
||||
}
|
||||
|
||||
double height;
|
||||
double print_z;
|
||||
std::string gcode;
|
||||
int extruder; // 0 - "gcode" will be applied for whole print
|
||||
// else - "gcode" will be applied only for "extruder" print
|
||||
std::string color; // if gcode is equal to PausePrintCode,
|
||||
// this field is used for save a short message shown on Printer display
|
||||
};
|
||||
std::vector<CustomGCode> custom_gcode_per_height;
|
||||
std::vector<CustomGCode> custom_gcode_per_print_z;
|
||||
|
||||
// Default constructor assigns a new ID to the model.
|
||||
Model() { assert(this->id().valid()); }
|
||||
@ -841,7 +844,7 @@ public:
|
||||
// Propose an output path, replace extension. The new_extension shall contain the initial dot.
|
||||
std::string propose_export_file_name_and_path(const std::string &new_extension) const;
|
||||
|
||||
// from custom_gcode_per_height get just tool_change codes
|
||||
// from custom_gcode_per_print_z get just tool_change codes
|
||||
std::vector<std::pair<double, DynamicPrintConfig>> get_custom_tool_changes(double default_layer_height, size_t num_extruders) const;
|
||||
|
||||
private:
|
||||
@ -877,6 +880,10 @@ extern bool model_volume_list_changed(const ModelObject &model_object_old, const
|
||||
extern bool model_has_multi_part_objects(const Model &model);
|
||||
// If the model has advanced features, then it cannot be processed in simple mode.
|
||||
extern bool model_has_advanced_features(const Model &model);
|
||||
/* If loaded configuration has a "colorprint_heights" option (if it was imported from older Slicer),
|
||||
* then model.custom_gcode_per_print_z should be updated considering this option
|
||||
* */
|
||||
extern void update_custom_gcode_per_print_z_from_config(std::vector<Model::CustomGCode>& custom_gcode_per_print_z, DynamicPrintConfig* config);
|
||||
|
||||
#ifndef NDEBUG
|
||||
// Verify whether the IDs of Model / ModelObject / ModelVolume / ModelInstance / ModelMaterial are valid and unique.
|
||||
|
@ -773,10 +773,10 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
|
||||
model_object_status.emplace(model_object->id(), ModelObjectStatus::Old);
|
||||
|
||||
// But if custom gcode per layer height was changed
|
||||
if (m_model.custom_gcode_per_height != model.custom_gcode_per_height) {
|
||||
if (m_model.custom_gcode_per_print_z != model.custom_gcode_per_print_z) {
|
||||
// we should stop background processing
|
||||
update_apply_status(this->invalidate_step(psGCodeExport));
|
||||
m_model.custom_gcode_per_height = model.custom_gcode_per_height;
|
||||
m_model.custom_gcode_per_print_z = model.custom_gcode_per_print_z;
|
||||
}
|
||||
} else if (model_object_list_extended(m_model, model)) {
|
||||
// Add new objects. Their volumes and configs will be synchronized later.
|
||||
@ -1286,6 +1286,8 @@ std::string Print::validate() const
|
||||
return L("Ooze prevention is currently not supported with the wipe tower enabled.");
|
||||
if (m_config.use_volumetric_e)
|
||||
return L("The Wipe Tower currently does not support volumetric E (use_volumetric_e=0).");
|
||||
if (m_config.complete_objects && extruders().size() > 1)
|
||||
return L("The Wipe Tower is currently not supported for multimaterial sequential prints.");
|
||||
|
||||
if (m_objects.size() > 1) {
|
||||
bool has_custom_layering = false;
|
||||
@ -1356,7 +1358,7 @@ std::string Print::validate() const
|
||||
} while (ref_z == next_ref_z);
|
||||
}
|
||||
if (std::abs(this_height - ref_height) > EPSILON)
|
||||
return L("The Wipe tower is only supported if all objects have the same layer height profile");
|
||||
return L("The Wipe tower is only supported if all objects have the same variable layer height");
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
|
@ -101,12 +101,6 @@ enum SLAPillarConnectionMode {
|
||||
slapcmDynamic
|
||||
};
|
||||
|
||||
// ys_FIXME ! may be, it's not a best place
|
||||
// Additional Codes which can be set by user using DoubleSlider
|
||||
static const std::string ColorChangeCode = "M600";
|
||||
static const std::string PausePrintCode = "M601";
|
||||
static const std::string ExtruderChangeCode = "tool_change";
|
||||
|
||||
template<> inline const t_config_enum_values& ConfigOptionEnum<PrinterTechnology>::get_enum_values() {
|
||||
static t_config_enum_values keys_map;
|
||||
if (keys_map.empty()) {
|
||||
@ -502,7 +496,6 @@ public:
|
||||
// Force the generation of solid shells between adjacent materials/volumes.
|
||||
ConfigOptionBool interface_shells;
|
||||
ConfigOptionFloat layer_height;
|
||||
ConfigOptionBool layer_height_adaptive;
|
||||
ConfigOptionFloat model_precision;
|
||||
ConfigOptionInt raft_layers;
|
||||
ConfigOptionEnum<SeamPosition> seam_position;
|
||||
@ -556,7 +549,6 @@ protected:
|
||||
OPT_PTR(infill_only_where_needed);
|
||||
OPT_PTR(interface_shells);
|
||||
OPT_PTR(layer_height);
|
||||
OPT_PTR(layer_height_adaptive);
|
||||
OPT_PTR(model_precision);
|
||||
OPT_PTR(raft_layers);
|
||||
OPT_PTR(seam_position);
|
||||
|
@ -337,18 +337,15 @@ PadSkeleton divide_blueprint(const ExPolygons &bp)
|
||||
for (ClipperLib::PolyTree::PolyNode *node : ptree.Childs) {
|
||||
ExPolygon poly(ClipperPath_to_Slic3rPolygon(node->Contour));
|
||||
for (ClipperLib::PolyTree::PolyNode *child : node->Childs) {
|
||||
if (child->IsHole()) {
|
||||
poly.holes.emplace_back(
|
||||
ClipperPath_to_Slic3rPolygon(child->Contour));
|
||||
poly.holes.emplace_back(
|
||||
ClipperPath_to_Slic3rPolygon(child->Contour));
|
||||
|
||||
traverse_pt_unordered(child->Childs, &ret.inner);
|
||||
}
|
||||
else traverse_pt_unordered(child, &ret.inner);
|
||||
traverse_pt(child->Childs, &ret.inner);
|
||||
}
|
||||
|
||||
ret.outer.emplace_back(poly);
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -430,9 +427,11 @@ public:
|
||||
|
||||
ExPolygons fullpad = diff_ex(fullcvh, model_bp_sticks);
|
||||
|
||||
remove_redundant_parts(fullpad);
|
||||
|
||||
PadSkeleton divided = divide_blueprint(fullpad);
|
||||
|
||||
remove_redundant_parts(divided.outer);
|
||||
remove_redundant_parts(divided.inner);
|
||||
|
||||
outer = std::move(divided.outer);
|
||||
inner = std::move(divided.inner);
|
||||
}
|
||||
|
@ -114,6 +114,7 @@ public:
|
||||
bool operator&(const Semver &b) const { return ::semver_satisfies_patch(ver, b.ver) != 0; }
|
||||
bool operator^(const Semver &b) const { return ::semver_satisfies_caret(ver, b.ver) != 0; }
|
||||
bool in_range(const Semver &low, const Semver &high) const { return low <= *this && *this <= high; }
|
||||
bool valid() const { return *this != zero() && *this != inf() && *this != invalid(); }
|
||||
|
||||
// Conversion
|
||||
std::string to_string() const {
|
||||
|
@ -46,15 +46,13 @@ std::vector<std::pair<size_t, bool>> chain_segments_closest_point(std::vector<En
|
||||
// Ignore the starting point as the starting point is considered to be occupied, no end point coud connect to it.
|
||||
size_t next_idx = find_closest_point(kdtree, this_point.pos,
|
||||
[this_idx, &end_points, &could_reverse_func](size_t idx) {
|
||||
return
|
||||
// ????
|
||||
//(idx ^ this_idx) > 1 &&
|
||||
// only consider untaken points
|
||||
end_points[idx].chain_id == 0
|
||||
// only consider seg_start if can't be reversed
|
||||
&& ((idx & 1) == 0 || could_reverse_func(idx >> 1)
|
||||
//don't consider erased segments
|
||||
&& this_idx < end_points.size());
|
||||
return
|
||||
// ????
|
||||
(idx ^ this_idx) > 1 &&
|
||||
// only consider untaken points
|
||||
end_points[idx].chain_id == 0
|
||||
// only consider seg_start if can't be reversed
|
||||
&& ((idx & 1) == 0 || could_reverse_func(idx >> 1));
|
||||
});
|
||||
assert(next_idx < end_points.size());
|
||||
EndPointType &end_point = end_points[next_idx];
|
||||
@ -91,11 +89,8 @@ std::vector<std::pair<size_t, bool>> chain_segments_greedy_constrained_reversals
|
||||
else if (num_segments == 1)
|
||||
{
|
||||
// Just sort the end points so that the first point visited is closest to start_near.
|
||||
if (could_reverse_func(0))
|
||||
out.emplace_back(0, start_near != nullptr &&
|
||||
out.emplace_back(0, could_reverse_func(0) && start_near != nullptr &&
|
||||
(end_point_func(0, true) - *start_near).template cast<double>().squaredNorm() < (end_point_func(0, false) - *start_near).template cast<double>().squaredNorm());
|
||||
else
|
||||
out.emplace_back(0, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1026,13 +1021,13 @@ std::vector<std::pair<size_t, bool>> chain_extrusion_entities(std::vector<Extrus
|
||||
auto segment_end_point = [&entities](size_t idx, bool first_point) -> const Point& { return first_point ? entities[idx]->first_point() : entities[idx]->last_point(); };
|
||||
auto could_reverse = [&entities](size_t idx) { const ExtrusionEntity *ee = entities[idx]; return ee->is_loop() || ee->can_reverse(); };
|
||||
std::vector<std::pair<size_t, bool>> out = chain_segments_greedy_constrained_reversals<Point, decltype(segment_end_point), decltype(could_reverse)>(segment_end_point, could_reverse, entities.size(), start_near);
|
||||
for (size_t i = 0; i < entities.size(); ++ i) {
|
||||
ExtrusionEntity *ee = entities[out[i].first];
|
||||
for (std::pair<size_t, bool> &segment : out) {
|
||||
ExtrusionEntity *ee = entities[segment.first];
|
||||
if (ee->is_loop())
|
||||
// Ignore reversals for loops, as the start point equals the end point.
|
||||
out[i].second = false;
|
||||
segment.second = false;
|
||||
// Is can_reverse() respected by the reversals?
|
||||
assert(entities[out[i].first]->can_reverse() || ! out[i].second);
|
||||
assert(ee->can_reverse() || ! segment.second);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
@ -63,7 +63,6 @@ SlicingParameters SlicingParameters::create_from_config(
|
||||
|
||||
SlicingParameters params;
|
||||
params.layer_height = object_config.layer_height.value;
|
||||
params.layer_height_adaptive = object_config.layer_height_adaptive.value;
|
||||
params.first_print_layer_height = first_layer_height;
|
||||
params.first_object_layer_height = first_layer_height;
|
||||
params.object_print_z_min = 0.;
|
||||
@ -228,38 +227,14 @@ std::vector<coordf_t> layer_height_profile_from_ranges(
|
||||
|
||||
// Based on the work of @platsch
|
||||
// Fill layer_height_profile by heights ensuring a prescribed maximum cusp height.
|
||||
#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
std::vector<double> layer_height_profile_adaptive(const SlicingParameters& slicing_params,
|
||||
const ModelObject& object, float cusp_value)
|
||||
#else
|
||||
std::vector<coordf_t> layer_height_profile_adaptive(
|
||||
const SlicingParameters &slicing_params,
|
||||
const t_layer_config_ranges & /* layer_config_ranges */,
|
||||
const ModelVolumePtrs &volumes)
|
||||
#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
std::vector<double> layer_height_profile_adaptive(const SlicingParameters& slicing_params, const ModelObject& object, float quality_factor)
|
||||
{
|
||||
#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
// 1) Initialize the SlicingAdaptive class with the object meshes.
|
||||
SlicingAdaptive as;
|
||||
as.set_slicing_parameters(slicing_params);
|
||||
as.set_object(object);
|
||||
#else
|
||||
// 1) Initialize the SlicingAdaptive class with the object meshes.
|
||||
SlicingAdaptive as;
|
||||
as.set_slicing_parameters(slicing_params);
|
||||
for (const ModelVolume *volume : volumes)
|
||||
if (volume->is_model_part())
|
||||
as.add_mesh(&volume->mesh());
|
||||
#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
|
||||
as.prepare();
|
||||
as.prepare(object);
|
||||
|
||||
// 2) Generate layers using the algorithm of @platsch
|
||||
// loop until we have at least one layer and the max slice_z reaches the object height
|
||||
#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
double cusp_value = 0.2;
|
||||
#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
|
||||
std::vector<double> layer_height_profile;
|
||||
layer_height_profile.push_back(0.0);
|
||||
layer_height_profile.push_back(slicing_params.first_object_layer_height);
|
||||
@ -267,39 +242,41 @@ std::vector<coordf_t> layer_height_profile_adaptive(
|
||||
layer_height_profile.push_back(slicing_params.first_object_layer_height);
|
||||
layer_height_profile.push_back(slicing_params.first_object_layer_height);
|
||||
}
|
||||
double slice_z = slicing_params.first_object_layer_height;
|
||||
int current_facet = 0;
|
||||
#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
while (slice_z <= slicing_params.object_print_z_height()) {
|
||||
double height = slicing_params.max_layer_height;
|
||||
#else
|
||||
double height = slicing_params.first_object_layer_height;
|
||||
while ((slice_z - height) <= slicing_params.object_print_z_height()) {
|
||||
height = 999.0;
|
||||
#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
double print_z = slicing_params.first_object_layer_height;
|
||||
// last facet visited by the as.next_layer_height() function, where the facets are sorted by their increasing Z span.
|
||||
size_t current_facet = 0;
|
||||
// loop until we have at least one layer and the max slice_z reaches the object height
|
||||
while (print_z + EPSILON < slicing_params.object_print_z_height()) {
|
||||
float height = slicing_params.max_layer_height;
|
||||
// Slic3r::debugf "\n Slice layer: %d\n", $id;
|
||||
// determine next layer height
|
||||
double cusp_height = as.cusp_height((float)slice_z, cusp_value, current_facet);
|
||||
float cusp_height = as.next_layer_height(float(print_z), quality_factor, current_facet);
|
||||
|
||||
#if 0
|
||||
// check for horizontal features and object size
|
||||
/*
|
||||
if($self->config->get_value('match_horizontal_surfaces')) {
|
||||
my $horizontal_dist = $adaptive_slicing[$region_id]->horizontal_facet_distance(scale $slice_z+$cusp_height, $min_height);
|
||||
if(($horizontal_dist < $min_height) && ($horizontal_dist > 0)) {
|
||||
Slic3r::debugf "Horizontal feature ahead, distance: %f\n", $horizontal_dist;
|
||||
# can we shrink the current layer a bit?
|
||||
if($cusp_height-($min_height-$horizontal_dist) > $min_height) {
|
||||
# yes we can
|
||||
$cusp_height = $cusp_height-($min_height-$horizontal_dist);
|
||||
Slic3r::debugf "Shrink layer height to %f\n", $cusp_height;
|
||||
if (this->config.match_horizontal_surfaces.value) {
|
||||
coordf_t horizontal_dist = as.horizontal_facet_distance(print_z + height, min_layer_height);
|
||||
if ((horizontal_dist < min_layer_height) && (horizontal_dist > 0)) {
|
||||
#ifdef SLIC3R_DEBUG
|
||||
std::cout << "Horizontal feature ahead, distance: " << horizontal_dist << std::endl;
|
||||
#endif
|
||||
// can we shrink the current layer a bit?
|
||||
if (height-(min_layer_height - horizontal_dist) > min_layer_height) {
|
||||
// yes we can
|
||||
height -= (min_layer_height - horizontal_dist);
|
||||
#ifdef SLIC3R_DEBUG
|
||||
std::cout << "Shrink layer height to " << height << std::endl;
|
||||
#endif
|
||||
}else{
|
||||
# no, current layer would become too thin
|
||||
$cusp_height = $cusp_height+$horizontal_dist;
|
||||
Slic3r::debugf "Widen layer height to %f\n", $cusp_height;
|
||||
// no, current layer would become too thin
|
||||
height += horizontal_dist;
|
||||
#ifdef SLIC3R_DEBUG
|
||||
std::cout << "Widen layer height to " << height << std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
height = std::min(cusp_height, height);
|
||||
|
||||
// apply z-gradation
|
||||
@ -312,22 +289,22 @@ std::vector<coordf_t> layer_height_profile_adaptive(
|
||||
|
||||
// look for an applicable custom range
|
||||
/*
|
||||
if (my $range = first { $_->[0] <= $slice_z && $_->[1] > $slice_z } @{$self->layer_height_ranges}) {
|
||||
if (my $range = first { $_->[0] <= $print_z && $_->[1] > $print_z } @{$self->layer_height_ranges}) {
|
||||
$height = $range->[2];
|
||||
|
||||
# if user set custom height to zero we should just skip the range and resume slicing over it
|
||||
if ($height == 0) {
|
||||
$slice_z += $range->[1] - $range->[0];
|
||||
$print_z += $range->[1] - $range->[0];
|
||||
next;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
layer_height_profile.push_back(slice_z);
|
||||
layer_height_profile.push_back(print_z);
|
||||
layer_height_profile.push_back(height);
|
||||
slice_z += height;
|
||||
print_z += height;
|
||||
#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
layer_height_profile.push_back(slice_z);
|
||||
layer_height_profile.push_back(print_z);
|
||||
layer_height_profile.push_back(height);
|
||||
#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
}
|
||||
@ -350,7 +327,6 @@ std::vector<coordf_t> layer_height_profile_adaptive(
|
||||
return layer_height_profile;
|
||||
}
|
||||
|
||||
#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
std::vector<double> smooth_height_profile(const std::vector<double>& profile, const SlicingParameters& slicing_params, const HeightProfileSmoothingParams& smoothing_params)
|
||||
{
|
||||
auto gauss_blur = [&slicing_params](const std::vector<double>& profile, const HeightProfileSmoothingParams& smoothing_params) -> std::vector<double> {
|
||||
@ -433,7 +409,6 @@ std::vector<double> smooth_height_profile(const std::vector<double>& profile, co
|
||||
|
||||
return gauss_blur(profile, smoothing_params);
|
||||
}
|
||||
#endif
|
||||
|
||||
void adjust_layer_height_profile(
|
||||
const SlicingParameters &slicing_params,
|
||||
@ -755,11 +730,7 @@ int generate_layer_height_texture(
|
||||
const Vec3i32 &color1 = palette_raw[idx1];
|
||||
const Vec3i32 &color2 = palette_raw[idx2];
|
||||
coordf_t z = cell_to_z * coordf_t(cell);
|
||||
#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
assert((lo - EPSILON <= z) && (z <= hi + EPSILON));
|
||||
#else
|
||||
assert(z >= lo && z <= hi);
|
||||
#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
assert(lo - EPSILON <= z && z <= hi + EPSILON);
|
||||
// Intensity profile to visualize the layers.
|
||||
coordf_t intensity = cos(M_PI * 0.7 * (mid - z) / h);
|
||||
// Color mapping from layer height to RGB.
|
||||
|
@ -18,12 +18,7 @@ namespace Slic3r
|
||||
|
||||
class PrintConfig;
|
||||
class PrintObjectConfig;
|
||||
#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
class ModelObject;
|
||||
#else
|
||||
class ModelVolume;
|
||||
typedef std::vector<ModelVolume*> ModelVolumePtrs;
|
||||
#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
|
||||
// Parameters to guide object slicing and support generation.
|
||||
// The slicing parameters account for a raft and whether the 1st object layer is printed with a normal or a bridging flow
|
||||
@ -64,8 +59,6 @@ struct SlicingParameters
|
||||
// The regular layer height, applied for all but the first layer, if not overridden by layer ranges
|
||||
// or by the variable layer thickness table.
|
||||
coordf_t layer_height;
|
||||
// enable the adpatative algorithm
|
||||
bool layer_height_adaptive;
|
||||
// Minimum / maximum layer height, to be used for the automatic adaptive layer height algorithm,
|
||||
// or by an interactive layer height editor.
|
||||
coordf_t min_layer_height;
|
||||
@ -145,10 +138,9 @@ extern std::vector<coordf_t> layer_height_profile_from_ranges(
|
||||
const SlicingParameters &slicing_params,
|
||||
const t_layer_config_ranges &layer_config_ranges);
|
||||
|
||||
#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
extern std::vector<double> layer_height_profile_adaptive(
|
||||
const SlicingParameters& slicing_params,
|
||||
const ModelObject& object, float cusp_value);
|
||||
const ModelObject& object, float quality_factor);
|
||||
|
||||
struct HeightProfileSmoothingParams
|
||||
{
|
||||
@ -162,12 +154,6 @@ struct HeightProfileSmoothingParams
|
||||
extern std::vector<double> smooth_height_profile(
|
||||
const std::vector<double>& profile, const SlicingParameters& slicing_params,
|
||||
const HeightProfileSmoothingParams& smoothing_params);
|
||||
#else
|
||||
extern std::vector<coordf_t> layer_height_profile_adaptive(
|
||||
const SlicingParameters &slicing_params,
|
||||
const t_layer_config_ranges &layer_config_ranges,
|
||||
const ModelVolumePtrs &volumes);
|
||||
#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
|
||||
enum LayerHeightEditActionType : unsigned int {
|
||||
LAYER_HEIGHT_EDIT_ACTION_INCREASE = 0,
|
||||
|
@ -1,156 +1,211 @@
|
||||
#include "libslic3r.h"
|
||||
#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
#include "Model.hpp"
|
||||
#else
|
||||
#include "TriangleMesh.hpp"
|
||||
#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
#include "SlicingAdaptive.hpp"
|
||||
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
||||
// Based on the work of Florens Waserfall (@platch on github)
|
||||
// and his paper
|
||||
// Florens Wasserfall, Norman Hendrich, Jianwei Zhang:
|
||||
// Adaptive Slicing for the FDM Process Revisited
|
||||
// 13th IEEE Conference on Automation Science and Engineering (CASE-2017), August 20-23, Xi'an, China. DOI: 10.1109/COASE.2017.8256074
|
||||
// https://tams.informatik.uni-hamburg.de/publications/2017/Adaptive%20Slicing%20for%20the%20FDM%20Process%20Revisited.pdf
|
||||
|
||||
// Vojtech believes that there is a bug in @platch's derivation of the triangle area error metric.
|
||||
// Following Octave code paints graphs of recommended layer height versus surface slope angle.
|
||||
#if 0
|
||||
adeg=0:1:85;
|
||||
a=adeg*pi/180;
|
||||
t=tan(a);
|
||||
tsqr=sqrt(tan(a));
|
||||
lerr=1./cos(a);
|
||||
lerr2=1./(0.3+cos(a));
|
||||
plot(adeg, t, 'b', adeg, sqrt(t), 'g', adeg, 0.5 * lerr, 'm', adeg, 0.5 * lerr2, 'r')
|
||||
xlabel("angle(deg), 0 - horizontal wall, 90 - vertical wall");
|
||||
ylabel("layer height");
|
||||
legend("tan(a) as cura - topographic lines distance limit", "sqrt(tan(a)) as PrusaSlicer - error triangle area limit", "old slic3r - max distance metric", "new slic3r - Waserfall paper");
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define ADAPTIVE_LAYER_HEIGHT_DEBUG
|
||||
#endif /* NDEBUG */
|
||||
|
||||
namespace Slic3r
|
||||
{
|
||||
|
||||
#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
void SlicingAdaptive::clear()
|
||||
{
|
||||
m_meshes.clear();
|
||||
m_faces.clear();
|
||||
m_face_normal_z.clear();
|
||||
}
|
||||
#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
|
||||
std::pair<float, float> face_z_span(const stl_facet *f)
|
||||
static inline std::pair<float, float> face_z_span(const stl_facet &f)
|
||||
{
|
||||
return std::pair<float, float>(
|
||||
std::min(std::min(f->vertex[0](2), f->vertex[1](2)), f->vertex[2](2)),
|
||||
std::max(std::max(f->vertex[0](2), f->vertex[1](2)), f->vertex[2](2)));
|
||||
std::min(std::min(f.vertex[0](2), f.vertex[1](2)), f.vertex[2](2)),
|
||||
std::max(std::max(f.vertex[0](2), f.vertex[1](2)), f.vertex[2](2)));
|
||||
}
|
||||
|
||||
void SlicingAdaptive::prepare()
|
||||
// By Florens Waserfall aka @platch:
|
||||
// This constant essentially describes the volumetric error at the surface which is induced
|
||||
// by stacking "elliptic" extrusion threads. It is empirically determined by
|
||||
// 1. measuring the surface profile of printed parts to find
|
||||
// the ratio between layer height and profile height and then
|
||||
// 2. computing the geometric difference between the model-surface and the elliptic profile.
|
||||
//
|
||||
// The definition of the roughness formula is in
|
||||
// https://tams.informatik.uni-hamburg.de/publications/2017/Adaptive%20Slicing%20for%20the%20FDM%20Process%20Revisited.pdf
|
||||
// (page 51, formula (8))
|
||||
// Currenty @platch's error metric formula is not used.
|
||||
static constexpr double SURFACE_CONST = 0.18403;
|
||||
|
||||
// for a given facet, compute maximum height within the allowed surface roughness / stairstepping deviation
|
||||
static inline float layer_height_from_slope(const SlicingAdaptive::FaceZ &face, float max_surface_deviation)
|
||||
{
|
||||
#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
if (m_object == nullptr)
|
||||
return;
|
||||
// @platch's formula, see his paper "Adaptive Slicing for the FDM Process Revisited".
|
||||
// return float(max_surface_deviation / (SURFACE_CONST + 0.5 * std::abs(normal_z)));
|
||||
|
||||
// Constant stepping in horizontal direction, as used by Cura.
|
||||
// return (face.n_cos > 1e-5) ? float(max_surface_deviation * face.n_sin / face.n_cos) : FLT_MAX;
|
||||
|
||||
m_faces.clear();
|
||||
m_face_normal_z.clear();
|
||||
// Constant error measured as an area of the surface error triangle, Vojtech's formula.
|
||||
// return (face.n_cos > 1e-5) ? float(1.44 * max_surface_deviation * sqrt(face.n_sin / face.n_cos)) : FLT_MAX;
|
||||
|
||||
m_mesh = m_object->raw_mesh();
|
||||
const ModelInstance* first_instance = m_object->instances.front();
|
||||
m_mesh.transform(first_instance->get_matrix(), first_instance->is_left_handed());
|
||||
// Constant error measured as an area of the surface error triangle, Vojtech's formula with clamping to roughness at 90 degrees.
|
||||
return std::min(max_surface_deviation / 0.184f, (face.n_cos > 1e-5) ? float(1.44 * max_surface_deviation * sqrt(face.n_sin / face.n_cos)) : FLT_MAX);
|
||||
|
||||
// Constant stepping along the surface, equivalent to the "surface roughness" metric by Perez and later Pandey et all, see @platch's paper for references.
|
||||
// return float(max_surface_deviation * face.n_sin);
|
||||
}
|
||||
|
||||
void SlicingAdaptive::clear()
|
||||
{
|
||||
m_faces.clear();
|
||||
}
|
||||
|
||||
void SlicingAdaptive::prepare(const ModelObject &object)
|
||||
{
|
||||
this->clear();
|
||||
|
||||
TriangleMesh mesh = object.raw_mesh();
|
||||
const ModelInstance &first_instance = *object.instances.front();
|
||||
mesh.transform(first_instance.get_matrix(), first_instance.is_left_handed());
|
||||
|
||||
// 1) Collect faces from mesh.
|
||||
m_faces.reserve(m_mesh.stl.stats.number_of_facets);
|
||||
for (stl_facet& face : m_mesh.stl.facet_start)
|
||||
{
|
||||
face.normal.normalize();
|
||||
m_faces.emplace_back(&face);
|
||||
m_faces.reserve(mesh.stl.stats.number_of_facets);
|
||||
for (const stl_facet &face : mesh.stl.facet_start) {
|
||||
Vec3f n = face.normal.normalized();
|
||||
m_faces.emplace_back(FaceZ({ face_z_span(face), std::abs(n.z()), std::sqrt(n.x() * n.x() + n.y() * n.y()) }));
|
||||
}
|
||||
#else
|
||||
// 1) Collect faces of all meshes.
|
||||
int nfaces_total = 0;
|
||||
for (std::vector<const TriangleMesh*>::const_iterator it_mesh = m_meshes.begin(); it_mesh != m_meshes.end(); ++ it_mesh)
|
||||
nfaces_total += (*it_mesh)->stl.stats.number_of_facets;
|
||||
m_faces.reserve(nfaces_total);
|
||||
for (std::vector<const TriangleMesh*>::const_iterator it_mesh = m_meshes.begin(); it_mesh != m_meshes.end(); ++ it_mesh)
|
||||
for (const stl_facet& face : (*it_mesh)->stl.facet_start)
|
||||
m_faces.emplace_back(&face);
|
||||
#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
|
||||
// 2) Sort faces lexicographically by their Z span.
|
||||
std::sort(m_faces.begin(), m_faces.end(), [](const stl_facet *f1, const stl_facet *f2) { return face_z_span(f1) < face_z_span(f2); });
|
||||
|
||||
// 3) Generate Z components of the facet normals.
|
||||
m_face_normal_z.assign(m_faces.size(), 0.0f);
|
||||
for (size_t iface = 0; iface < m_faces.size(); ++ iface)
|
||||
m_face_normal_z[iface] = m_faces[iface]->normal(2);
|
||||
std::sort(m_faces.begin(), m_faces.end(), [](const FaceZ &f1, const FaceZ &f2) { return f1.z_span < f2.z_span; });
|
||||
}
|
||||
|
||||
float SlicingAdaptive::cusp_height(float z, float cusp_value, int ¤t_facet)
|
||||
// current_facet is in/out parameter, rememebers the index of the last face of m_faces visited,
|
||||
// where this function will start from.
|
||||
// print_z - the top print surface of the previous layer.
|
||||
// returns height of the next layer.
|
||||
float SlicingAdaptive::next_layer_height(const float print_z, float quality_factor, size_t ¤t_facet)
|
||||
{
|
||||
float height = (float)m_slicing_params.max_layer_height;
|
||||
bool first_hit = false;
|
||||
float height = (float)m_slicing_params.max_layer_height;
|
||||
|
||||
float max_surface_deviation;
|
||||
|
||||
{
|
||||
#if 0
|
||||
// @platch's formula for quality:
|
||||
double delta_min = SURFACE_CONST * m_slicing_params.min_layer_height;
|
||||
double delta_mid = (SURFACE_CONST + 0.5) * m_slicing_params.layer_height;
|
||||
double delta_max = (SURFACE_CONST + 0.5) * m_slicing_params.max_layer_height;
|
||||
#else
|
||||
// Vojtech's formula for triangle area error metric.
|
||||
double delta_min = m_slicing_params.min_layer_height;
|
||||
double delta_mid = m_slicing_params.layer_height;
|
||||
double delta_max = m_slicing_params.max_layer_height;
|
||||
#endif
|
||||
max_surface_deviation = (quality_factor < 0.5f) ?
|
||||
lerp(delta_min, delta_mid, 2. * quality_factor) :
|
||||
lerp(delta_max, delta_mid, 2. * (1. - quality_factor));
|
||||
}
|
||||
|
||||
// find all facets intersecting the slice-layer
|
||||
int ordered_id = current_facet;
|
||||
for (; ordered_id < int(m_faces.size()); ++ ordered_id) {
|
||||
std::pair<float, float> zspan = face_z_span(m_faces[ordered_id]);
|
||||
// facet's minimum is higher than slice_z -> end loop
|
||||
if (zspan.first >= z)
|
||||
break;
|
||||
// facet's maximum is higher than slice_z -> store the first event for next cusp_height call to begin at this point
|
||||
if (zspan.second > z) {
|
||||
// first event?
|
||||
if (! first_hit) {
|
||||
first_hit = true;
|
||||
current_facet = ordered_id;
|
||||
}
|
||||
// skip touching facets which could otherwise cause small cusp values
|
||||
if (zspan.second <= z + EPSILON)
|
||||
continue;
|
||||
// compute cusp-height for this facet and store minimum of all heights
|
||||
float normal_z = m_face_normal_z[ordered_id];
|
||||
height = std::min(height, (normal_z == 0.0f) ? (float)m_slicing_params.max_layer_height : std::abs(cusp_value / normal_z));
|
||||
}
|
||||
size_t ordered_id = current_facet;
|
||||
{
|
||||
bool first_hit = false;
|
||||
for (; ordered_id < m_faces.size(); ++ ordered_id) {
|
||||
const std::pair<float, float> &zspan = m_faces[ordered_id].z_span;
|
||||
// facet's minimum is higher than slice_z -> end loop
|
||||
if (zspan.first >= print_z)
|
||||
break;
|
||||
// facet's maximum is higher than slice_z -> store the first event for next cusp_height call to begin at this point
|
||||
if (zspan.second > print_z) {
|
||||
// first event?
|
||||
if (! first_hit) {
|
||||
first_hit = true;
|
||||
current_facet = ordered_id;
|
||||
}
|
||||
// skip touching facets which could otherwise cause small cusp values
|
||||
if (zspan.second < print_z + EPSILON)
|
||||
continue;
|
||||
// compute cusp-height for this facet and store minimum of all heights
|
||||
height = std::min(height, layer_height_from_slope(m_faces[ordered_id], max_surface_deviation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// lower height limit due to printer capabilities
|
||||
height = std::max(height, float(m_slicing_params.min_layer_height));
|
||||
|
||||
// check for sloped facets inside the determined layer and correct height if necessary
|
||||
if (height > m_slicing_params.min_layer_height) {
|
||||
for (; ordered_id < int(m_faces.size()); ++ ordered_id) {
|
||||
std::pair<float, float> zspan = face_z_span(m_faces[ordered_id]);
|
||||
if (height > float(m_slicing_params.min_layer_height)) {
|
||||
for (; ordered_id < m_faces.size(); ++ ordered_id) {
|
||||
const std::pair<float, float> &zspan = m_faces[ordered_id].z_span;
|
||||
// facet's minimum is higher than slice_z + height -> end loop
|
||||
if (zspan.first >= z + height)
|
||||
if (zspan.first >= print_z + height)
|
||||
break;
|
||||
|
||||
// skip touching facets which could otherwise cause small cusp values
|
||||
if (zspan.second <= z + EPSILON)
|
||||
if (zspan.second < print_z + EPSILON)
|
||||
continue;
|
||||
|
||||
// Compute cusp-height for this facet and check against height.
|
||||
float normal_z = m_face_normal_z[ordered_id];
|
||||
float cusp = (normal_z == 0.0f) ? (float)m_slicing_params.max_layer_height : std::abs(cusp_value / normal_z);
|
||||
float reduced_height = layer_height_from_slope(m_faces[ordered_id], max_surface_deviation);
|
||||
|
||||
float z_diff = zspan.first - z;
|
||||
|
||||
// handle horizontal facets
|
||||
if (normal_z > 0.999f) {
|
||||
// Slic3r::debugf "cusp computation, height is reduced from %f", $height;
|
||||
float z_diff = zspan.first - print_z;
|
||||
if (reduced_height < z_diff) {
|
||||
assert(z_diff < height + EPSILON);
|
||||
// The currently visited triangle's slope limits the next layer height so much, that
|
||||
// the lowest point of the currently visible triangle is already above the newly proposed layer height.
|
||||
// This means, that we need to limit the layer height so that the offending newly visited triangle
|
||||
// is just above of the new layer.
|
||||
#ifdef ADAPTIVE_LAYER_HEIGHT_DEBUG
|
||||
BOOST_LOG_TRIVIAL(trace) << "cusp computation, height is reduced from " << height << "to " << z_diff << " due to z-diff";
|
||||
#endif /* ADAPTIVE_LAYER_HEIGHT_DEBUG */
|
||||
height = z_diff;
|
||||
// Slic3r::debugf "to %f due to near horizontal facet\n", $height;
|
||||
} else if (cusp > z_diff) {
|
||||
if (cusp < height) {
|
||||
// Slic3r::debugf "cusp computation, height is reduced from %f", $height;
|
||||
height = cusp;
|
||||
// Slic3r::debugf "to %f due to new cusp height\n", $height;
|
||||
}
|
||||
} else {
|
||||
// Slic3r::debugf "cusp computation, height is reduced from %f", $height;
|
||||
height = z_diff;
|
||||
// Slic3r::debugf "to z-diff: %f\n", $height;
|
||||
} else if (reduced_height < height) {
|
||||
#ifdef ADAPTIVE_LAYER_HEIGHT_DEBUG
|
||||
BOOST_LOG_TRIVIAL(trace) << "adaptive layer computation: height is reduced from " << height << "to " << reduced_height << " due to higher facet";
|
||||
#endif /* ADAPTIVE_LAYER_HEIGHT_DEBUG */
|
||||
height = reduced_height;
|
||||
}
|
||||
}
|
||||
// lower height limit due to printer capabilities again
|
||||
height = std::max(height, float(m_slicing_params.min_layer_height));
|
||||
}
|
||||
|
||||
// Slic3r::debugf "cusp computation, layer-bottom at z:%f, cusp_value:%f, resulting layer height:%f\n", unscale $z, $cusp_value, $height;
|
||||
#ifdef ADAPTIVE_LAYER_HEIGHT_DEBUG
|
||||
BOOST_LOG_TRIVIAL(trace) << "adaptive layer computation, layer-bottom at z:" << print_z << ", quality_factor:" << quality_factor << ", resulting layer height:" << height;
|
||||
#endif /* ADAPTIVE_LAYER_HEIGHT_DEBUG */
|
||||
return height;
|
||||
}
|
||||
|
||||
#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
// Returns the distance to the next horizontal facet in Z-dir
|
||||
// to consider horizontal object features in slice thickness
|
||||
float SlicingAdaptive::horizontal_facet_distance(float z)
|
||||
{
|
||||
for (size_t i = 0; i < m_faces.size(); ++ i) {
|
||||
std::pair<float, float> zspan = face_z_span(m_faces[i]);
|
||||
std::pair<float, float> zspan = m_faces[i].z_span;
|
||||
// facet's minimum is higher than max forward distance -> end loop
|
||||
if (zspan.first > z + m_slicing_params.max_layer_height)
|
||||
break;
|
||||
// min_z == max_z -> horizontal facet
|
||||
if ((zspan.first > z) && (zspan.first == zspan.second))
|
||||
if (zspan.first > z && zspan.first == zspan.second)
|
||||
return zspan.first - z;
|
||||
}
|
||||
|
||||
@ -158,6 +213,5 @@ float SlicingAdaptive::horizontal_facet_distance(float z)
|
||||
return (z + (float)m_slicing_params.max_layer_height > (float)m_slicing_params.object_print_z_height()) ?
|
||||
std::max((float)m_slicing_params.object_print_z_height() - z, 0.f) : (float)m_slicing_params.max_layer_height;
|
||||
}
|
||||
#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
|
||||
|
||||
}; // namespace Slic3r
|
||||
|