-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a small data class for the return type of Optic.get*Shapes() #167
Comments
Actually, now that I see geometric-optics/js/common/model/Optic.js Lines 93 to 101 in 0f9ba7d
|
I agree. |
I created an OpticShapeCollection class that hosts all the shapes for rendering and ray hitting. In the process, I realized that the middleShape was unused and was therefore removed (see #171). Overall, that is a nice improvement, that simplifies the optic class. |
This is really excellent. I wasn't even thinking of being able to factor out the shape creation functions. This is a great divide of responsibility! Nice work.
Thanks! |
Looks like these still a bit of work to be done here, as suggested in #167 (comment). So self assigning. |
All recommendations have been implemented. Closing. |
I think it would be a bit more clear if instead of returning an object literal of shape keys, there was a private class that was a data type that stored those fields, and then the return type could be that class.
Something like
OpticShapeCollection
orOpticShapeStorage
orShapesForOptic
. Up to you if you want to do this.The text was updated successfully, but these errors were encountered: