Skip to content

feat: surface bindings#5197

Open
asalzburger wants to merge 7 commits intoacts-project:mainfrom
asalzburger:feat-surface-bindings
Open

feat: surface bindings#5197
asalzburger wants to merge 7 commits intoacts-project:mainfrom
asalzburger:feat-surface-bindings

Conversation

@asalzburger
Copy link
Contributor

Add more python bindings for Surfaces and pytest.

--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

  • Use a conventional commits prefix: quick summary
    • We mostly use feat, fix, refactor, docs, chore and build types.
  • A milestone will be assigned by one of the maintainers

Comment on lines +65 to +79
py::enum_<SurfaceBounds::BoundsType>(m, "SurfaceBoundsType")
.value("Cone", SurfaceBounds::BoundsType::eCone)
.value("Cylinder", SurfaceBounds::BoundsType::eCylinder)
.value("Diamond", SurfaceBounds::BoundsType::eDiamond)
.value("Disc", SurfaceBounds::BoundsType::eDisc)
.value("Ellipse", SurfaceBounds::BoundsType::eEllipse)
.value("Line", SurfaceBounds::BoundsType::eLine)
.value("Rectangle", SurfaceBounds::BoundsType::eRectangle)
.value("Trapezoid", SurfaceBounds::BoundsType::eTrapezoid)
.value("Triangle", SurfaceBounds::BoundsType::eTriangle)
.value("DiscTrapezoid", SurfaceBounds::BoundsType::eDiscTrapezoid)
.value("ConvexPolygon", SurfaceBounds::BoundsType::eConvexPolygon)
.value("Annulus", SurfaceBounds::BoundsType::eAnnulus)
.value("Boundless", SurfaceBounds::BoundsType::eBoundless)
.value("Other", SurfaceBounds::BoundsType::eOther);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using using enum SurfaceBounds::BoundsType; maybe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have considered, but since there are quite some enum declarations of similar names in the file, I will keep it explicit.

Comment on lines +90 to +91
.def("__len__",
[](const CylinderBounds&) { return CylinderBounds::eSize; })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to expose __len__ for anything specific?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we access by getitem it would give some safe guard ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. It sort of leaks that the enums are used to index into the bound values vector.

@github-actions github-actions bot added this to the next milestone Mar 5, 2026
@asalzburger asalzburger force-pushed the feat-surface-bindings branch from 5d9df52 to 49e367c Compare March 5, 2026 15:57
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

📊: Physics performance monitoring for 2fb0405

Full contents

physmon summary

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants