Extensions
Files
- CurveExtensions.cs
`CurveExtensions.cs` is a C# utility file providing compatibility helpers for RhinoCommon geometry operations, specifically bridging differences between SDK 7 and SDK 8. It defines two static extension methods for the `Curve` type: `GetSubCurvesCompat`, which decomposes complex curves (like PolyCurves or NURBS) into their individual segment components, and `PointAtMidCompat`, which calculates the midpoint of a curve's domain. These methods ensure consistent behavior across different SDK versions by manually handling segmentation and domain calculations where native methods may vary. The implementation uses type checking to handle specific curve types like `PolyCurve`, `PolylineCurve`, and `NurbsCurve` appropriately. This approach allows other parts of the application to work with uniform curve representations regardless of the underlying geometry complexity.