Merged
Conversation
Lisu-lisa
approved these changes
Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and refactorings to the geometric shape and entity management systems, as well as some related code cleanup in both 2D and 3D builds. The most significant changes include a major refactor and extension of the
MultiPolygonAPI, enhanced ownership semantics in theEntityManager, and unification and simplification of box shape proxy writing logic. These changes improve code clarity, maintainability, and extensibility.Geometric Shape and Proxy Refactoring:
Refactored the proxy writing logic for box shapes in both 2D and 3D: removed duplicated code from body part files and unified the functionality in the
GeometricShapeBoxclass with a newwriteProxy()method. This centralizes the proxy writing logic and makes it reusable. (src/for_2D_build/geometries/geometric_shape_2d.cpp→src/for_2D_build/geometries/geometric_shape_2d.cpp,src/for_3D_build/geometries/geometric_shape_3d.cpp,src/shared/bodies/base_body_part.cpp,src/for_3D_build/bodies/base_body_part_3d.cpp,src/shared/geometries/geometric_shape.h,src/shared/geometries/geometric_shape.cpp) [1] [2] [3] [4] [5] [6]Added a constructor to
GeometricShapeBoxthat accepts aTransformGeometryBoxfor more flexible instantiation. (src/shared/geometries/geometric_shape.cpp,src/shared/geometries/geometric_shape.h) [1] [2]MultiPolygon API Refactor and Extension:
MultiPolygonfor better clarity and consistency (e.g.,addAPolygon→addPolygon,addACircle→addCircle). Added new methods such asaddBox(from a bounding box),addContainerBox, and improved const-correctness forgetBoostMultiPoly. This makes the API more intuitive and extensible. (src/for_2D_build/geometries/multi_polygon_shape.cpp,src/for_2D_build/geometries/multi_polygon_shape.h) [1] [2] [3] [4] [5] [6]Entity Manager Ownership and API Improvements:
EntityManagerto support managed ownership of entities viaSharedPtr, including new methods for adding, emplacing, and removing entities with ownership semantics. The manager now properly releases owned entities on clear or removal, improving memory safety and lifecycle management. (src/shared/common/sphinxsys_entity.h) [1] [2]General Codebase Cleanup and Improvements:
Rotationd = Rotation2d/3d) from common data type headers. (src/for_2D_build/common/data_type.h,src/for_3D_build/common/data_type.h) [1] [2]GeometricBoxwith aHalfSize()getter for encapsulation. (src/shared/geometries/geometric_element.h)ComplexShapedefault name), and code formatting for clarity and consistency. (src/shared/geometries/complex_geometry.h,src/shared/common/sphinxsys_entity.h,src/for_3D_build/geometries/sdf_shape.h) [1] [2] [3] [4] [5]These changes collectively improve the maintainability, clarity, and extensibility of the geometric and entity management infrastructure.