phetsims / circuit-construction-kit-common

"Circuit Construction Kit: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
10 stars 10 forks source link

Vertex pushing #128

Closed phet-steele closed 8 years ago

phet-steele commented 8 years ago

Black box vertices can be pushed around when following this procedure. I feel like someone has reported/mentioned this before, but here it is anyway. This "pushing" affects the vertices in Investigate mode, and the pre-made "revealed" circuits:

cckbb04

For #126.

arouinfar commented 8 years ago

@phet-steele mentioned this is likely related to #125.

samreid commented 8 years ago

I think we should add a rule that components cannot be connected when outside of the black box in build mode.

samreid commented 8 years ago

I added a rule in #113 that the interface vertices cannot be moved, it seems to have covered this case, closing.

samreid commented 8 years ago

Or shall I say, fixed pending testing.

samreid commented 8 years ago

Ready for testing in https://github.com/phetsims/circuit-construction-kit/issues/134

arouinfar commented 8 years ago

Something's still not quite right here @samreid.

I think we should add a rule that components cannot be connected when outside of the black box in build mode.

If I connect a fixed-length component to the outside of the black box in Build mode, it remains outside. I can continue to build outside of the black box if I connect other fixed-length components to the first one.

externalnodes

After deleting the battery attached to the black box, the other battery floats in the playspace. It does not snap to the inside of the black box until it is clicked.

To avoid this issue, would it be possible for fixed-length components to rotate into the black box if they are connected to a black box vertex from the outside? Sort of like this: batteryrotation

Assigning to @phet-steele to be on the lookout for additional related issues when he works on #134.

samreid commented 8 years ago

I'll move the "connecting objects outside the black box" to a new issue, and this issue can remain to be focused on vertex pushing.

samreid commented 8 years ago

@arouinfar now that the "connecting objects outside the black box" is moved to a separate issue, can this issue (about vertex pushing) be closed?

EDIT: On second thought, I'll go with the above recommendation:

Assigning to @phet-steele to be on the lookout for additional related issues when he works on #134.

arouinfar commented 8 years ago

@samreid I ran into another instance of vertex pushing. If a fixed-length component is in the path of a wire that snaps into the box, such that their vertices are within the snap-to-connect distance, it's possible for the vertex of the fixed-length component to be dislocated. vertexpushing2

samreid commented 8 years ago

Thanks @arouinfar, this may be solved if we expand the rules of #136 to say that a component cannot propose a connection inside a black box if any of its vertices are outside of the black box. Sound like it is worth investigating?

arouinfar commented 8 years ago

@samreid that sounds like a reasonable rule. Please look into it.

samreid commented 8 years ago

I implemented that as described and it seems like it is working well. Will be ready for testing in next version.

samreid commented 8 years ago

Please refer to https://github.com/phetsims/circuit-construction-kit/issues/140 for testing.

phet-steele commented 8 years ago

@samreid the procedure in https://github.com/phetsims/circuit-construction-kit/issues/128#issuecomment-226837158 still happens in 1.0.0-dev.17.

phet-steele commented 8 years ago

@arouinfar @samreid aside from the issues pointed out in #141, I'm not a huge fan of this proposed rule (https://github.com/phetsims/circuit-construction-kit/issues/128#issuecomment-226837685) in general. It is not good at handling vertices along the top and bottom of the black box. It's very frustrating to try to make connections and also causes some intense flickering while dragging (not captured well in this low frame rate video): cckbb08

samreid commented 8 years ago

Proposed fix above. I expanded the black box bounds outward so that the black box vertices are in bounds and it seems to help. This will need testing. Will moving the black box bounds outward cause other problems? Let's find out in the next test version.

samreid commented 8 years ago

Testing issue linked above.

phet-steele commented 8 years ago

@samreid I'm still getting a lot of flickering.

samreid commented 8 years ago

Same as in https://github.com/phetsims/circuit-construction-kit-common/issues/128#issuecomment-227498773 ?

phet-steele commented 8 years ago

@samreid yes

samreid commented 8 years ago

Are you still seeing flickering for perfectly horizontal components, or only for near-horizontal components?

phet-steele commented 8 years ago

Only near-horizontal. The initial drag from the component box performs optimally.

samreid commented 8 years ago

I'll move this last issue to a new separate issue.

phet-steele commented 8 years ago

@samreid I believe https://github.com/phetsims/circuit-construction-kit-common/issues/128#issuecomment-226837158 is still present.

samreid commented 8 years ago

Thanks @phet-steele, I'll create a specific issue for that problem.

samreid commented 8 years ago

Tracking the remaining issue in #173, closing.