Skip to content

Commit 932082d

Browse files
Krandeclaude
andcommitted
feat(cad): adacpp builds FaceBasedSurfaceModel natively
AdacppBackend.build() dispatches su.FaceBasedSurfaceModel (PolyLoop bounds) to adacpp.cad.build_face_based_surface_model. tests/core under adacpp 638->645. OccBackend unchanged, ruff clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4c3310f commit 932082d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/ada/cad/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,19 @@ def _axis(d, default):
147147
outer, inners, self._xyz(pos.location),
148148
_axis(pos.axis, (0, 0, 1)), _axis(pos.ref_direction, (1, 0, 0)),
149149
)
150+
elif isinstance(g, su.FaceBasedSurfaceModel):
151+
import ada.geom.curves as cu
152+
153+
polygons = []
154+
for cfs in g.fbsm_faces:
155+
for fb in cfs.cfs_faces:
156+
if not isinstance(fb.bound, cu.PolyLoop):
157+
raise NotImplementedError(
158+
f"AdacppBackend.build: FaceBasedSurfaceModel bound "
159+
f"{type(fb.bound).__name__!r} not yet ported to adacpp."
160+
)
161+
polygons.append([self._xyz(p) for p in fb.bound.polygon])
162+
shape = self._cad.build_face_based_surface_model(polygons)
150163
else:
151164
raise NotImplementedError(
152165
f"AdacppBackend.build: ada.geom type {type(g).__name__!r} is not yet ported to "

0 commit comments

Comments
 (0)