phetsims / charges-and-fields

"Charges And Fields" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
8 stars 7 forks source link

Snap to grid feature? #98

Open ariel-phet opened 8 years ago

ariel-phet commented 8 years ago

@arouinfar

From an unfuddle issue:

Currently the location of the electric field vectors are not on the same coordinate system as "grid". This has the unfortunate effect of making a point charge not look the textbooks with the field lines being symmetric and radially outward. (see attached) They are correct, but visually are a bit disconcerting.

It would be great if the spacing were 0.25 m for the location of the electric field vectors and coincident with the grid axes. This way if you chose to put a charge on a grid intersection the field would be clearer.

Unfortunately, I don't think I had reviewed the unfuddle tickets for this sim (my miss, and might have been before we had a solid process in place)

I don't think the suggestion above is a good idea (I can see why Mike chose the arrangement he did - if you place a charge at the major intersections of the grid, the field points radially outward as shown below)

point charge

However, we could possibly consider a snap to grid feature (a checkbox that can be activated when you activate the grid) We would definitely not want such snapping to grid to be default.

Let me know if you think this might be a useful feature. If so I might discuss with @andrewadare on how long it would be to implement (but likely would go into a V2)

arouinfar commented 8 years ago

I don't think the suggestion above is a good idea

I agree. Earlier in the design process there was some discussions about the locations of the field arrows within the grid. In Flash, the E-field arrows were located on grid lines, but the major intersections didn't hold much importance. image

We deliberately shifted the grid a bit so that the charges placed on the intersections of major gridlines would show the radial pattern in @ariel-phet's screenshot. We also spaced the E-field arrows out so that they would have consistent placement on the grid. These changes satisfied a user suggestion from #25.

we could possibly consider a snap to grid feature (a checkbox that can be activated when you activate the grid) We would definitely not want such snapping to grid to be default.

I think this would be a nice feature to consider for v2, and agree that we'd want it off by default. I could see this being particularly useful when it comes to keyboard navigation.

andrewadare commented 8 years ago

I don't (yet) know how to implement this, but I'm sure it's just a matter of pinging the more experienced developers to point out some comparable examples. I assume this should not hold up RC1, but we can leave this issue open for version 2.

arouinfar commented 8 years ago

@andrewadare I don't think @ariel-phet meant rc.2 - I certainly didn't. I don't imagine we want this to hold back publication of the sim, but this feature could be in a future version.

ariel-phet commented 8 years ago

@andrewadare correct, this would be a feature to consider after the sim is published, for a new release at some point

ariel-phet commented 8 years ago

Unassigning for the moment

andrewadare commented 8 years ago

On hold; reconsider for Charges and Fields 2.0.

veillette commented 7 years ago

This feature is relatively easy to implement. Should the feature exists only for the charges or applies to the electric sensors and the electricPotential tool as well?

arouinfar commented 7 years ago

@veillette I think we would want to add a nested checkbox beneath Grid -- not sure what we would call it. When on, the charges and sensors would snap to the grid intersections. I hadn't thought about locking the electricPotential tool to the grid, but it may also be nice to snap its crosshairs to the grid, as well. What do you think @ariel-phet?

ariel-phet commented 7 years ago

@arouinfar @veillette I think if we make a "snap to grid" it would make sense to snap everything to the grid while that feature was active. It might be handy for making certain charge arrangements (especially symmetric ones)

ariel-phet commented 7 years ago

Since @veillette says the feature is easy to implement, putting it at low priority if he desires to work on it.

veillette commented 7 years ago

In the process of implementing this feature, there are additional questions that crop up. I have not committed anything yet.

Here is the panel image

I've put a placeholder string until we find an appropriate value.

My first question is the behavior if we checked off grid but snapped to grid is still checked on. image

-Should the snap to grid behavior be disabled in this case?

My second question is the behavior of the charges and other components when the client is checking the snap to grid feature.

My third question is regarding which grid I should used to snap on the charge. Your picture of a charge is snapped to the major gridlines.

Not to bias you or anything, here are my choices. (1) disabled (2) snapped to grid all previous charges (3) user minor and major

I asked a physics faculty to test drive the simulation. His answers were (1) disabled (2) snapped to grid only after drag event (3) use minor and major

He also liked to that the sensors can be snapped to the grid, although personally after using the simulation for a while, I would only snapped the charges to the grid.

Assigning to @arouinfar for your input.

veillette commented 7 years ago

One more question, should we snap the measuring tape as well ?

arouinfar commented 7 years ago

I've put a placeholder string until we find an appropriate value.

@veillette I think "Snap to Grid" is straightforward, and I haven't thought of anything cleverer, so let's go with that for now. To be a bit nitpicky, I would recommend that we consistently use title casing, so "to" should be lowercase, and "Only" in "Direction only" should be capitalized.

To answer your questions:

(1) Disabled, but still visibly checked/grayed out. I think the behavior should mirror the Electric Field/Direction Only relationship. If Electric Field is unchecked, Direction Only can remain checked -- but it's moot. There is no visible electric field, so nothing to show the direction of. The same could be argued for Grid/Snap to Grid. When Grid is off, there is no grid to snap to. The nested checkbox can still be grayed out and checked, but technically the feature is turned off until Grid is turned back on.

(2) I think charges already in the play area should snap to the nearest grid intersection when Snap to Grid is activated.

(3) Snap to any grid intersection, major or minor

He also liked to that the sensors can be snapped to the grid, although personally after using the simulation for a while, I would only snapped the charges to the grid.

I could make an argument either way. On one hand, snapping the sensors to the grid allows for a more precise measurement of the field. On the other hand, it could be difficult to show that the E-field is perpendicular to the equipotential curve if the sensors must be snapped to the grid. However, this could be demonstrated easily with Snap to Grid turned off, so I'm still in favor of snapping the sensors to the grid.

Should we snap the measuring tape as well ?

Great question. If we snap the crosshairs of the equipotential tool to the grid, then we should do the same with the measuring tape. Snapping the equipotential tool to the grid would ensure the equipotential curve is being drawn at a precise distance from the charges (for that one point, at least), which could be helpful.

@veillette I'd also like to point out that there were several issues related to overlapping charges or discontinuities that cropped up in QA testing (such as #46, #82, #84, #85, #88, #89). While these issues were all addressed before publication, it's possible that snapping things to the exact same location may cause some related side effects.

veillette commented 7 years ago

Thanks @arouinfar for pointing out all the previous issues. The snappingToGrid feature needs a model that handles well infinity. Scenarios that used to be corner cases will be much more prevalent.

veillette commented 7 years ago

@arouinfar, I commited the changes according to your request. I created a separate issue #126 on how we should handle charges that are overlapping since there is a much higher likelihood of having multiple overlapping charges with the snap to grid features.

In addition, we will need someone to review this commit since it involves PhET-IO which i was not able to able to test.

However, this should not prevent you from testing out the features on master. Let me know if it is working as expected or if it needs any adjustments.

arouinfar commented 7 years ago

@veillette I really like the snap to grid feature! It's easy to use, and I love being able to create symmetric arrangements.

I ran into one situation where the charge was delayed in snapping to the grid. To reproduce:

  1. Turn on Grid, then purposely place a charge so that it is misaligned to the grid
  2. Turn on Snap to Grid, the charge snaps to the nearest grid intersection (as it should)
  3. Turn off Grid (Snap to Grid is checked but grayed out) and move the charge
  4. Turn on Grid, charge is misaligned to grid but doesn't snap
  5. Click on charge, it snaps to the grid
arouinfar commented 7 years ago

@veillette I also like that the equipotential tool displays infinity when snapped on top of a charge, but I would prefer to use the symbol, rather than the word.

veillette commented 7 years ago

The display infinity is being tracked in a separate issue ( #127)

oliver-phet commented 6 years ago

This was requested by another user on March 7, 2018:

I created a lab using the charges and fields simulation, where the students determine the value of k. In talking about errors in measurement, several students commented that it would be nice if there was an option for “snap to grid”. I thought I would send you a note to put the idea out there.

arouinfar commented 6 years ago

@ariel-phet do you think there would be any bandwidth to deal with this issue any time soon?

arouinfar commented 6 years ago

I believe everything has been implemented (except for #127) and the changes still need to go through QA testing.

ariel-phet commented 6 years ago

@arouinfar let me ask @veillette - he has been dedicating a bit of time to PhET this semester with mentoring students, and he might have time to polish this off.

ariel-phet commented 6 years ago

@veillette said:

Sure, I'd be happy to. I'll do it over the weekend. Martin

oliver-phet commented 4 years ago

In ES6 migration testing, I noticed using the Reset All button does not uncheck "Snap to Grid".

oliver-phet commented 4 years ago

Another user emailed phethelp with this request. I'll let them know when this is published.

the size of the charges makes it difficult to place them it would be nice if there was an option to “lock” them into a specific grid position this would also help in measure the distances with the tape measure, along with a “fine tuning” ability to better control the placement of the tape measure and the distance increments. My “mouse control” is also a tad bit problematic.

oliver-phet commented 3 years ago

Another email:

I would like a "Snap to Grid" option for placing charges. It would help me make lines of charge.