From 91b2f15a2a662a997fc2c0de8555ad81e829d303 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Oct 2025 06:27:55 +0000 Subject: [PATCH 1/4] Initial plan From d463da2454c04ca4f6e85f63ec14b72b208d7aaf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Oct 2025 06:34:37 +0000 Subject: [PATCH 2/4] Replace hardcoded 0 with CurveOffsetCornerStyle.None enum Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com> --- src/compas_rhino/geometry/curves/curve.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compas_rhino/geometry/curves/curve.py b/src/compas_rhino/geometry/curves/curve.py index 6b3eab7c5fa8..7ac3b855b3ed 100644 --- a/src/compas_rhino/geometry/curves/curve.py +++ b/src/compas_rhino/geometry/curves/curve.py @@ -2,6 +2,8 @@ from __future__ import division from __future__ import print_function +import Rhino # type: ignore + from compas.geometry import Curve from compas.geometry import Plane from compas_rhino.conversions import box_to_compas @@ -393,7 +395,8 @@ def offset(self, distance, direction, tolerance=1e-3): point = self.point_at(self.domain[0]) # type: ignore plane = Plane(point, direction) plane = plane_to_rhino(plane) - self.native_curve = self.native_curve.Offset(plane, distance, tolerance, 0)[0] # type: ignore + corner_style = getattr(Rhino.Geometry.CurveOffsetCornerStyle, "None") + self.native_curve = self.native_curve.Offset(plane, distance, tolerance, corner_style)[0] # type: ignore def smooth(self): raise NotImplementedError From 46ad0415341b7909306a3535beed4f78d3d48239 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Oct 2025 06:40:29 +0000 Subject: [PATCH 3/4] Use NONE enum constant directly instead of getattr Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com> --- src/compas_rhino/geometry/curves/curve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compas_rhino/geometry/curves/curve.py b/src/compas_rhino/geometry/curves/curve.py index 7ac3b855b3ed..180f34dd0444 100644 --- a/src/compas_rhino/geometry/curves/curve.py +++ b/src/compas_rhino/geometry/curves/curve.py @@ -395,7 +395,7 @@ def offset(self, distance, direction, tolerance=1e-3): point = self.point_at(self.domain[0]) # type: ignore plane = Plane(point, direction) plane = plane_to_rhino(plane) - corner_style = getattr(Rhino.Geometry.CurveOffsetCornerStyle, "None") + corner_style = Rhino.Geometry.CurveOffsetCornerStyle.NONE self.native_curve = self.native_curve.Offset(plane, distance, tolerance, corner_style)[0] # type: ignore def smooth(self): From 9001b8177e9916aa827200fa58b480756a47be72 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Oct 2025 06:49:08 +0000 Subject: [PATCH 4/4] Add changelog entry for CurveOffsetCornerStyle.NONE enum change Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com> --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d25fbad153cb..e0dd5760ee51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Changed name of YAK package from `bluejay` to `compas`. * Fixed broken `scaled()` method in `Sphere`, `Cylinder`, and `Capsule` classes by overriding to accept uniform scaling factor. * Fixed bug in `compas.geometry.PlanarSurface`. +* Replaced hardcoded `0` with `Rhino.Geometry.CurveOffsetCornerStyle.NONE` enum in `compas_rhino.geometry.RhinoCurve.offset()` method. ### Removed