Skip to content

Commit b40bb36

Browse files
Copilotgonzalocasas
andcommitted
Support both .step and .stp file extensions in RhinoBrep step methods
Co-authored-by: gonzalocasas <[email protected]>
1 parent 30dae8a commit b40bb36

File tree

1 file changed

+3
-3
lines changed
  • src/compas_rhino/geometry/brep

1 file changed

+3
-3
lines changed

src/compas_rhino/geometry/brep/brep.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,8 @@ def from_step(cls, filepath):
749749
:class:`compas_rhino.geometry.RhinoBrep`
750750
751751
"""
752-
if not filepath.endswith(".step"):
753-
raise ValueError("Expected file with .step extension")
752+
if not (filepath.endswith(".step") or filepath.endswith(".stp")):
753+
raise ValueError("Expected file with .step or .stp extension")
754754
return _import_brep_from_file(filepath)
755755

756756
@classmethod
@@ -891,7 +891,7 @@ def to_viewmesh(self, linear_deflection: float = 0.001):
891891
return _join_meshes(self.to_meshes()), []
892892

893893
def to_step(self, filepath):
894-
if not filepath.endswith(".step"):
894+
if not (filepath.endswith(".step") or filepath.endswith(".stp")):
895895
raise ValueError("Attempted to export STEP but file ends with {} extension".format(filepath.split(".")[-1]))
896896
_export_brep_to_file(self._brep, filepath)
897897

0 commit comments

Comments
 (0)