Skip to content

Commit 5271f13

Browse files
committed
add support for .brep files
1 parent e8c94b8 commit 5271f13

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
* Added support for `.brep` files for easier exchange with OCC geometries.
13+
1214
### Changed
1315

1416
### Removed

src/compas_gmsh/models/model.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,23 @@ def from_step(cls, filepath: str) -> "Model":
139139

140140
@classmethod
141141
def from_brep(cls, brep: Brep) -> "Model":
142-
"""Construct a model from a Brep.
142+
"""Construct a model from a b-rep geometry.
143143
144144
Parameters
145145
----------
146146
brep : :class:`Brep`
147-
The brep geometry.
147+
The b-rep geometry.
148148
149149
Returns
150150
-------
151151
:class:`Model`
152152
153153
"""
154-
_, filepath = tempfile.mkstemp(suffix=".stp")
155-
brep.to_step(filepath)
156-
return cls.from_step(filepath)
154+
fd, filepath = tempfile.mkstemp(suffix=".brep")
155+
brep.to_brep(filepath) # type: ignore
156+
model = cls()
157+
gmsh.open(filepath)
158+
return model
157159

158160
# ==============================================================================
159161
# Model entities

0 commit comments

Comments
 (0)