Adding Rectangle feature (#889)
Description
Successfully added the Rectangle feature (#889) by:
- Creating a new
rectangle.jsfile in thesrc/core/shapesfolder. - Adding
export { Rectangle } from '../src/core/shape/rectangle.js';code at line number 104 inindex.js. - Creating a new
rectangle.test.jsfile in thetest/core/shapesfolder.
Fixes #
- Added a Rectangle feature in the repository as suggested in (#889)
Checklist
- [x] I have read the contributing guidelines
- [x] My code follows the project's coding standards
- [x] This PR focuses on a single change
This PR does not fix #889. It is hardly useful without a rotation. Even then, most use cases can be solved with pc.Plane, so not sure if this is needed.
I think most people know my attitude about adding new API. There has to be a very strong case to add new API, particularly classes. We shouldn't add something purely because it's fun or an LLM can solve an issue in 5 minutes. These controls are the reason the Engine API is reasonably compact, even after 15 years.
And ideally, new API should be accompanied by an Engine example that proves out the usefulness of the new API.