Sync changes from upstream repository

This commit is contained in:
Bozo the Builder
2026-06-15 11:19:50 -07:00
parent b6d5ad4277
commit 1ea15b3674
10 changed files with 87 additions and 95 deletions
+6
View File
@@ -6532,6 +6532,12 @@ bool ON_Brep::GetTightBoundingBox(ON_BoundingBox& tight_bbox, bool bGrowBox, con
kct = greville_abcissae.Count();
for (k = 0; kct > k; k++)
{
// 17 March 2026, Mikko, RH-94035:
// Skip isocurves outside the domain. Happens when GetGrevilleAbcissae is called
// on a periodic surface.
if (!nsrf.Domain(j).Includes(greville_abcissae[k]))
continue;
iso_curves.Append(nsrf.IsoCurve(j == 0 ? 1 : 0, greville_abcissae[k]));
}
}
+3 -3
View File
@@ -968,9 +968,9 @@ bool ON_MakePeriodicUniformKnotVector(
double ON_GrevilleAbcissa( // get Greville abcissa
int order, // order (>=2)
const double* knot // knot[order-1] array
double ON_GrevilleAbcissa( // get a single Greville abcissa from knots
int order, // order (>=2)
const double* knot // knot[order-1] array
)
{
+25 -25
View File
@@ -371,42 +371,42 @@ bool ON_MakePeriodicUniformKnotVector(
);
ON_DECL
double ON_GrevilleAbcissa( // get Greville abcissae from knots
int, // order (>=2)
const double* // knot[] array (length = order-1)
double ON_GrevilleAbcissa( // get a single Greville abcissa from knots
int order, // order (>=2)
const double* knot // knot[] array (length = order-1)
);
ON_DECL
bool ON_GetGrevilleAbcissae( // get Greville abcissae from knots
int, // order (>=2)
int, // cv count
const double*, // knot[] array
bool, // true for periodic case
double* // g[] array has length cv_count in non-periodic case
// and cv_count-order+1 in periodic case
bool ON_GetGrevilleAbcissae( // get Greville abcissae from knots
int order, // order (>=2)
int cv_count, // cv count
const double* knot, // knot[] array
bool periodic , // true for periodic case
double* greville // g[] array has length cv_count in non-periodic case
// and cv_count-order+1 in periodic case
);
ON_DECL
bool ON_GetGrevilleKnotVector( // get knots from Greville abcissa
int, // g[] array stride (>=1)
const double*, // g[] array
// if not periodic, length = cv_count
// if periodic, length = cv_count-order+2
bool, // true for periodic knots
int, // order (>=2)
int, // cv_count (>=order)
double* // knot[cv_count+order-2]
int g_stride, // g[] array stride (>=1)
const double* grev, // g[] array
// if not periodic, length = cv_count
// if periodic, length = cv_count-order+2
bool periodic, // true for periodic knots
int order, // order (>=2)
int cv_count, // cv_count (>=order)
double* knot // knot[cv_count+order-2]
);
ON_DECL
bool ON_ClampKnotVector(
int, // cv_dim ( = dim+1 for rational cvs )
int, // order (>=2)
int, // cv_count,
int, // cv_stride,
double*, // cv[] nullptr or array of order many cvs
double*, // knot[] array with room for at least knot_multiplicity new knots
int // end 0 = clamp start, 1 = clamp end, 2 = clamp both ends
int dim, // cv_dim ( = dim+1 for rational cvs )
int order, // order (>=2)
int cv_count, // cv_count,
int cv_stride, // cv_stride,
double* cv, // cv[] nullptr or array of order many cvs
double* knots, // knot[] array with room for at least knot_multiplicity new knots
int end // end 0 = clamp start, 1 = clamp end, 2 = clamp both ends
);
+3
View File
@@ -2201,6 +2201,9 @@ double ON_NurbsCurve::GrevilleAbcissa(
return ON_GrevilleAbcissa( m_order, m_knot+gindex );
}
// Gets the Greville abscissae. The size of the target array should always be CVCount().
// NOTE: this does not take into account periodicity and will return parameters
// outside the domain for periodic curves.
bool ON_NurbsCurve::GetGrevilleAbcissae( // see ON_GetGrevilleAbcissa() for details
double* g // g[m_cv_count]
) const
+4
View File
@@ -1006,6 +1006,10 @@ public:
int cv_index // index (0 <= index < CVCount(dir)
) const;
// Gets the Greville abscissae for the knots in the given direction.
// The size of the target array should always be CVCount(dir).
// NOTE: this does not take into account periodicity and will return parameters
// outside the domain if the surface is periodic in the given direction.
bool GetGrevilleAbcissae( // see ON_GetGrevilleAbcissa() for details
int dir, // dir
double* g // g[cv count]
+9 -3
View File
@@ -677,9 +677,7 @@ bool ON_PlaneSurface::CreatePlaneThroughBox(
*this = plane;
uext.Expand(padding * uext.Length() + padding);
vext.Expand(padding * vext.Length() + padding);
SetExtents(0, uext, true);
SetExtents(1, vext, true);
return true;
return SetExtents(0, uext, true) && SetExtents(1, vext, true);
}
@@ -1776,3 +1774,11 @@ bool ON_ClippingPlaneSurface::Read( ON_BinaryArchive& file )
return rc;
}
bool ON_ClippingPlaneSurface::Transform(const ON_Xform& xform)
{
bool rc = ON_PlaneSurface::Transform(xform);
if (rc)
rc = m_clipping_plane.m_plane.Transform(xform);
return rc;
}
+18 -4
View File
@@ -489,7 +489,9 @@ public:
/*
Description:
Create a plane that contains the projection of a bounding box.
Parameters:
(You can use CreatePlaneThroughBox is you know that the box
intersects with the plane, to make it way tighter)
Parameters:
plane - [in]
bbox - [in]
padding - [in]
@@ -506,10 +508,13 @@ public:
/*
Description:
Create a plane that contains the intersection of a bounding box.
Create a plane that contains the *intersection* with a bounding box.
This method uses box edges intersections rather than box vertices
projections on the plane, which is what CreatePseudoInfinitePlane
uses.
(While the resulting bounding box is tighter, it also means that
the plane must intersect with the plane, or no result will be
computed.)
Parameters:
plane - [in]
bbox - [in]
@@ -527,10 +532,13 @@ public:
/*
Description:
Create a plane that contains the intersection of a bounding box.
Create a plane that contains the *intersection* with a bounding box.
This method uses box edges intersections rather than box vertices
projections on the plane, which is what CreatePseudoInfinitePlane
uses.
(While the resulting bounding box is tighter, it also means that
the plane must intersect with the plane, or no result will be
computed.)
Parameters:
plane - [in]
bbox - [in]
@@ -578,6 +586,7 @@ protected:
class ON_CLASS ON_ClippingPlaneSurface : public ON_PlaneSurface
{
ON_OBJECT_DECLARE(ON_ClippingPlaneSurface);
public:
ON_ClippingPlaneSurface();
ON_ClippingPlaneSurface(const ON_Plane& src);
@@ -611,8 +620,13 @@ public:
ON_BinaryArchive& // open binary file
) override;
bool Transform(
const ON_Xform&
) override;
public:
ON_ClippingPlane m_clipping_plane;
};
#endif
+10 -10
View File
@@ -6,7 +6,7 @@
// To update version numbers, edit ..\build\build_dates.msbuild
#define RMA_VERSION_MAJOR 8
#define RMA_VERSION_MINOR 29
#define RMA_VERSION_MINOR 32
////////////////////////////////////////////////////////////////
//
@@ -14,9 +14,9 @@
// first step in each build.
//
#define RMA_VERSION_YEAR 2026
#define RMA_VERSION_MONTH 3
#define RMA_VERSION_DATE 4
#define RMA_VERSION_HOUR 11
#define RMA_VERSION_MONTH 6
#define RMA_VERSION_DATE 9
#define RMA_VERSION_HOUR 13
#define RMA_VERSION_MINUTE 0
////////////////////////////////////////////////////////////////
@@ -35,8 +35,8 @@
// 3 = build system release build
#define RMA_VERSION_BRANCH 0
#define VERSION_WITH_COMMAS 8,29,26063,11000
#define VERSION_WITH_PERIODS 8.29.26063.11000
#define VERSION_WITH_COMMAS 8,32,26160,13000
#define VERSION_WITH_PERIODS 8.32.26160.13000
#define COPYRIGHT "Copyright (C) 1993-2026, Robert McNeel & Associates. All Rights Reserved."
#define SPECIAL_BUILD_DESCRIPTION "Public OpenNURBS C++ 3dm file IO library."
@@ -44,11 +44,11 @@
#define RMA_VERSION_NUMBER_MAJOR_WSTRING L"8"
#define RMA_PREVIOUS_VERSION_NUMBER_MAJOR_WSTRING L"7"
#define RMA_VERSION_NUMBER_SR_STRING "SR29"
#define RMA_VERSION_NUMBER_SR_WSTRING L"SR29"
#define RMA_VERSION_NUMBER_SR_STRING "SR32"
#define RMA_VERSION_NUMBER_SR_WSTRING L"SR32"
#define RMA_VERSION_WITH_PERIODS_STRING "8.29.26063.11000"
#define RMA_VERSION_WITH_PERIODS_WSTRING L"8.29.26063.11000"
#define RMA_VERSION_WITH_PERIODS_STRING "8.32.26160.13000"
#define RMA_VERSION_WITH_PERIODS_WSTRING L"8.32.26160.13000"
+8 -49
View File
@@ -944,9 +944,9 @@ int ON_VARGS_FUNC_CDECL ON_wString::FormatIntoBuffer(
return rc;
}
#if defined(ON_COMPILER_CLANG)
#if defined(ON_COMPILER_CLANG) || defined (ON_COMPILER_GNU)
static const wchar_t* ConvertToCLangFormat(
static const wchar_t* ConvertToWideCharStringFormat(
const wchar_t* format,
ON_wStringBuffer& clang_format_buffer
)
@@ -1053,14 +1053,14 @@ int ON_wString::FormatVargsIntoBuffer(
if ( nullptr == format || 0 == format[0] )
return 0;
#if defined(ON_COMPILER_CLANG)
#if defined(ON_COMPILER_CLANG) || defined (ON_COMPILER_GNU)
// CLang requires %ls to properly format a const wchar_t* parameter
wchar_t clang_format_stack_buffer[128];
ON_wStringBuffer clang_format_buffer(clang_format_stack_buffer, sizeof(clang_format_stack_buffer) / sizeof(clang_format_stack_buffer[0]));
format = ConvertToCLangFormat(
format = ConvertToWideCharStringFormat(
format,
clang_format_buffer
);
);
va_list args_copy;
va_copy (args_copy, args);
@@ -1070,19 +1070,10 @@ int ON_wString::FormatVargsIntoBuffer(
//int len = vswprintf_l(buffer, buffer_capacity, ON_Locale::Ordinal.NumericLocalePtr(), format, args_copy);
int len = vswprintf(buffer, buffer_capacity, format, args_copy);
va_end(args_copy);
#else
#if defined(ON_COMPILER_GNU)
va_list args_copy;
va_copy (args_copy, args);
int len = vswprintf(buffer, buffer_capacity, format, args_copy);
va_end(args_copy);
#else
// Using ON_Locale::Ordinal.NumericLocalePtr() insures that a period
// will be use for the decimal point in formatted printing.
int len = _vswprintf_p_l(buffer, buffer_capacity, format, ON_Locale::Ordinal.NumericLocalePtr(), args);
#endif
#endif
if (((size_t)len) >= buffer_capacity)
len = -1;
@@ -1123,7 +1114,7 @@ int ON_wString::FormatVargsOutputCount(
if ( nullptr == format || 0 == format[0] )
return 0;
#if defined(ON_COMPILER_CLANG)
#if defined(ON_COMPILER_CLANG) || defined (ON_COMPILER_GNU)
// Unlike _vscwprintf_p_l(), CLang's vswprintf() does not tell you how many characters would have
// been written if there was space enough in the buffer.
// It reports an error when there is not enough space.
@@ -1132,10 +1123,10 @@ int ON_wString::FormatVargsOutputCount(
// CLang requires %ls to properly format a const wchar_t* parameter
wchar_t clang_format_stack_buffer[128];
ON_wStringBuffer clang_format_buffer(clang_format_stack_buffer, sizeof(clang_format_stack_buffer) / sizeof(clang_format_stack_buffer[0]));
format = ConvertToCLangFormat(
format = ConvertToWideCharStringFormat(
format,
clang_format_buffer
);
);
// Attempting to directly get the count fails in OS X 10.4 June 2015 (always returns fmt_size = -1)
//
@@ -1219,41 +1210,9 @@ int ON_wString::FormatVargsOutputCount(
break;
}
return -1;
#else
#if defined(ON_COMPILER_GNU)
// 31 May 2019 S. Baer (RH-52038)
// TODO: The following code needs to be tested. This was added by request from a user that needed
// a GCC compile. This is obviously a cut and paste of the above clang code
wchar_t stack_buffer[1024];
ON_wStringBuffer buffer(stack_buffer, sizeof(stack_buffer) / sizeof(stack_buffer[0]));
size_t buffer_capacity = buffer.m_buffer_capacity;
for(;;)
{
va_list args_copy;
va_copy(args_copy, args);
const int formatted_string_count = vswprintf(buffer.m_buffer, buffer.m_buffer_capacity, format, args_copy);
va_end(args_copy);
if (formatted_string_count >= 0)
{
// formatted_string_count = number of wchar_t elements not including null terminator
return formatted_string_count;
}
if ( buffer_capacity >= 1024*16*16*16 )
break;
buffer_capacity *= 16;
if (false == buffer.GrowBuffer(buffer_capacity))
break;
if (nullptr == buffer.m_buffer)
break;
if (buffer_capacity < buffer.m_buffer_capacity)
break;
}
return -1;
#else
// Using ON_Locale::Ordinal.NumericLocalePtr() insures that a period
// will be use for the decimal point in formatted printing.
return _vscwprintf_p_l(format, ON_Locale::Ordinal.NumericLocalePtr(), args);
#endif
#endif
}
+1 -1
View File
@@ -11685,7 +11685,7 @@ public:
// Catmull-Clark limit meshes:
// When the original SubD face is a quad, a full fragment is created and
// m_face_vertex_index[4] = {0,1,2,3}.
// When the original SuD face is an N-gon with N != 4, a partial fragment
// When the original SubD face is an N-gon with N != 4, a partial fragment
// is delivered and m_face_vertex_index[2] identifies the face vertex
// for that fragment. m_face_vertex_index[0,1,3] = a value > ON_SubDFace::MaximumEdgeCount
unsigned short m_face_vertex_index[4];