Sketcher ConstrainSnellsLaw: Difference between revisions
Renatorivo (talk | contribs) (N) |
(Added a depiction of Snell's law) |
||
Line 4: | Line 4: | ||
==Description== |
==Description== |
||
[[Image:Snells law2 witheq.svg|thumb|left|200px|Snell's law]] |
|||
Constrains two lines to follow the law of refraction of light as it penetrates through an interface, where two materials of different refraction indices meet. See [http://en.wikipedia.org/wiki/Snell%27s_law Snell's law] on Wikipedia for more info. |
Constrains two lines to follow the law of refraction of light as it penetrates through an interface, where two materials of different refraction indices meet. See [http://en.wikipedia.org/wiki/Snell%27s_law Snell's law] on Wikipedia for more info. |
||
Revision as of 23:06, 12 January 2015
Under construction!
Constraint SnellsLaw |
Menu location |
---|
Sketch → Sketcher Constraints → Constrain refraction (Snell's law) |
Workbenches |
Sketcher, PartDesign |
Default shortcut |
None |
Introduced in version |
- |
See also |
None |
Description
Constrains two lines to follow the law of refraction of light as it penetrates through an interface, where two materials of different refraction indices meet. See Snell's law on Wikipedia for more info.
How to use
- You'll need two lines that are to follow a beam of light, and a curve to act as an interface. The lines should be on different sides of the interface.
- Select the endpoint of one line, an endpoint of another line, and the interface edge. The interface can be a line, circle/arc, ellipse/arc of ellipse. Note the order you've selected the endpoints.
- Invoke the constraint. A dialog will appear asking for a ratio of indices of refraction n2/n1. n2 corresponds to the medium where the second selected endpoint's line resides, n1 is for the first line.
- The endpoints will be made coincident (if needed), constrained onto the interface (if needed), and the Snell's law will become constrained.
Note that there are several helper constraints smart-added (point-on-object, coincident), and they can be deleted if they cause redundancy, or added manually if they were not added automatically. For the actual Snell's law constraint, the endpoints of lines must coincide and lie on the interface, otherwise the behavior is undefined.
Using polyline tool, it is possible to speedup drawing of rays of light. In this case, one can select two coincident endpoints by box selection.
Scripting
The ExampleCommandModel tool can by used in macros and from the python console by using the following function:
makeExampleCommandModel (Data, Data)
- Creates a CommandModel using Data.
- Returns the newly created object.
Example:
import FreeCAD, Base Base.makeExampleCommandModel(FreeCAD.Data,FreeCAD.Data)
Other
Optional