From 142542261d6f6f69677df83975897ce7ec6690dc Mon Sep 17 00:00:00 2001 From: fraguada Date: Mon, 18 Dec 2023 22:21:32 +0100 Subject: [PATCH] condition checking for rhino3dm --- src/dotnet/opennurbs/opennurbs_extensions.cs | 1 + src/librhino3dm_native/on_nurbscurve.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/dotnet/opennurbs/opennurbs_extensions.cs b/src/dotnet/opennurbs/opennurbs_extensions.cs index ca9fe840..8dfc8a3f 100644 --- a/src/dotnet/opennurbs/opennurbs_extensions.cs +++ b/src/dotnet/opennurbs/opennurbs_extensions.cs @@ -4158,6 +4158,7 @@ public File3dmObject[] GroupMembers(int groupIndex) /// Adds a new empty group to the group table. /// /// >=0 index of new group or -1 on error. + /// 8.4 public int AddGroup() { IntPtr ptrFile3dm = m_parent.NonConstPointer(); diff --git a/src/librhino3dm_native/on_nurbscurve.cpp b/src/librhino3dm_native/on_nurbscurve.cpp index 2167828a..749d6fa0 100644 --- a/src/librhino3dm_native/on_nurbscurve.cpp +++ b/src/librhino3dm_native/on_nurbscurve.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" + RH_C_FUNCTION ON_NurbsCurve* ON_NurbsCurve_New(ON_NurbsCurve* pOther) { RHCHECK_LICENSE @@ -55,8 +56,13 @@ RH_C_FUNCTION ON_NurbsCurve* ON_NurbsCurve_CreateControlPointCurve(int count, /* count = pline.Count(); // clamp + //Luis 2023.12.18 + //RhMaxNurbsDegree() isn't available in rhino3dm, but it is just a function that returns the number 11 + #if !defined(RHINO3DM_BUILD) degree = RHINO_CLAMP(degree, 1, RhMaxNurbsDegree()); - + #else + degree = RHINO_CLAMP(degree, 1, 11); + #endif // control point curve degree = (count <= degree) ? count - 1 : degree;