phetsims / capacitor-lab-basics

"Capacitor Lab: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 4 forks source link

[kite] Constructive Area Geometry #176

Closed jonathanolson closed 7 years ago

jonathanolson commented 7 years ago

Seems like it would be helpful:

// Previously, this was built up using constructional area geometry

This sim uses a lot of Shapes. @andrewadare and @pixelzoom, do you know what could be gained by using this instead?

pixelzoom commented 7 years ago

Not sure at this point, and my memory of Capacitor Lab is fuzzy. I seem to recall that the Java version leaned heavily on CAG. So if there's still stuff to be ported from Java, it would probably make porting easier.

pixelzoom commented 7 years ago

Might ask @jessegreenberg also, since he did the HMTL5 port.

jessegreenberg commented 7 years ago

If CAG were available it would have simplified the port a bit. The wires, dielectric boxes, and capacitor plates all used CAG in the Java. Instead of adding shapes with CAG, I drew shapes in the view in an order that produced the correct look. The wires use a different workaround with getStrokedShape.

For the full Capacitor Lab, dielectrics and new wire segments should be able to use what has already been ported (WireShapeCreator and BoxShapeCreator). CAG could simplify what has already been ported, but shouldn't be necessary moving forward.

If multiple shapes and paths create performance issues for this sim, CAG might help.

jonathanolson commented 7 years ago

I've reviewed all places in the sim where Shape occurs, so I believe I've hit all of these with CAG.

Closing.