Skip to content

Commit

Permalink
Merge pull request #1075 from compas-dev/cylinder-conversion-precision
Browse files Browse the repository at this point in the history
Fix random failure of cylinder conversion from brep
  • Loading branch information
tomvanmele authored Oct 5, 2022
2 parents 92afed0 + a202ca4 commit 15e73fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Based all gltf data classes on `BaseGLTFDataClass`
* Fixed `Color.__get___` AttributeError.
* Fixed `cylinder_to_rhino` conversion to match `compas.geometry.Cylinder` location.
* Changed identification of cylinder brep face to non-zero in `compas_rhino.conversions.cylinder.Cylinder`.
* Changed linter to `black`.
* Automatically trigger `invoke format` during `invoke release`.
* Fixed bug in `intersections.intersection_circle_circle_xy` where the Circle's Plane was accessed instead of the centre.
Expand Down
5 changes: 4 additions & 1 deletion src/compas_rhino/conversions/cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ def geometry(self, geometry):
faces = geometry.Faces
geometry = None
for face in faces:
if face.IsCylinder():
# being too strict about what is considered a cylinder
# results in cylinders created by Rhino itself
# to not be recognized...
if face.IsCylinder(0.001):
result, geometry = face.TryGetFiniteCylinder(0.001)
if result:
break
Expand Down

0 comments on commit 15e73fb

Please sign in to comment.