From 978f14ad68ff905ebf0f3ad9d0fa08505f662a61 Mon Sep 17 00:00:00 2001 From: Bozo the Builder Date: Tue, 14 Apr 2026 07:33:38 -0700 Subject: [PATCH] Sync changes from upstream repository --- opennurbs_dimension.cpp | 10 +++++++-- opennurbs_mesh.cpp | 1 + opennurbs_public_version.h | 26 +++++++++++----------- opennurbs_quaternion.cpp | 4 ++-- opennurbs_sectionstyle.cpp | 38 ++++++++++++++++++++++++++++++++ opennurbs_sectionstyle.h | 45 +++++++++++++++++++++++++++----------- opennurbs_text.cpp | 8 +++++++ 7 files changed, 102 insertions(+), 30 deletions(-) diff --git a/opennurbs_dimension.cpp b/opennurbs_dimension.cpp index 484fb035..a8bf0539 100644 --- a/opennurbs_dimension.cpp +++ b/opennurbs_dimension.cpp @@ -196,7 +196,13 @@ ON_TextContent* ON_Dimension::RebuildDimensionText( } else { - displaytext = displaytext + UserText(); + // October 2, 2025 - Tim + // As far as I can tell RebuildDimensionText only gets called with + // expandanglebrackets set to false from the acad export plugin otherwise + // I would be jumpy about making these changes. + // These changes fix https://mcneel.myjetbrains.com/youtrack/issue/RH-89323 + + displaytext = PlainText(); if (dimstyle->Prefix().IsNotEmpty() || dimstyle->Suffix().IsNotEmpty()) { int ci = displaytext.Find(L"<>"); @@ -206,7 +212,7 @@ ON_TextContent* ON_Dimension::RebuildDimensionText( if (displaytext.Length() > ci + 2) right = displaytext.Right(displaytext.Length() - ci - 2); displaytext = displaytext.Left(ci); - displaytext = displaytext + dimstyle->Prefix(); + displaytext = dimstyle->Prefix() + displaytext; displaytext = displaytext + L"<>"; displaytext = displaytext + dimstyle->Suffix(); displaytext = displaytext + right; diff --git a/opennurbs_mesh.cpp b/opennurbs_mesh.cpp index 16f3147c..484a14b3 100644 --- a/opennurbs_mesh.cpp +++ b/opennurbs_mesh.cpp @@ -470,6 +470,7 @@ unsigned int ON_Mesh::SizeOf() const { unsigned int sz = ON_Geometry::SizeOf(); sz += m_V.SizeOfArray(); + sz += m_dV.SizeOfArray(); sz += m_F.SizeOfArray(); sz += m_N.SizeOfArray(); sz += m_FN.SizeOfArray(); diff --git a/opennurbs_public_version.h b/opennurbs_public_version.h index 9d937477..4664f9a5 100644 --- a/opennurbs_public_version.h +++ b/opennurbs_public_version.h @@ -6,18 +6,18 @@ // To update version numbers, edit ..\build\build_dates.msbuild #define RMA_VERSION_MAJOR 8 -#define RMA_VERSION_MINOR 26 +#define RMA_VERSION_MINOR 27 //////////////////////////////////////////////////////////////// // // These are set automatically by the build system as the // first step in each build. // -#define RMA_VERSION_YEAR 2025 -#define RMA_VERSION_MONTH 12 -#define RMA_VERSION_DATE 15 -#define RMA_VERSION_HOUR 19 -#define RMA_VERSION_MINUTE 0 +#define RMA_VERSION_YEAR 2026 +#define RMA_VERSION_MONTH 1 +#define RMA_VERSION_DATE 19 +#define RMA_VERSION_HOUR 16 +#define RMA_VERSION_MINUTE 2 //////////////////////////////////////////////////////////////// // @@ -35,20 +35,20 @@ // 3 = build system release build #define RMA_VERSION_BRANCH 0 -#define VERSION_WITH_COMMAS 8,26,25349,19000 -#define VERSION_WITH_PERIODS 8.26.25349.19000 -#define COPYRIGHT "Copyright (C) 1993-2025, Robert McNeel & Associates. All Rights Reserved." +#define VERSION_WITH_COMMAS 8,27,26019,16020 +#define VERSION_WITH_PERIODS 8.27.26019.16020 +#define COPYRIGHT "Copyright (C) 1993-2026, Robert McNeel & Associates. All Rights Reserved." #define SPECIAL_BUILD_DESCRIPTION "Public OpenNURBS C++ 3dm file IO library." #define RMA_VERSION_NUMBER_MAJOR_STRING "8" #define RMA_VERSION_NUMBER_MAJOR_WSTRING L"8" #define RMA_PREVIOUS_VERSION_NUMBER_MAJOR_WSTRING L"7" -#define RMA_VERSION_NUMBER_SR_STRING "SR26" -#define RMA_VERSION_NUMBER_SR_WSTRING L"SR26" +#define RMA_VERSION_NUMBER_SR_STRING "SR27" +#define RMA_VERSION_NUMBER_SR_WSTRING L"SR27" -#define RMA_VERSION_WITH_PERIODS_STRING "8.26.25349.19000" -#define RMA_VERSION_WITH_PERIODS_WSTRING L"8.26.25349.19000" +#define RMA_VERSION_WITH_PERIODS_STRING "8.27.26019.16020" +#define RMA_VERSION_WITH_PERIODS_WSTRING L"8.27.26019.16020" diff --git a/opennurbs_quaternion.cpp b/opennurbs_quaternion.cpp index 776d200f..96356bd8 100644 --- a/opennurbs_quaternion.cpp +++ b/opennurbs_quaternion.cpp @@ -621,7 +621,7 @@ bool ON_Quaternion::GetYawPitchRoll(double& yaw, double& pitch, double& roll) co ON_Xform X; bool rc = GetRotation(X); if (rc) - rc = GetYawPitchRoll(yaw, pitch, roll); + rc = X.GetYawPitchRoll(yaw, pitch, roll); return rc; } @@ -630,7 +630,7 @@ bool ON_Quaternion::GetEulerZYZ(double& alpha, double& beta, double& gamma) con ON_Xform X; bool rc = GetRotation(X); if (rc) - rc = GetEulerZYZ(alpha, beta, gamma); + rc = X.GetEulerZYZ(alpha, beta, gamma); return rc; } diff --git a/opennurbs_sectionstyle.cpp b/opennurbs_sectionstyle.cpp index d82685ad..d1ca77a4 100644 --- a/opennurbs_sectionstyle.cpp +++ b/opennurbs_sectionstyle.cpp @@ -111,6 +111,7 @@ ON_SectionStyle& ON_SectionStyle::operator=(const ON_SectionStyle& other) } return *this; } + bool ON_SectionStyle::IsValid( ON_TextLog* text_log ) const { if (false == ON_ModelComponent::IsValid(text_log)) @@ -134,6 +135,43 @@ bool ON_SectionStyle::IsValid( ON_TextLog* text_log ) const return true; } +const ON_SectionStyle* ON_SectionStyle::FromModelComponentRef( + const class ON_ModelComponentReference& model_component_reference, + const ON_SectionStyle* none_return_value +) +{ + const ON_SectionStyle* p = ON_SectionStyle::Cast(model_component_reference.ModelComponent()); + return (nullptr != p) ? p : none_return_value; +} + +bool ON_SectionStyle::UpdateReferencedComponents( + const class ON_ComponentManifest& source_manifest, + const class ON_ComponentManifest& destination_manifest, + const class ON_ManifestMap& manifest_map +) +{ + bool rc = true; + // Update hatch pattern index + int hatch_index = HatchIndex(); + if (hatch_index >= 0) + { + int destination_hatch_index = -1; + if (manifest_map.GetAndValidateDestinationIndex(ON_ModelComponent::Type::HatchPattern, hatch_index, destination_manifest, &destination_hatch_index)) + { + hatch_index = destination_hatch_index; + } + else + { + ON_ERROR("Unable to update hatch pattern reference."); + rc = false; + hatch_index = DefaultSectionStylePrivate.m_hatch_index; + } + SetHatchIndex(hatch_index); + } + return rc; +} + + // 12 Aug 2021 S. Baer // When adding new fields written to 3dm files, always add information to this // Dump function. Dump is used by the opennurbs file testing framework to diff --git a/opennurbs_sectionstyle.h b/opennurbs_sectionstyle.h index 87f4b5f0..aa5eb6d5 100644 --- a/opennurbs_sectionstyle.h +++ b/opennurbs_sectionstyle.h @@ -31,32 +31,52 @@ public: static const ON_SectionStyle Unset; // index = ON_UNSET_INT_INDEX, id = nil /* - Description: - Tests that name is set and there is at least one non-zero length segment + Parameters: + model_component_reference - [in] + none_return_value - [in] + value to return if ON_SectionStyle::Cast(model_component_ref.ModelComponent()) + is nullptr + Returns: + If ON_SectionStyle::Cast(model_component_ref.ModelComponent()) is not nullptr, + that pointer is returned. Otherwise, none_return_value is returned. + */ + static const ON_SectionStyle* FromModelComponentRef( + const class ON_ModelComponentReference& model_component_reference, + const ON_SectionStyle* none_return_value + ); + + bool UpdateReferencedComponents( + const class ON_ComponentManifest& source_manifest, + const class ON_ComponentManifest& destination_manifest, + const class ON_ManifestMap& manifest_map + ) override; + + /* + Description: + Tests that name is set and there is at least one non-zero length segment */ bool IsValid( class ON_TextLog* text_log = nullptr ) const override; void Dump( ON_TextLog& ) const override; // for debugging /* - Description: - Write to file (serialize definition to binary archive) + Description: + Write to file (serialize definition to binary archive) */ bool Write(ON_BinaryArchive&) const override; /* - Description: - Read from file (restore definition from binary archive) + Description: + Read from file (restore definition from binary archive) */ bool Read(ON_BinaryArchive&) override; - /* - Description: - Test only the section style attributes below for equality. Does not - perform any testing of the ON_ModelComponent fields - Parameters: - other: other section style to compare against this + Description: + Test only the section style attributes below for equality. Does not + perform any testing of the ON_ModelComponent fields + Parameters: + other: other section style to compare against this */ bool SectionAttributesEqual(const ON_SectionStyle& other) const; @@ -89,7 +109,6 @@ public: SectionBackgroundFillMode BackgroundFillMode() const; void SetBackgroundFillMode(SectionBackgroundFillMode mode); - // Custom background fill color. If unset (default), the object's color or // material is used for a fill ON_Color BackgroundFillColor(bool print) const; diff --git a/opennurbs_text.cpp b/opennurbs_text.cpp index dcb1af29..a45ec660 100644 --- a/opennurbs_text.cpp +++ b/opennurbs_text.cpp @@ -537,6 +537,14 @@ const ON_wString ON_TextContent::Internal_GetPlainText(bool evaluate_fields, boo map.j = plaintext.Length(); map.k = (int)wcslen(str); } + + // December 3, 2025 - Tim + // Fix for https://mcneel.myjetbrains.com/youtrack/issue/RH-90830 + // Add a space before the fraction if is not the first + // chunk of text. + if (0 < ri && nullptr != wcschr(str, '/')) + plaintext += " "; + plaintext += str; } }