diff --git a/Rhino/Speckle.Rhino.Api/IRhinoCurve.cs b/Rhino/Speckle.Rhino.Api/IRhinoCurve.cs index 023f2f1..401d24e 100644 --- a/Rhino/Speckle.Rhino.Api/IRhinoCurve.cs +++ b/Rhino/Speckle.Rhino.Api/IRhinoCurve.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using Rhino; using Rhino.Collections; using Rhino.DocObjects; @@ -26,6 +26,19 @@ public partial class RhinoDocProxy [Proxy(typeof(Curve), new[] { "Duplicate" })] public partial interface IRhinoCurveProxy : IRhinoCurve; +public partial class CurveProxy +{ + public IRhinoPolyCurve? ToPolyCurve() => A.Call(() => _Instance as PolyCurve); + + public IRhinoArcCurve? ToArcCurve() => A.Call(() => _Instance as ArcCurve); + + public IRhinoPolylineCurve? ToPolylineCurve() => A.Call(() => _Instance as PolylineCurve); + + public IRhinoLineCurve? ToLineCurve() => A.Call(() => _Instance as LineCurve); + + public IRhinoNurbsCurve? ToNurbsCurveReflection() => A.Call(() => _Instance as NurbsCurve); +} + [Proxy(typeof(GeometryBase), new[] { "Transform" })] public partial interface IRhinoGeometryBaseProxy : IRhinoGeometryBase; @@ -249,7 +262,7 @@ public partial class BrepEdgeListProxy [Proxy(typeof(BrepEdge))] public partial interface IRhinoBrepEdgeProxy : IRhinoBrepEdge; -[Proxy(typeof(CurveProxy))] +[Proxy(typeof(Rhino.Geometry.CurveProxy))] public partial interface IRhinoCurveProxy2Proxy : IRhinoCurveProxy2; [Proxy(typeof(BrepTrimList), new[] { "AddSingularTrim", "GetEnumerator" })] diff --git a/Rhino/Speckle.Rhino.Interfaces/RhinoCurve.cs b/Rhino/Speckle.Rhino.Interfaces/RhinoCurve.cs index aa30ad8..0627e28 100644 --- a/Rhino/Speckle.Rhino.Interfaces/RhinoCurve.cs +++ b/Rhino/Speckle.Rhino.Interfaces/RhinoCurve.cs @@ -1,4 +1,4 @@ -using System.Drawing; +using System.Drawing; namespace Speckle.Rhino7.Interfaces; @@ -33,6 +33,11 @@ public interface IRhinoCurve : IRhinoGeometryBase int Degree { get; } bool IsPeriodic { get; } IRhinoCurve Trim(IRhinoInterval interval); + IRhinoPolyCurve? ToPolyCurve(); + IRhinoArcCurve? ToArcCurve(); + IRhinoPolylineCurve? ToPolylineCurve(); + IRhinoLineCurve? ToLineCurve(); + IRhinoNurbsCurve? ToNurbsCurveReflection(); } public interface IRhinoGeometryBase : IRhinoCommonObject diff --git a/Speckle.Host.Apis.sln b/Speckle.Host.Apis.sln index 318ed3a..119ebb1 100644 --- a/Speckle.Host.Apis.sln +++ b/Speckle.Host.Apis.sln @@ -123,6 +123,6 @@ Global {EB2B9350-BE2B-4197-ACA8-3963EAE3B6C9} = {BC12C4CA-7065-4B76-9787-E8DA4745AD4E} {5F678DE0-AAE7-4FA9-9A7F-C3C0B0E3E3D7} = {BC12C4CA-7065-4B76-9787-E8DA4745AD4E} {E1C43415-3200-45F4-8BF9-B4DD7D7F2ED6} = {3B0D8F6E-C701-446E-BAE3-B6FDF1812901} - {E1C43415-3200-45F4-8BF9-A4DD7D7F2ED6} = {72DEFF6C-31DE-4050-8692-AEE8224E9925} + {E1C43415-3200-45F4-8BF9-A4DD7D7F2ED6} = {8F540B7F-7548-46E9-BDEC-4DAB99367908} EndGlobalSection EndGlobal