engine icon indicating copy to clipboard operation
engine copied to clipboard

Adding Rectangle feature (#889)

Open Hitesh-Nagpure opened this issue 1 month ago • 2 comments

Description

Successfully added the Rectangle feature (#889) by:

  1. Creating a new rectangle.js file in the src/core/shapes folder.
  2. Adding export { Rectangle } from '../src/core/shape/rectangle.js'; code at line number 104 in index.js.
  3. Creating a new rectangle.test.js file in the test/core/shapes folder.

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

Hitesh-Nagpure avatar Nov 21 '25 11:11 Hitesh-Nagpure

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.

LeXXik avatar Nov 22 '25 12:11 LeXXik

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.

willeastcott avatar Nov 22 '25 13:11 willeastcott