diff --git a/opennurbs/CMakeLists.txt b/opennurbs/CMakeLists.txt index 8ed332dc..6a3d9e95 100644 --- a/opennurbs/CMakeLists.txt +++ b/opennurbs/CMakeLists.txt @@ -31,33 +31,25 @@ if (ENABLE_OPENNURBS) ExternalProject_Add(OPENNURBS_BLD URL "${CMAKE_CURRENT_SOURCE_DIR}/opennurbs" BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} - PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_android_uuid.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_3dm_properties.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_archive.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_bounding_box.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_brep.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_brep_tools.patch + PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_android_uuid.patch + COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_brep_cpp.patch + COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_brep_h.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_cmake.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_defines.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_example_brep.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_example_gl.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_file_utilities.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_font.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_gl.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_light.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_locale.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_lock.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_lookup.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_material.patch + #COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_lock.patch + #COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_lookup.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_object_history.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_optimize.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_polyline.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_precompiledheader.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_statics.patch + #COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_statics.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_string.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_subd.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_system.patch + COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_system_runtime.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_version_number.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_x.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_zlib.patch diff --git a/opennurbs/opennurbs b/opennurbs/opennurbs index f3bc2095..048ac533 160000 --- a/opennurbs/opennurbs +++ b/opennurbs/opennurbs @@ -1 +1 @@ -Subproject commit f3bc2095dfcc62176a4c84f0614af2f3683d23ae +Subproject commit 048ac53376f982867cb1156ecb8619db395e2432 diff --git a/opennurbs/opennurbs.patch b/opennurbs/opennurbs.patch deleted file mode 100644 index 56f36fa1..00000000 --- a/opennurbs/opennurbs.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- opennurbs/opennurbs.h 2023-09-09 13:52:46.153646473 -0400 -+++ openNURBS/opennurbs.h 2023-09-09 13:43:33.708976388 -0400 -@@ -164,6 +164,8 @@ - #include "opennurbs_dimension.h" - #include "opennurbs_dimensionformat.h" // Formatting dimension measurements to strings - -+#include "opennurbs_x.h" // intersection events -+ - #include "opennurbs_photogrammetry.h" - - #include "opennurbs_extensions.h" diff --git a/opennurbs/opennurbs_3dm_properties.patch b/opennurbs/opennurbs_3dm_properties.patch deleted file mode 100644 index 5aa463e2..00000000 --- a/opennurbs/opennurbs_3dm_properties.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- opennurbs/opennurbs_3dm_properties.h 2023-09-09 13:52:46.153646473 -0400 -+++ openNURBS/opennurbs_3dm_properties.h 2023-09-09 13:43:33.708976388 -0400 -@@ -146,7 +146,7 @@ - { - public: - ON_3dmProperties() = default; -- ~ON_3dmProperties() = default;; -+ ~ON_3dmProperties() = default; - ON_3dmProperties(const ON_3dmProperties&) = default; - ON_3dmProperties& operator=(const ON_3dmProperties&) = default; - diff --git a/opennurbs/opennurbs_android_uuid.patch b/opennurbs/opennurbs_android_uuid.patch index 1a9676f3..4d9d504f 100644 --- a/opennurbs/opennurbs_android_uuid.patch +++ b/opennurbs/opennurbs_android_uuid.patch @@ -1,8 +1,9 @@ ---- opennurbs/android_uuid/COPYING 2023-09-09 13:52:46.069647659 -0400 -+++ openNURBS/android_uuid/COPYING 2023-09-09 13:43:33.732976101 -0400 +diff -Naur opennurbs/android_uuid/COPYING OPENNURBS_BLD/android_uuid/COPYING +--- opennurbs/android_uuid/COPYING 2023-12-20 11:22:46.198511306 -0500 ++++ OPENNURBS_BLD/android_uuid/COPYING 2023-12-20 10:56:56.954787994 -0500 @@ -1,3 +1,5 @@ -+Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. -+ - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: ++Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. ++ + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: diff --git a/opennurbs/opennurbs_archive.patch b/opennurbs/opennurbs_archive.patch deleted file mode 100644 index 0870c256..00000000 --- a/opennurbs/opennurbs_archive.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- opennurbs/opennurbs_archive.cpp 2023-09-09 13:52:46.153646473 -0400 -+++ openNURBS/opennurbs_archive.cpp 2023-09-09 13:43:33.712976340 -0400 -@@ -3032,7 +3032,7 @@ - bool ON_BinaryArchive::WriteBigSize(size_t sz) - { - ON__UINT64 u = (ON__UINT64)sz; -- return WriteInt64(1,(ON__INT64*)&u);; -+ return WriteInt64(1,(ON__INT64*)&u); - } - - bool ON_BinaryArchive::ReadBigSize( size_t* sz ) diff --git a/opennurbs/opennurbs_bounding_box.patch b/opennurbs/opennurbs_bounding_box.patch deleted file mode 100644 index 4eab395f..00000000 --- a/opennurbs/opennurbs_bounding_box.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- opennurbs/opennurbs_bounding_box.cpp 2023-09-09 13:52:46.153646473 -0400 -+++ openNURBS/opennurbs_bounding_box.cpp 2023-09-09 13:43:33.712976340 -0400 -@@ -529,7 +529,7 @@ - if ( x < -clip_plane_tolerance ) - out |= cpbit; - cpbit <<= 1; -- cpeqn++;; -+ cpeqn++; - } - } - some_out |= out; -@@ -593,7 +593,7 @@ - if ( x < -clip_plane_tolerance ) - out |= cpbit; - cpbit <<= 1; -- cpeqn++;; -+ cpeqn++; - } - } - some_out |= out; -@@ -657,7 +657,7 @@ - if ( x < -clip_plane_tolerance ) - out |= cpbit; - cpbit <<= 1; -- cpeqn++;; -+ cpeqn++; - } - } - some_out |= out; -@@ -743,7 +743,7 @@ - if ( x < -clip_plane_tolerance ) - out |= cpbit; - cpbit <<= 1; -- cpeqn++;; -+ cpeqn++; - } - } - w = xform[12]*cv[0] + xform[13]*cv[1] + xform[14]*cv[2] + xform[15]; -@@ -807,7 +807,7 @@ - if ( x < -clip_plane_tolerance ) - out |= cpbit; - cpbit <<= 1; -- cpeqn++;; -+ cpeqn++; - } - } - w = xform[12]*cv[0] + xform[13]*cv[1] + xform[14]*cv[2] + xform[15]; -@@ -1047,7 +1047,7 @@ - if ( x < -clip_plane_tolerance ) - out |= cpbit; - cpbit <<= 1; -- cpeqn++;; -+ cpeqn++; - } - } - w = xform[12]*cv[0] + xform[13]*cv[1] + xform[14]*cv[2] + xform[15]*cv[3]; -@@ -1112,7 +1112,7 @@ - if ( x < -clip_plane_tolerance ) - out |= cpbit; - cpbit <<= 1; -- cpeqn++;; -+ cpeqn++; - } - } - w = xform[12]*cv[0] + xform[13]*cv[1] + xform[14]*cv[2] + xform[15]*cv[3]; diff --git a/opennurbs/opennurbs_brep.patch b/opennurbs/opennurbs_brep.patch deleted file mode 100644 index def2d6bb..00000000 --- a/opennurbs/opennurbs_brep.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- opennurbs/opennurbs_brep.h 2023-09-09 13:52:46.157646417 -0400 -+++ openNURBS/opennurbs_brep.h 2023-09-09 13:43:33.712976340 -0400 -@@ -4092,6 +4092,7 @@ - ); - - // helpers for validation checking -+public: - bool IsValidTrim(int trim_index,ON_TextLog* text_log) const; - bool IsValidTrimTopology(int trim_index,ON_TextLog* text_log) const; - bool IsValidTrimGeometry(int trim_index,ON_TextLog* text_log) const; -@@ -4117,6 +4118,7 @@ - bool IsValidVertexGeometry(int vertex_index,ON_TextLog* text_log) const; - bool IsValidVertexTolerancesAndFlags(int vertex_index,ON_TextLog* text_log) const; - -+protected: - void SetTolsFromLegacyValues(); - - // read helpers to support various versions ---- opennurbs/opennurbs_brep.cpp 2023-09-09 13:52:46.157646417 -0400 -+++ openNURBS/opennurbs_brep.cpp 2023-09-09 13:43:33.712976340 -0400 -@@ -3464,6 +3464,10 @@ - } - } - -+ // BRL-CAD uses this for a tolerance check below -+ const ON_Surface *surf = loop.Face()->SurfaceOf(); -+ double urange = (surf) ? (surf->Domain(0)[1] - surf->Domain(0)[0]) : DBL_MAX; -+ double vrange = (surf) ? (surf->Domain(1)[1] - surf->Domain(1)[0]) : DBL_MAX; - - // make sure ends of trims jibe - int ci0, ci1, next_lti; -@@ -3492,6 +3496,12 @@ - // didn't get flagged as bad. - double xtol = (fabs(P0.x) + fabs(P1.x))*1.0e-10; - double ytol = (fabs(P0.y) + fabs(P1.y))*1.0e-10; -+ -+ // Oct 12 2009 Rather than using the above check, BRL-CAD uses -+ // relative uv size if it is available -+ xtol = (urange < DBL_MAX) ? urange * trim0.m_tolerance[0] : xtol; -+ ytol = (vrange < DBL_MAX) ? vrange * trim0.m_tolerance[1] : ytol; -+ - if ( xtol < ON_ZERO_TOLERANCE ) - xtol = ON_ZERO_TOLERANCE; - if ( ytol < ON_ZERO_TOLERANCE ) diff --git a/opennurbs/opennurbs_brep_cpp.patch b/opennurbs/opennurbs_brep_cpp.patch new file mode 100644 index 00000000..27ffc904 --- /dev/null +++ b/opennurbs/opennurbs_brep_cpp.patch @@ -0,0 +1,26 @@ +--- opennurbs/opennurbs_brep.cpp 2023-12-20 11:23:16.137987286 -0500 ++++ OPENNURBS_BLD/opennurbs_brep.cpp 2023-12-20 11:22:15.331051837 -0500 +@@ -3578,6 +3578,10 @@ + } + } + ++ // BRL-CAD uses this for a tolerance check below ++ const ON_Surface *surf = loop.Face()->SurfaceOf(); ++ double urange = (surf) ? (surf->Domain(0)[1] - surf->Domain(0)[0]) : DBL_MAX; ++ double vrange = (surf) ? (surf->Domain(1)[1] - surf->Domain(1)[0]) : DBL_MAX; + + // make sure ends of trims jibe + int ci0, ci1, next_lti; +@@ -3606,6 +3610,12 @@ + // didn't get flagged as bad. + double xtol = (fabs(P0.x) + fabs(P1.x))*1.0e-10; + double ytol = (fabs(P0.y) + fabs(P1.y))*1.0e-10; ++ ++ // Oct 12 2009 Rather than using the above check, BRL-CAD uses ++ // relative uv size if it is available ++ xtol = (urange < DBL_MAX) ? urange * trim0.m_tolerance[0] : xtol; ++ ytol = (vrange < DBL_MAX) ? vrange * trim0.m_tolerance[1] : ytol; ++ + if ( xtol < ON_ZERO_TOLERANCE ) + xtol = ON_ZERO_TOLERANCE; + if ( ytol < ON_ZERO_TOLERANCE ) diff --git a/opennurbs/opennurbs_brep_h.patch b/opennurbs/opennurbs_brep_h.patch new file mode 100644 index 00000000..4f1e9343 --- /dev/null +++ b/opennurbs/opennurbs_brep_h.patch @@ -0,0 +1,18 @@ +--- opennurbs/opennurbs_brep.h 2023-12-20 11:23:14.382018010 -0500 ++++ OPENNURBS_BLD/opennurbs_brep.h 2023-12-20 11:22:19.090985982 -0500 +@@ -4141,6 +4141,7 @@ + ); + + // helpers for validation checking ++public: + bool IsValidTrim(int trim_index,ON_TextLog* text_log) const; + bool IsValidTrimTopology(int trim_index,ON_TextLog* text_log) const; + bool IsValidTrimGeometry(int trim_index,ON_TextLog* text_log) const; +@@ -4166,6 +4167,7 @@ + bool IsValidVertexGeometry(int vertex_index,ON_TextLog* text_log) const; + bool IsValidVertexTolerancesAndFlags(int vertex_index,ON_TextLog* text_log) const; + ++protected: + void SetTolsFromLegacyValues(); + + // read helpers to support various versions diff --git a/opennurbs/opennurbs_brep_tools.patch b/opennurbs/opennurbs_brep_tools.patch deleted file mode 100644 index 77f01d5b..00000000 --- a/opennurbs/opennurbs_brep_tools.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- opennurbs/opennurbs_brep_tools.cpp 2023-09-09 13:52:46.157646417 -0400 -+++ openNURBS/opennurbs_brep_tools.cpp 2023-09-09 13:43:33.712976340 -0400 -@@ -301,7 +301,7 @@ - bool ON_Brep::SetTrimBoundingBoxes( ON_BrepFace& face, bool bLazy ) - { - bool rc = true; -- int li, fli, loop_count = m_L.Count(), fl_count = face.m_li.Count();; -+ int li, fli, loop_count = m_L.Count(), fl_count = face.m_li.Count(); - for ( fli = 0; fli < fl_count; fli++ ) - { - li = face.m_li[fli]; diff --git a/opennurbs/opennurbs_cmake.patch b/opennurbs/opennurbs_cmake.patch index 0fbb08d7..27c54ed6 100644 --- a/opennurbs/opennurbs_cmake.patch +++ b/opennurbs/opennurbs_cmake.patch @@ -1,6 +1,134 @@ ---- opennurbs/CMakeLists.txt 1969-12-31 19:00:00.000000000 -0500 -+++ openNURBS/CMakeLists.txt 2023-09-09 14:42:54.568970568 -0400 -@@ -0,0 +1,597 @@ +diff -Naur opennurbs/CMake/FindZLIB.cmake openNURBS/CMake/FindZLIB.cmake +--- opennurbs/CMake/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500 ++++ openNURBS/CMake/FindZLIB.cmake 2023-09-09 14:43:08.576725794 -0400 +@@ -0,0 +1,123 @@ ++#.rst: ++# FindZLIB ++# -------- ++# ++# Find the native ZLIB includes and library. ++# ++# IMPORTED Targets ++# ^^^^^^^^^^^^^^^^ ++# ++# This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if ++# ZLIB has been found. ++# ++# Result Variables ++# ^^^^^^^^^^^^^^^^ ++# ++# This module defines the following variables: ++# ++# :: ++# ++# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc. ++# ZLIB_LIBRARIES - List of libraries when using zlib. ++# ZLIB_FOUND - True if zlib found. ++# ++# :: ++# ++# ZLIB_VERSION_STRING - The version of zlib found (x.y.z) ++# ZLIB_VERSION_MAJOR - The major version of zlib ++# ZLIB_VERSION_MINOR - The minor version of zlib ++# ZLIB_VERSION_PATCH - The patch version of zlib ++# ZLIB_VERSION_TWEAK - The tweak version of zlib ++# ++# Backward Compatibility ++# ^^^^^^^^^^^^^^^^^^^^^^ ++# ++# The following variable are provided for backward compatibility ++# ++# :: ++# ++# ZLIB_MAJOR_VERSION - The major version of zlib ++# ZLIB_MINOR_VERSION - The minor version of zlib ++# ZLIB_PATCH_VERSION - The patch version of zlib ++# ++# Hints ++# ^^^^^ ++# ++# A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this ++# module where to look. ++ ++#============================================================================= ++# Copyright 2001-2011 Kitware, Inc. ++# ++# Distributed under the OSI-approved BSD License (the "License"); ++# see accompanying file Copyright.txt for details. ++# ++# This software is distributed WITHOUT ANY WARRANTY; without even the ++# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++# See the License for more information. ++#============================================================================= ++# (To distribute this file outside of CMake, substitute the full ++# License text for the above reference.) ++ ++set(_ZLIB_SEARCHES) ++ ++# Search ZLIB_ROOT first if it is set. ++if(ZLIB_ROOT) ++ set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH) ++ list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT) ++endif() ++ ++# Normal search. ++set(_ZLIB_SEARCH_NORMAL ++ PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]" ++ "$ENV{PROGRAMFILES}/zlib" ++ ) ++list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL) ++ ++set(ZLIB_NAMES z_brl z zlib zdll zlib1 zlibd zlibd1) ++ ++# Try each search configuration. ++foreach(search ${_ZLIB_SEARCHES}) ++ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include) ++ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib) ++endforeach() ++ ++mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) ++ ++if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") ++ file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$") ++ ++ string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}") ++ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}") ++ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}") ++ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}") ++ ++ # only append a TWEAK version if it exists: ++ set(ZLIB_VERSION_TWEAK "") ++ if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)") ++ set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}") ++ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}") ++ endif() ++ ++ set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") ++ set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}") ++ set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}") ++endif() ++ ++# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if ++# all listed variables are TRUE ++include(FindPackageHandleStandardArgs) ++FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR ++ VERSION_VAR ZLIB_VERSION_STRING) ++ ++if(ZLIB_FOUND) ++ set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) ++ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) ++ ++ if(NOT TARGET ZLIB::ZLIB) ++ add_library(ZLIB::ZLIB UNKNOWN IMPORTED) ++ set_target_properties(ZLIB::ZLIB PROPERTIES ++ IMPORTED_LOCATION "${ZLIB_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") ++ endif() ++endif() + +--- opennurbs/CMakeLists.txt 2023-12-20 11:49:47.820542362 -0500 ++++ OPENNURBS_BLD/CMakeLists.txt 2023-12-20 12:01:48.676514655 -0500 +@@ -1,3 +1,628 @@ +# Note: License below is for CMake build logic of openNURBS. For license of +# primary openNURBS source code, see license.txt file +# @@ -111,6 +239,7 @@ + opennurbs_apple_nsfont.cpp + opennurbs_arc.cpp + opennurbs_arccurve.cpp ++ opennurbs_archivable_dictionary.cpp + opennurbs_archive.cpp + opennurbs_archive_manifest.cpp + opennurbs_array.cpp @@ -142,11 +271,13 @@ + opennurbs_curveproxy.cpp + opennurbs_cylinder.cpp + opennurbs_date.cpp ++ opennurbs_decals.cpp + opennurbs_defines.cpp + opennurbs_detail.cpp + opennurbs_dimension.cpp + opennurbs_dimensionformat.cpp + opennurbs_dimensionstyle.cpp ++ opennurbs_dithering.cpp + opennurbs_dll.cpp + opennurbs_ellipse.cpp + opennurbs_embedded_file.cpp @@ -161,6 +292,7 @@ + opennurbs_function_list.cpp + opennurbs_geometry.cpp + opennurbs_glyph_outline.cpp ++ opennurbs_ground_plane.cpp + opennurbs_group.cpp + opennurbs_hash_table.cpp + opennurbs_hatch.cpp @@ -175,6 +307,7 @@ + opennurbs_layer.cpp + opennurbs_leader.cpp + opennurbs_light.cpp ++ opennurbs_linear_workflow.cpp + opennurbs_line.cpp + opennurbs_linecurve.cpp + opennurbs_linetype.cpp @@ -187,6 +320,7 @@ + opennurbs_md5.cpp + opennurbs_memory_util.cpp + opennurbs_mesh.cpp ++ opennurbs_mesh_modifiers.cpp + opennurbs_mesh_ngon.cpp + opennurbs_mesh_tools.cpp + opennurbs_mesh_topology.cpp @@ -218,13 +352,19 @@ + opennurbs_polyedgecurve.cpp + opennurbs_polyline.cpp + opennurbs_polylinecurve.cpp ++ opennurbs_post_effects.cpp + opennurbs_progress_reporter.cpp + opennurbs_public_memory.cpp + opennurbs_quaternion.cpp + opennurbs_rand.cpp ++ opennurbs_render_channels.cpp ++ opennurbs_render_content.cpp + opennurbs_revsurface.cpp + opennurbs_rtree.cpp ++ opennurbs_safe_frame.cpp ++ opennurbs_sectionstyle.cpp + opennurbs_sha1.cpp ++ opennurbs_skylight.cpp + opennurbs_sleeplock.cpp + opennurbs_sort.cpp + opennurbs_sphere.cpp @@ -254,6 +394,7 @@ + opennurbs_subd_texture.cpp + opennurbs_sum.cpp + opennurbs_sumsurface.cpp ++ opennurbs_sun.cpp + opennurbs_surface.cpp + opennurbs_surfaceproxy.cpp + opennurbs_symmetry.cpp @@ -285,6 +426,7 @@ + opennurbs_workspace.cpp + opennurbs_wstring.cpp + opennurbs_xform.cpp ++ opennurbs_xml.cpp + opennurbs_zlib.cpp + ) + @@ -320,10 +462,10 @@ + opennurbs_apple_nsfont.h + opennurbs_arccurve.h + opennurbs_arc.h ++ opennurbs_archivable_dictionary.h + opennurbs_archive.h + opennurbs_array_defs.h + opennurbs_array.h -+ opennurbs_atomic_op.h + opennurbs_base32.h + opennurbs_base64.h + opennurbs_beam.h @@ -345,13 +487,16 @@ + opennurbs_curveproxy.h + opennurbs_cylinder.h + opennurbs_date.h ++ opennurbs_decals.h + opennurbs_defines.h + opennurbs_detail.h + opennurbs_dimensionformat.h + opennurbs_dimension.h + opennurbs_dimensionstyle.h ++ opennurbs_dithering.h + opennurbs_dll_resource.h + opennurbs_ellipse.h ++ opennurbs_embedded_file.h + opennurbs_error.h + opennurbs_evaluate_nurbs.h + opennurbs_extensions.h @@ -365,6 +510,7 @@ + opennurbs_function_list.h + opennurbs_geometry.h + opennurbs_gl.h ++ opennurbs_ground_plane.h + opennurbs_group.h + opennurbs.h + opennurbs_hash_table.h @@ -384,6 +530,7 @@ + opennurbs_layer.h + opennurbs_leader.h + opennurbs_light.h ++ opennurbs_linear_workflow.h + opennurbs_linecurve.h + opennurbs_line.h + opennurbs_linestyle.h @@ -398,6 +545,7 @@ + opennurbs_md5.h + opennurbs_memory.h + opennurbs_mesh.h ++ opennurbs_mesh_modifiers.h + opennurbs_model_component.h + opennurbs_model_geometry.h + opennurbs_nurbscurve.h @@ -420,6 +568,7 @@ + opennurbs_polyedgecurve.h + opennurbs_polylinecurve.h + opennurbs_polyline.h ++ opennurbs_post_effects.h + opennurbs_private_wrap_defs.h + opennurbs_private_wrap.h + opennurbs_progress_reporter.h @@ -430,10 +579,15 @@ + opennurbs_quacksort_template.h + opennurbs_quaternion.h + opennurbs_rand.h ++ opennurbs_render_channels.h ++ opennurbs_render_content.h + opennurbs_rendering.h + opennurbs_revsurface.h + opennurbs_rtree.h ++ opennurbs_safe_frame.h ++ opennurbs_sectionstyle.h + opennurbs_sha1.h ++ opennurbs_skylight.h + opennurbs_sleeplock.h + opennurbs_sphere.h + opennurbs_std_string.h @@ -442,6 +596,7 @@ + opennurbs_subd_data.h + opennurbs_subd.h + opennurbs_sumsurface.h ++ opennurbs_sun.h + opennurbs_surface.h + opennurbs_surfaceproxy.h + opennurbs_symmetry.h @@ -475,6 +630,7 @@ + opennurbs_workspace.h + opennurbs_x.h + opennurbs_xform.h ++ opennurbs_xml.h + opennurbs_zlib.h + ) + @@ -598,130 +754,6 @@ +# End: +# ex: shiftwidth=2 tabstop=8 + -diff -Naur opennurbs/CMake/FindZLIB.cmake openNURBS/CMake/FindZLIB.cmake ---- opennurbs/CMake/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500 -+++ openNURBS/CMake/FindZLIB.cmake 2023-09-09 14:43:08.576725794 -0400 -@@ -0,0 +1,123 @@ -+#.rst: -+# FindZLIB -+# -------- -+# -+# Find the native ZLIB includes and library. -+# -+# IMPORTED Targets -+# ^^^^^^^^^^^^^^^^ -+# -+# This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if -+# ZLIB has been found. -+# -+# Result Variables -+# ^^^^^^^^^^^^^^^^ -+# -+# This module defines the following variables: -+# -+# :: -+# -+# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc. -+# ZLIB_LIBRARIES - List of libraries when using zlib. -+# ZLIB_FOUND - True if zlib found. -+# -+# :: -+# -+# ZLIB_VERSION_STRING - The version of zlib found (x.y.z) -+# ZLIB_VERSION_MAJOR - The major version of zlib -+# ZLIB_VERSION_MINOR - The minor version of zlib -+# ZLIB_VERSION_PATCH - The patch version of zlib -+# ZLIB_VERSION_TWEAK - The tweak version of zlib -+# -+# Backward Compatibility -+# ^^^^^^^^^^^^^^^^^^^^^^ -+# -+# The following variable are provided for backward compatibility -+# -+# :: -+# -+# ZLIB_MAJOR_VERSION - The major version of zlib -+# ZLIB_MINOR_VERSION - The minor version of zlib -+# ZLIB_PATCH_VERSION - The patch version of zlib -+# -+# Hints -+# ^^^^^ -+# -+# A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this -+# module where to look. -+ -+#============================================================================= -+# Copyright 2001-2011 Kitware, Inc. -+# -+# Distributed under the OSI-approved BSD License (the "License"); -+# see accompanying file Copyright.txt for details. -+# -+# This software is distributed WITHOUT ANY WARRANTY; without even the -+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -+# See the License for more information. -+#============================================================================= -+# (To distribute this file outside of CMake, substitute the full -+# License text for the above reference.) -+ -+set(_ZLIB_SEARCHES) -+ -+# Search ZLIB_ROOT first if it is set. -+if(ZLIB_ROOT) -+ set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH) -+ list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT) -+endif() -+ -+# Normal search. -+set(_ZLIB_SEARCH_NORMAL -+ PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]" -+ "$ENV{PROGRAMFILES}/zlib" -+ ) -+list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL) -+ -+set(ZLIB_NAMES z_brl z zlib zdll zlib1 zlibd zlibd1) -+ -+# Try each search configuration. -+foreach(search ${_ZLIB_SEARCHES}) -+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include) -+ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib) -+endforeach() -+ -+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) -+ -+if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") -+ file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$") -+ -+ string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}") -+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}") -+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}") -+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}") -+ -+ # only append a TWEAK version if it exists: -+ set(ZLIB_VERSION_TWEAK "") -+ if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)") -+ set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}") -+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}") -+ endif() -+ -+ set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") -+ set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}") -+ set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}") -+endif() -+ -+# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if -+# all listed variables are TRUE -+include(FindPackageHandleStandardArgs) -+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR -+ VERSION_VAR ZLIB_VERSION_STRING) -+ -+if(ZLIB_FOUND) -+ set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) -+ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) -+ -+ if(NOT TARGET ZLIB::ZLIB) -+ add_library(ZLIB::ZLIB UNKNOWN IMPORTED) -+ set_target_properties(ZLIB::ZLIB PROPERTIES -+ IMPORTED_LOCATION "${ZLIB_LIBRARY}" -+ INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") -+ endif() -+endif() + cmake_minimum_required (VERSION 3.16) + #set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)") + project(opennurbs CXX) diff --git a/opennurbs/opennurbs_defines.patch b/opennurbs/opennurbs_defines.patch index c47e701c..bff4896d 100644 --- a/opennurbs/opennurbs_defines.patch +++ b/opennurbs/opennurbs_defines.patch @@ -30,14 +30,14 @@ { invalid_type = 0, ---- opennurbs/opennurbs_defines.cpp 2023-11-28 19:23:49.946781764 -0500 -+++ openNURBS/opennurbs_defines.cpp 2023-11-29 08:25:09.111366198 -0500 -@@ -502,7 +502,7 @@ - //#error TODO - call clang fcloseall() - //fcloseall is not supported on OS X +--- opennurbs/opennurbs_defines.cpp 2023-12-20 11:34:58.307139050 -0500 ++++ OPENNURBS_BLD/opennurbs_defines.cpp 2023-12-20 11:36:16.497896519 -0500 +@@ -498,7 +498,7 @@ + #elif defined(ON_RUNTIME_APPLE) || defined(ON_RUNTIME_ANDROID) + //fcloseall is not supported on mac/ios or android return EOF; --#elif defined(ON_COMPILER_GNU) +-#else +#elif defined(ON_COMPILER_GNU) && defined(__GLIBC__) - fcloseall(); - #else - // I can't find an fcloseall() or _fcloseall() in + return fcloseall(); + #endif + } diff --git a/opennurbs/opennurbs_font.patch b/opennurbs/opennurbs_font.patch index d7482b4d..0a15f3a8 100644 --- a/opennurbs/opennurbs_font.patch +++ b/opennurbs/opennurbs_font.patch @@ -1,6 +1,6 @@ ---- opennurbs/opennurbs_font.cpp 2023-09-09 13:52:46.157646417 -0400 -+++ openNURBS/opennurbs_font.cpp 2023-09-09 13:43:33.716976293 -0400 -@@ -8852,7 +8852,7 @@ +--- opennurbs/opennurbs_font.cpp 2023-12-20 11:23:16.153987006 -0500 ++++ OPENNURBS_BLD/opennurbs_font.cpp 2023-12-20 11:22:15.347051556 -0500 +@@ -8936,7 +8936,7 @@ const wchar_t* prev_clean_family_name = nullptr; for (size_t i = 0; i < installed_count; i++) { @@ -9,7 +9,7 @@ const ON_Font* font = installed_fonts[(int)i]; #else const ON_Font* font = installed_fonts[i]; -@@ -8915,7 +8915,7 @@ +@@ -8999,7 +8999,7 @@ InternalHashToName candidate; for (size_t i = 0; i < count0; i++) { @@ -18,12 +18,3 @@ InternalHashToName e = a[(int)i]; #else InternalHashToName e = a[i]; -@@ -9642,7 +9642,7 @@ - - void ON_Font::Dump(ON_TextLog& dump) const - { -- const bool bTextHash = dump.IsTextHash();; -+ const bool bTextHash = dump.IsTextHash(); - - ON_wString s; - diff --git a/opennurbs/opennurbs_gl.patch b/opennurbs/opennurbs_gl.patch deleted file mode 100644 index 33fa595e..00000000 --- a/opennurbs/opennurbs_gl.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- opennurbs/opennurbs_gl.cpp 2023-09-09 13:52:46.157646417 -0400 -+++ openNURBS/opennurbs_gl.cpp 2023-09-09 13:43:33.716976293 -0400 -@@ -600,7 +600,7 @@ - ON_GL( pMat->Diffuse(), alpha, diffuse ); - ON_GL( pMat->Specular(), alpha, specular ); - ON_GL( pMat->Emission(), alpha, emission ); -- GLint shine = (GLint)(128.0*(pMat->Shine() / ON_Material::MaxShine())); -+ GLint shine = (GLint)(128.0*(pMat->Shine() / ON_Material::MaxShine)); - if ( shine == 0 ) { - specular[0]=specular[1]=specular[2]=(GLfloat)0.0; - } diff --git a/opennurbs/opennurbs_light.patch b/opennurbs/opennurbs_light.patch deleted file mode 100644 index 124be99e..00000000 --- a/opennurbs/opennurbs_light.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- opennurbs/opennurbs_light.cpp 2023-09-09 13:52:46.161646361 -0400 -+++ openNURBS/opennurbs_light.cpp 2023-09-09 13:43:33.720976246 -0400 -@@ -499,7 +499,7 @@ - - void ON_Light::SetAttenuation(double a,double b,double c) - { -- m_attenuation = ON_3dVector(a,b,c);; -+ m_attenuation = ON_3dVector(a,b,c); - } - - void ON_Light::SetAttenuation(const ON_3dVector& att ) -@@ -709,7 +709,7 @@ - - void ON_Light::SetSpecular( ON_Color c ) - { -- m_specular = c;; -+ m_specular = c; - } - - ON_Color ON_Light::Ambient() const diff --git a/opennurbs/opennurbs_material.patch b/opennurbs/opennurbs_material.patch deleted file mode 100644 index cfa7b7ed..00000000 --- a/opennurbs/opennurbs_material.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- opennurbs/opennurbs_material.cpp 2023-09-09 13:52:46.161646361 -0400 -+++ openNURBS/opennurbs_material.cpp 2023-09-09 13:43:33.720976246 -0400 -@@ -5159,7 +5159,7 @@ - // map and clamp the tcs that hang over. If the mesh - // has edges near the texture seam, the picture will - // still look ok. -- float f0=0.0f, f1=0.0f, twopitc = (float)two_pi_tc;; -+ float f0=0.0f, f1=0.0f, twopitc = (float)two_pi_tc; - //int f0cnt=0, f1cnt=0; - if ( 1 == ftc.quad[0] ) f0 += ftc.Tx[0]; else if ( 4 == ftc.quad[0] ) f1 += twopitc-ftc.Tx[0]; - if ( 1 == ftc.quad[1] ) f0 += ftc.Tx[1]; else if ( 4 == ftc.quad[1] ) f1 += twopitc-ftc.Tx[1]; diff --git a/opennurbs/opennurbs_subd.patch b/opennurbs/opennurbs_subd.patch deleted file mode 100644 index e3eaf573..00000000 --- a/opennurbs/opennurbs_subd.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- opennurbs/opennurbs_subd.cpp 2023-09-09 13:52:46.165646304 -0400 -+++ openNURBS/opennurbs_subd.cpp 2023-09-09 13:43:33.724976199 -0400 -@@ -14072,7 +14072,7 @@ - if (i < 4) - face->m_edge4[i] = ON_SubDEdgePtr::Null; - else -- face->m_edgex[i - 4] = ON_SubDEdgePtr::Null;; -+ face->m_edgex[i - 4] = ON_SubDEdgePtr::Null; - ON_SubDEdge* e = ON_SUBD_EDGE_POINTER(edges[i].m_ptr); - e->RemoveFaceFromArray(face); - const_cast(edges[i].RelativeVertex(0))->RemoveFaceFromArray(face); diff --git a/opennurbs/opennurbs_system.patch b/opennurbs/opennurbs_system.patch deleted file mode 100644 index d36860e7..00000000 --- a/opennurbs/opennurbs_system.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- opennurbs/opennurbs_system.h 2023-09-09 13:52:46.169646248 -0400 -+++ openNURBS/opennurbs_system.h 2023-09-09 13:43:33.716976293 -0400 -@@ -383,7 +383,7 @@ - */ - - --#if defined(_M_X64) && defined(WIN32) && defined(WIN64) -+#if (defined(_M_X64) || defined(_M_ARM64)) && defined(WIN32) && defined(WIN64) - // 23 August 2007 Dale Lear - - #if defined(_INC_WINDOWS) -@@ -406,7 +406,7 @@ - #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE - #endif - --#if defined(_M_X64) && defined(WIN32) && defined(WIN64) -+#if (defined(_M_X64) || defined(_M_ARM64)) && defined(WIN32) && defined(WIN64) - // 23 August 2007 Dale Lear - // windows.h unconditionally defines WIN32 This is a bug - // and the hope is this simple undef will let us continue. -@@ -540,8 +540,10 @@ - #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE - - #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - #include "android_uuid/uuid.h" -+#elif defined(ON_RUNTIME_WIN) -+#include - #else - #include - #endif ---- opennurbs/opennurbs_system_runtime.h 2023-09-09 13:52:46.169646248 -0400 -+++ openNURBS/opennurbs_system_runtime.h 2023-09-09 13:43:33.724976199 -0400 -@@ -60,6 +60,11 @@ - #define ON_RUNTIME_LINUX - #endif - -+#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) -+#if !defined(ON_RUNTIME_BSD) -+#define ON_RUNTIME_BSD -+#endif -+ - #endif - /* - // -@@ -137,7 +142,7 @@ - #define ON_RUNTIME_WIN_WINOS - #endif - --#if defined(_M_X64) || defined(_WIN64) -+#if defined(_M_X64) || defined(_M_ARM64) || defined(_WIN64) - #define ON_64BIT_RUNTIME - #elif defined(_M_X86) || defined(_WIN32) - #define ON_32BIT_RUNTIME -@@ -146,7 +151,7 @@ - #endif - - #if !defined(ON_LITTLE_ENDIAN) --#if (defined(_M_X64) || defined(_M_IX86) || defined (__i386__) || defined( __x86_64__ )) -+#if (defined(_M_X64) || defined(_M_ARM64) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(__x86_64)) - #define ON_LITTLE_ENDIAN - #endif - #endif -@@ -157,9 +162,9 @@ - #define ON_SIZEOF_WCHAR_T 4 - #endif - --#elif defined(ON_RUNTIME_LINUX) -+#elif defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - --#if defined(__x86_64__) -+#if defined(__x86_64__) || defined(__x86_64) - #define ON_64BIT_RUNTIME - #else - #define ON_32BIT_RUNTIME -@@ -171,7 +176,7 @@ - #endif - - #if !defined(ON_LITTLE_ENDIAN) --#if defined( __x86_64__ ) -+#if defined( __x86_64__ ) || defined(__x86_64) - #define ON_LITTLE_ENDIAN - #endif - #endif diff --git a/opennurbs/opennurbs_system_runtime.patch b/opennurbs/opennurbs_system_runtime.patch new file mode 100644 index 00000000..cfe7b267 --- /dev/null +++ b/opennurbs/opennurbs_system_runtime.patch @@ -0,0 +1,41 @@ +--- opennurbs/opennurbs_system_runtime.h 2023-12-20 11:23:14.426017242 -0500 ++++ OPENNURBS_BLD/opennurbs_system_runtime.h 2023-12-20 11:22:19.138985139 -0500 +@@ -56,6 +56,11 @@ + #define ON_RUNTIME_LINUX + #endif + ++#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) ++#if !defined(ON_RUNTIME_BSD) ++#define ON_RUNTIME_BSD ++#endif ++ + #endif + /* + // +@@ -127,7 +132,7 @@ + #define ON_RUNTIME_WIN_WINOS + #endif + +-#if defined(_M_X64) || defined(_WIN64) ++#if defined(_M_X64) || defined(_M_ARM64) || defined(_WIN64) + #define ON_64BIT_RUNTIME + #elif defined(_M_X86) || defined(_WIN32) + #define ON_32BIT_RUNTIME +@@ -136,7 +141,7 @@ + #endif + + #if !defined(ON_LITTLE_ENDIAN) +-#if (defined(_M_X64) || defined(_M_IX86) || defined (__i386__) || defined( __x86_64__ )) ++#if (defined(_M_X64) || defined(_M_ARM64) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(__x86_64)) + #define ON_LITTLE_ENDIAN + #endif + #endif +@@ -146,7 +151,7 @@ + #define ON_RUNTIME_LINUX + #endif + +-#if defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_LINUX) || defined (ON_RUNTIME_BSD) + + #if !defined(ON_SIZEOF_WCHAR_T) + #define ON_SIZEOF_WCHAR_T 4 diff --git a/opennurbs/opennurbs_x.patch b/opennurbs/opennurbs_x.patch index bd5a0d8e..ae2edd27 100644 --- a/opennurbs/opennurbs_x.patch +++ b/opennurbs/opennurbs_x.patch @@ -1656,3 +1656,13 @@ +}; + +#endif +--- opennurbs/opennurbs.h 2023-12-20 11:23:14.394017801 -0500 ++++ OPENNURBS_BLD/opennurbs.h 2023-12-20 11:22:19.102985771 -0500 +@@ -182,6 +182,7 @@ + #include "opennurbs_extensions.h" + #include "opennurbs_freetype.h" + ++#include "opennurbs_x.h" // intersection events + + #endif + diff --git a/opennurbs/opennurbs_zlib.patch b/opennurbs/opennurbs_zlib.patch index d612e19b..b7ac1e92 100644 --- a/opennurbs/opennurbs_zlib.patch +++ b/opennurbs/opennurbs_zlib.patch @@ -1,109 +1,3 @@ ---- opennurbs/opennurbs_zlib.cpp 2023-09-09 13:52:46.173646192 -0400 -+++ openNURBS/opennurbs_zlib.cpp 2023-09-09 13:43:33.716976293 -0400 -@@ -26,6 +26,7 @@ - - #include "opennurbs_zlib.h" - -+#if 0 - #if defined(ON_COMPILER_MSC) - - #if !defined(OPENNURBS_ZLIB_LIB_DIR) -@@ -42,7 +43,6 @@ - - #endif - -- - #if defined(_LIB) && defined(_MT) && !defined(_DLL) - // using Microsoft statically linked C-runtime - #pragma message ( "Linking with zlib_mt.lib in " OPENNURBS_PP2STR(OPENNURBS_ZLIB_LIB_DIR) ) -@@ -55,6 +55,8 @@ - - #endif - -+#endif -+ - // compressed buffer I/O uses zlib 1.1.3 inflate()/deflate() - class ON_CompressorImplementation - { -@@ -313,11 +315,11 @@ - // no uncompressed input is left - switch to finish mode - flush = Z_FINISH; - } -- zrc = z_deflate(&m_zlib.m_strm, flush); -+ zrc = deflate(&m_zlib.m_strm, flush); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -- ON_ERROR("ON_BinaryArchive::WriteDeflate - z_deflate failure"); -+ ON_ERROR("ON_BinaryArchive::WriteDeflate - deflate failure"); - rc = false; - break; - } -@@ -513,11 +515,11 @@ - // no compressed input is left - switch to finish mode - flush = Z_FINISH; - } -- zrc = z_inflate( &m_zlib.m_strm, flush ); -+ zrc = inflate( &m_zlib.m_strm, flush ); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -- ON_ERROR("ON_BinaryArchive::ReadInflate - z_inflate failure"); -+ ON_ERROR("ON_BinaryArchive::ReadInflate - inflate failure"); - rc = false; - break; - } -@@ -1183,11 +1185,11 @@ - // no uncompressed input is left - switch to finish mode - flush = Z_FINISH; - } -- zrc = z_deflate( &m_zlib.m_strm, flush ); -+ zrc = deflate( &m_zlib.m_strm, flush ); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -- ON_ERROR("ON_CompressedBuffer::DeflateHelper - z_deflate failure"); -+ ON_ERROR("ON_CompressedBuffer::DeflateHelper - deflate failure"); - rc = false; - break; - } -@@ -1316,11 +1318,11 @@ - // no compressed input is left - switch to finish mode - flush = Z_FINISH; - } -- zrc = z_inflate( &m_zlib.m_strm, flush ); -+ zrc = inflate( &m_zlib.m_strm, flush ); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -- ON_ERROR("ON_CompressedBuffer::InflateHelper - z_inflate failure"); -+ ON_ERROR("ON_CompressedBuffer::InflateHelper - inflate failure"); - rc = false; - break; - } ---- opennurbs/opennurbs_zlib.h 2023-09-09 13:52:46.173646192 -0400 -+++ openNURBS/opennurbs_zlib.h 2023-09-09 13:43:33.716976293 -0400 -@@ -28,19 +28,13 @@ - // and statically link with the zlib library. All the necessary - // header files are included by opennurbs.h. - -- --#if !defined(Z_PREFIX) --/* decorates zlib functions with a "z_" prefix to prevent symbol collision. */ --#define Z_PREFIX --#endif -- - #if !defined(MY_ZCALLOC) - /* have zlib use oncalloc() and onfree() for memory managment*/ - #define MY_ZCALLOC - #endif - - #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE --#include "./zlib/zlib.h" -+#include "zlib.h" - #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE - - ON_BEGIN_EXTERNC --- opennurbs/opennurbs_compress.cpp 2023-09-09 13:52:46.157646417 -0400 +++ openNURBS/opennurbs_compress.cpp 2023-09-09 13:43:33.712976340 -0400 @@ -131,7 +131,7 @@ @@ -188,3 +82,97 @@ if ( zrc < 0 ) { // Something went haywire - bail out. +--- opennurbs/opennurbs_zlib.cpp 2023-12-20 11:23:16.233985604 -0500 ++++ OPENNURBS_BLD/opennurbs_zlib.cpp 2023-12-20 11:22:15.431050084 -0500 +@@ -23,6 +23,7 @@ + + #include "opennurbs_zlib.h" + ++#if 0 + #if defined(ON_COMPILER_MSC) && !defined(ON_CMAKE_BUILD) + + #if !defined(OPENNURBS_ZLIB_LIB_DIR) +@@ -39,7 +40,6 @@ + + #endif + +- + #if defined(_LIB) && defined(_MT) && !defined(_DLL) + // using Microsoft statically linked C-runtime + #pragma message ( "Linking with zlib_mt.lib in " OPENNURBS_PP2STR(OPENNURBS_ZLIB_LIB_DIR) ) +@@ -52,6 +52,8 @@ + + #endif + ++#endif ++ + // compressed buffer I/O uses zlib 1.1.3 inflate()/deflate() + class ON_CompressorImplementation + { +@@ -319,11 +321,11 @@ + // no uncompressed input is left - switch to finish mode + flush = Z_FINISH; + } +- zrc = z_deflate(&m_zlib.m_strm, flush); ++ zrc = deflate(&m_zlib.m_strm, flush); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +- ON_ERROR("ON_BinaryArchive::WriteDeflate - z_deflate failure"); ++ ON_ERROR("ON_BinaryArchive::WriteDeflate - deflate failure"); + rc = false; + break; + } +@@ -519,11 +521,11 @@ + // no compressed input is left - switch to finish mode + flush = Z_FINISH; + } +- zrc = z_inflate( &m_zlib.m_strm, flush ); ++ zrc = inflate( &m_zlib.m_strm, flush ); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +- ON_ERROR("ON_BinaryArchive::ReadInflate - z_inflate failure"); ++ ON_ERROR("ON_BinaryArchive::ReadInflate - inflate failure"); + rc = false; + break; + } +@@ -1200,11 +1202,11 @@ + // no uncompressed input is left - switch to finish mode + flush = Z_FINISH; + } +- zrc = z_deflate( &m_zlib.m_strm, flush ); ++ zrc = deflate( &m_zlib.m_strm, flush ); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +- ON_ERROR("ON_CompressedBuffer::DeflateHelper - z_deflate failure"); ++ ON_ERROR("ON_CompressedBuffer::DeflateHelper - deflate failure"); + rc = false; + break; + } +@@ -1333,11 +1335,11 @@ + // no compressed input is left - switch to finish mode + flush = Z_FINISH; + } +- zrc = z_inflate( &m_zlib.m_strm, flush ); ++ zrc = inflate( &m_zlib.m_strm, flush ); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +- ON_ERROR("ON_CompressedBuffer::InflateHelper - z_inflate failure"); ++ ON_ERROR("ON_CompressedBuffer::InflateHelper - inflate failure"); + rc = false; + break; + } +--- opennurbs/opennurbs_zlib.h 2023-12-20 11:23:14.434017100 -0500 ++++ OPENNURBS_BLD/opennurbs_zlib.h 2023-12-20 11:22:19.146985000 -0500 +@@ -37,7 +37,7 @@ + #endif + + #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE +-#include "./zlib/zlib.h" ++#include "zlib.h" + #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE + + ON_BEGIN_EXTERNC