Skip to content
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

Add "arrow" representation for object #228

Closed
pixelzoom opened this issue Oct 14, 2021 · 18 comments
Closed

Add "arrow" representation for object #228

pixelzoom opened this issue Oct 14, 2021 · 18 comments

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Oct 14, 2021

While we're thinking about final design considerations for the public version of this sim...

Over in #217 (comment), I said:

  • It's difficult to add additional representations. For example, it will be difficult (impossible?) to support the classic "arrow" representation for the Object , like this example from Wikipedia:

screenshot_1315

In this representation, the arrow's tail is anchored to the optical axis. The arrow can be resized and translated along the optical axis. This representation has come up several time in design meetings.

So... Do you want to add the "arrow" representation for the object? (If there's a standard name for this representation, please chime in.) Since I'm planning to restructure things for #217, this would be the time to do it. But please think through the design implications. The arrow is very different than the other objects, because it can't be dragged freely, it's tail is anchored to the optical axis. The arrow can be resized (by dragging its tip up/down) or translated along the optical axis.

I don't know how difficult this will be. It will probably add ~20-40 hours to my original estimate. It will certainly be more expensive if we ignore it now and try to add it in the future.

@ariel-phet
Copy link

To me the sim feels incomplete without this representation. When we teach optics and the imaging equation, this is the representation we use. If I were a teacher using the sim, it is a request I would make to PhET. That is my personal opinion, but there are obviously various priorities on the project to balance. The sim is certainly still very valuable without this representation, but I do think it would be worth the effort.

@ariel-phet ariel-phet removed their assignment Oct 14, 2021
@pixelzoom
Copy link
Contributor Author

@ariel-phet said:

... When we teach optics and the imaging equation, this is the representation we use. ...

As someone who has recently come up to speed on this domain, I'll mention that this was indeed the representation that was used in the majority of web-based resources that I consulted.

@pixelzoom
Copy link
Contributor Author

pixelzoom commented Oct 21, 2021

10/21/2021 design meeting: @arouinfar @kathy-phet @ariel-phet

  • Yes, support arrow representation
  • Arrows should be reflect-able about the optical axis, and have a minimum height.
  • All things in the combo box will share a common position. If the position is too close to the optical axis when arrow is selected, the arrow will resize to its minimum height.
  • When "Second Point" is checked, add a second arrow.
  • Add the arrow to combo box for Lens and Mirror screens.

@pixelzoom pixelzoom assigned pixelzoom and unassigned kathy-phet and arouinfar Oct 21, 2021
@pixelzoom pixelzoom changed the title Add "arrow" representation for object? Add "arrow" representation for object Oct 25, 2021
@pixelzoom
Copy link
Contributor Author

pixelzoom commented Oct 28, 2021

Use dashed outline for virtual image arrow.

Vector addition arrows are a good first start for the "look".

@pixelzoom
Copy link
Contributor Author

From 12/20/21 meeting notes in design doc:

What should we call the arrow/vector representation?

“Vector” is too complicated for the audience and overloaded. Textbooks usually just refer to it as the “Object” but naming it by its appearance “Arrow” is most natural.

@pixelzoom
Copy link
Contributor Author

pixelzoom commented Jan 31, 2022

From #228 (comment):

All things in the combo box will share a common position. If the position is too close to the optical axis when arrow is selected, the arrow will resize to its minimum height.

I discussed this with @arouinfar, and we decided to modify this decision. The new structure of the sim will be divided into 3 scenes: framed object, arrows, light sources. The draggable thing (object or light source) in each scene will have a position, but position will not be shared across scenes.

This will prevent weird interactions like having to move a framed object because an arrow is too close to the optical axis.

@pixelzoom
Copy link
Contributor Author

Vector addition arrows are a good first start for the "look".

ArrowNode options in vector-addition are:

const VECTOR_ARROW_OPTIONS = {
  headWidth: 12,
  headHeight: 14,
  tailWidth: 3.5,
  stroke: null,
  isHeadDynamic: true,
  fractionalHeadHeight: 0.5
};

@pixelzoom
Copy link
Contributor Author

pixelzoom commented Feb 14, 2022

  • Min arrow length is 20 cm. Dragging is not constrained to this min. When dragging ends, the arrow snaps to its min length. (Be sure to test with keyboard!)

I'm wondering if this is the right thing to do. It's possible to set the arrow length to < 20 cm via PhET-iO/Studio, and it will not snap to 20 cm. I also need to add better handling for the case where the arrow length is zero while dragging, because that's going to cause problems with scaling.

@arouinfar
Copy link
Contributor

@pixelzoom I'm really loving the arrow scene. Your comments in #228 (comment) all sound reasonable to me, though I did notice one bug.

Drag-lock feature works for arrows. If you want to lock to a specific arrow length, press the drag-lock toggle button.

This is currently broken in master. I can still change the arrow height (with mouse and keyboard) when in the horizontal-only mode.

  • Min arrow length is 20 cm. Dragging is not constrained to this min. When dragging ends, the arrow snaps to its min length. (Be sure to test with keyboard!)

I'm wondering if this is the right thing to do. It's possible to set the arrow length to < 20 cm via PhET-iO/Studio, and it will not snap to 20 cm. I also need to add better handling for the case where the arrow length is zero while dragging, because that's going to cause problems with scaling.

I don't think there's anything fundamentally wrong with an arrow height < 20 cm (so long as it is a non-zero value). This seems similar to the discussion we had in last week's PhET-iO meeting about not enforcing constrainValue for Studio data entry. If a client sets the height to 10 cm, I don't think it needs to snap back to 20 cm.

@arouinfar arouinfar removed their assignment Feb 14, 2022
pixelzoom added a commit that referenced this issue Feb 14, 2022
@pixelzoom
Copy link
Contributor Author

This is currently broken in master. I can still change the arrow height (with mouse and keyboard) when in the horizontal-only mode.

Whoopsie. Fixed in master. I won't make you review it again. Closing.

@pixelzoom pixelzoom reopened this Feb 14, 2022
@pixelzoom
Copy link
Contributor Author

Reopening. @ariel-phet noted that the drag bounds are incorrect. The arrow can currently be dragged through (and to the right of) the optic.

pixelzoom added a commit that referenced this issue Feb 14, 2022
@ariel-phet
Copy link

Discussed with @pixelzoom and @arouinfar and made some changes. We made modifications that make this representation more like the representation commonly seen in ray diagrams.

  • The arrow now has a thin tail
  • The magnitude of the arrow scales (but the tail does not get thinner or thicker)

Since the arrow is meant to be more of a 1d representation the current implementation now better reflects that idea.

@pixelzoom
Copy link
Contributor Author

Changes discussed with @ariel-phet and @arouinfar were completed in ba4ca49. One remaining change is being tracked in #312 (separate opacity range for arrow).

This feature is schedule for review at 2/17 design meeting, so I'll leave it open until that's been done.

@pixelzoom
Copy link
Contributor Author

pixelzoom commented Feb 17, 2022

2/17/22 design meeting:

Reorder the combo box as follows:

Pencil (default)
Penguin
Arrow
Light

Delete the Planet and Star objects (enumeration values, images, strings).

@pixelzoom
Copy link
Contributor Author

Change requests from #228 (comment) have been completed. @arouinfar please review, feel free to close.

@arouinfar
Copy link
Contributor

Thanks @pixelzoom. I reviewed in Studio to make sure the Planet & Star were also gone from the tree/enum. Everything looks good.

pixelzoom added a commit that referenced this issue Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants