jeffeb3 / sandify

web based user interface to create patterns that could be useful for robots that draw in sand with ball bearings.
MIT License
190 stars 34 forks source link

redefine base model classes; restructure directories #259

Closed bobnik closed 1 year ago

bobnik commented 1 year ago

@jeffeb3 This is my attempt to reconcile our notes and discussions, and may not represent 100% what we have in our design notes.

Please take a look and we can chat as needed. I don't want to take this further without consensus.

jeffeb3 commented 1 year ago

I will carve out some time today to look at this in depth.

jeffeb3 commented 1 year ago

@bobnik I looked at this. It is in the right direction. I think it follows pretty close to our design discussions. There are still a few things that don't look right to me, but I am not sure if they are things to do in the future, or things that we still need to agree on.

For example, the Model has things like offsetX and offsetY. The layer and effect inherit from Model. I don't think either should. But these both need offsetX and offsetY options.

So there is still some work to be done (either to continue the changes, or teach me the right way to do it).

I don't see any reason to stop here though. This can be merged, and we can base future work on this.

bobnik commented 1 year ago

For example, the Model has things like offsetX and offsetY. The layer and effect inherit from Model. I don't think either should. But these both need offsetX and offsetY options.

@jeffeb3 Right. This is where we differ in opinion, but I am happy to be convinced otherwise. It may just be semantics. I don't think Model and Shape are different entities. To me, a Model is the highest base class for any customizable/renderer element, and contains attributes that are commonly needed (e.g., offsetX, offsetY, rotate, visible, etc.). From there, we specialize into Layer (shape and group) and Effect, adding attributes and custom draw/getVertices logic. I'm happy to chat live if you think we can hash this out more quickly.