From 3c3588e85b29052bf98f7d8ab2b718e2f3c42c69 Mon Sep 17 00:00:00 2001 From: Gonzalo Casas Date: Tue, 21 Oct 2025 14:54:03 +0800 Subject: [PATCH] Fix int vs enum bug related to python3 not allowing this syntax anymore --- CHANGELOG.md | 1 + src/compas_rhino/geometry/curves/curve.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d25fbad153cb..c0ac707d38da 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`. +* Fixed bug in `Curve.offset()` in `compas_rhino`. ### Removed diff --git a/src/compas_rhino/geometry/curves/curve.py b/src/compas_rhino/geometry/curves/curve.py index 6b3eab7c5fa8..a3df7109fa78 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.Geometry # 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 + offset_style = Rhino.Geometry.CurveOffsetCornerStyle.NONE + self.native_curve = self.native_curve.Offset(plane, distance, tolerance, offset_style)[0] # type: ignore def smooth(self): raise NotImplementedError