optics library (next idea)

View: New views
4 Messages — Rating Filter:   Alert me  

optics library (next idea)

by Christophe Jorssen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all,

I've done a bit of work on the optics library I posted yesterday. I
define an object shape for a given lens and anchors are computed so
that an image by the given lens is defined.

Here is the code. In order not to disturb the list, I'll post the
future code on my blog. Again, any comments or suggestions are
welcomed.

\documentclass{minimal}

\makeatletter

\usepackage{tikz}

\usetikzlibrary{arrows,calc,decorations.markings}

\tikzset{>=stealth}

\pgfarrowsdeclaredouble{doublestealth}{doublestealth}{stealth}{stealth}
\pgfarrowsdeclaretriple{triplestealth}{triplestealth}{stealth}{stealth}
\pgfarrowsdeclaredouble{quadruplestealth}{quadruplestealth}%
  {doublestealth}{doublestealth}
\pgfarrowsdeclarecombine{quintuplestealth}{quintuplestealth}{triplestealth}%
  {triplestealth}{doublestealth}{doublestealth}
\pgfarrowsdeclaredouble{sextuplestealth}{sextuplestealth}%
  {triplestealth}{triplestealth}
\pgfarrowsdeclarealias{<<}{>>}{doublestealth}{doublestealth}
\pgfarrowsdeclarealias{<<<}{>>>}{triplestealth}{triplestealth}
\pgfarrowsdeclarealias{<<<<}{>>>>}{quadruplestealth}{quadruplestealth}
\pgfarrowsdeclarealias{<<<<<}{>>>>>}{quintuplestealth}{quintuplestealth}
\pgfarrowsdeclarealias{<<<<<<}{>>>>>>}{sextuplestealth}{sextuplestealth}
% Some new arrows for spherical mirrors (based on angle 90 arrows)
\pgfarrowsdeclare{half angle 90}{half angle 90}
{
  \pgfutil@tempdima=0.3pt%
  \advance\pgfutil@tempdima by.25\pgflinewidth%
  \pgfutil@tempdimb=5.5\pgfutil@tempdima
  \advance\pgfutil@tempdimb by.5\pgflinewidth%
%  \pgfarrowsleftextend{+-\pgfutil@tempdimb}
  \pgfarrowsleftextend{0pt}
  \pgfutil@tempdimb=.5\pgfutil@tempdima
  \advance\pgfutil@tempdimb by0.707\pgflinewidth%
  \pgfarrowsrightextend{+\pgfutil@tempdimb}
}
{
  \pgfutil@tempdima=0.3pt%
  \advance\pgfutil@tempdima by.25\pgflinewidth%
  \pgfsetdash{}{+0pt}
  \pgfsetroundcap
  \pgfsetmiterjoin
  \pgfpathmoveto{\pgfqpoint{-5.5\pgfutil@tempdima}{-6\pgfutil@tempdima}}
  \pgfpathlineto{\pgfqpoint{0.5\pgfutil@tempdima}{0\pgfutil@tempdima}}
  \pgfusepathqstroke
}
\pgfarrowsdeclarereversed{half angle 90 reversed}{half angle 90
  reversed}{half angle 90}{half angle 90}

\pgfarrowsdeclare{other half angle 90}{other half angle 90}
{
  \pgfutil@tempdima=0.3pt%
  \advance\pgfutil@tempdima by.25\pgflinewidth%
  \pgfutil@tempdimb=5.5\pgfutil@tempdima
  \advance\pgfutil@tempdimb by.5\pgflinewidth%
%  \pgfarrowsleftextend{+-\pgfutil@tempdimb}
  \pgfarrowsleftextend{0pt}
  \pgfutil@tempdimb=.5\pgfutil@tempdima
  \advance\pgfutil@tempdimb by0.707\pgflinewidth%
  \pgfarrowsrightextend{+\pgfutil@tempdimb}
}
{
  \pgfutil@tempdima=0.3pt%
  \advance\pgfutil@tempdima by.25\pgflinewidth%
  \pgfsetdash{}{+0pt}
  \pgfsetroundcap
  \pgfsetmiterjoin
  \pgfpathmoveto{\pgfqpoint{0.5\pgfutil@tempdima}{0\pgfutil@tempdima}}
  \pgfpathlineto{\pgfqpoint{-5.5\pgfutil@tempdima}{6\pgfutil@tempdima}}
  \pgfusepathqstroke
}
\pgfarrowsdeclarereversed{other half angle 90 reversed}{other half angle 90
  reversed}{other half angle 90}{other half angle 90}

\tikzset{optics/.is family}
\pgfkeysdef{/tikz/optics/image focal length}{%
  \pgfmathsetlengthmacro\pgfopticsimagefocallength{#1}}
\pgfkeysdef{/tikz/optics/object focal length}{%
  \pgfmathsetlengthmacro\pgfopticsobjectfocallength{#1}}
\pgfkeysdef{/tikz/optics/distance from center to top}{%
  \pgfmathsetlengthmacro\pgfopticsdistancefromcentertotop{#1}}
\pgfkeysdef{/tikz/optics/distance from center to bottom}{%
  \pgfmathsetlengthmacro\pgfopticsdistancefromcentertobottom{#1}}
\pgfkeysdef{/tikz/optics/radius}{%
  \pgfmathsetlengthmacro\pgfopticsradius{#1}}

\tikzset{%
  optics,
  image focal length=2cm,
  object focal length=-\pgfopticsimagefocallength,
  distance from center to top=3cm,
  distance from center to bottom=\pgfopticsdistancefromcentertotop,
  radius=4cm
  }

\pgfdeclareshape{plane optical system}{%
  \anchor{center}{\pgfpointorigin}
  \anchor{image focus}{%
    \pgf@x=\pgfopticsimagefocallength\relax
    \pgf@y=\z@}
  \anchor{object focus}{%
    \pgf@x=\pgfopticsobjectfocallength\relax
    \pgf@y=\z@}
  \savedanchor{\toppoint}{%
    \pgf@x=\z@
    \pgf@y=\pgfopticsdistancefromcentertotop}
  \anchor{top}{\toppoint}
  \savedanchor{\bottompoint}{%
    \pgf@x=\z@
    \pgf@y=-\pgfopticsdistancefromcentertobottom}
  \anchor{bottom}{\bottompoint}
  \anchor{image focal plane top}{%
    \pgf@x=\pgfopticsimagefocallength\relax
    \pgf@y=\pgfopticsdistancefromcentertotop}
  \anchor{image focal plane bottom}{%
    \pgf@x=\pgfopticsimagefocallength\relax
    \pgf@y=-\pgfopticsdistancefromcentertobottom}
  \anchor{object focal plane top}{%
    \pgf@x=\pgfopticsobjectfocallength\relax
    \pgf@y=\pgfopticsdistancefromcentertotop}
  \anchor{object focal plane bottom}{%
    \pgf@x=\pgfopticsobjectfocallength\relax
    \pgf@y=-\pgfopticsdistancefromcentertobottom}
  %
}

\pgfdeclareshape{converging lens}{%
  \inheritanchor[from=plane optical system]{center}
  \inheritanchor[from=plane optical system]{top}
  \inheritanchor[from=plane optical system]{bottom}
  \inheritanchor[from=plane optical system]{image focus}
  \inheritanchor[from=plane optical system]{object focus}
  \inheritanchor[from=plane optical system]{image focal plane top}
  \inheritanchor[from=plane optical system]{image focal plane bottom}
  \inheritanchor[from=plane optical system]{object focal plane top}
  \inheritanchor[from=plane optical system]{object focal plane bottom}
  \inheritsavedanchors[from=plane optical system]
  \backgroundpath{%
    \pgfsetarrows{stealth-stealth}
    \pgfsetlinewidth{1.6pt}
    \toppoint
    \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
    \bottompoint
    \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@y}}}
}

\pgfdeclareshape{diverging lens}{%
  \inheritanchor[from=plane optical system]{center}
  \inheritanchor[from=plane optical system]{top}
  \inheritanchor[from=plane optical system]{bottom}
  \inheritanchor[from=plane optical system]{image focus}
  \inheritanchor[from=plane optical system]{object focus}
  \inheritanchor[from=plane optical system]{image focal plane top}
  \inheritanchor[from=plane optical system]{image focal plane bottom}
  \inheritanchor[from=plane optical system]{object focal plane top}
  \inheritanchor[from=plane optical system]{object focal plane bottom}
  \inheritsavedanchors[from=plane optical system]
  \backgroundpath{%
    \pgfsetarrows{stealth reversed-stealth reversed}
    \pgfsetlinewidth{1.6pt}
    \toppoint
    \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
    \bottompoint
    \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@y}}}
}

\pgfdeclareshape{diverging lens}{%
  \inheritanchor[from=plane optical system]{center}
  \inheritanchor[from=plane optical system]{top}
  \inheritanchor[from=plane optical system]{bottom}
  \inheritanchor[from=plane optical system]{image focus}
  \inheritanchor[from=plane optical system]{object focus}
  \inheritanchor[from=plane optical system]{image focal plane top}
  \inheritanchor[from=plane optical system]{image focal plane bottom}
  \inheritanchor[from=plane optical system]{object focal plane top}
  \inheritanchor[from=plane optical system]{object focal plane bottom}
  \inheritsavedanchors[from=plane optical system]
  \backgroundpath{%
    \pgfsetarrows{stealth reversed-stealth reversed}
    \pgfsetlinewidth{1.6pt}
    \toppoint
    \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
    \bottompoint
    \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@y}}}
}

\pgfdeclareshape{converging mirror}{%
  \anchor{edge}{\pgfpointorigin}
  \anchor{center}{%
    \pgf@x=-\pgfopticsradius
    \pgf@y=\z@}
  \inheritanchor[from=plane optical system]{top}
  \inheritanchor[from=plane optical system]{bottom}
  \inheritanchor[from=plane optical system]{image focus}
  \inheritanchor[from=plane optical system]{object focus}
  \inheritanchor[from=plane optical system]{image focal plane top}
  \inheritanchor[from=plane optical system]{image focal plane bottom}
  \inheritanchor[from=plane optical system]{object focal plane top}
  \inheritanchor[from=plane optical system]{object focal plane bottom}
  \inheritsavedanchors[from=plane optical system]
  \backgroundpath{%
    \pgfdecorationsegmentlength=.25cm
    \pgfdecorationsegmentamplitude=.25cm
    \def\pgfdecorationangle{-135}%
    \pgfsetlinewidth{.8pt}
    \pgfdecoratepath{border alternate}{%
      \toppoint
      \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
      \bottompoint
      \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@y}}}
    \pgfusepath{stroke}
    \pgfsetarrowsend{half angle 90 reversed}
    \pgfsetarrowsstart{other half angle 90 reversed}
    \pgfsetlinewidth{1.6pt}
    \toppoint
    \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
    \bottompoint
    \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@y}}}
}

\pgfdeclareshape{diverging mirror}{%
  \anchor{edge}{\pgfpointorigin}
  \anchor{center}{%
    \pgf@x=-\pgfopticsradius
    \pgf@y=\z@}
  \inheritanchor[from=plane optical system]{top}
  \inheritanchor[from=plane optical system]{bottom}
  \inheritanchor[from=plane optical system]{image focus}
  \inheritanchor[from=plane optical system]{object focus}
  \inheritanchor[from=plane optical system]{image focal plane top}
  \inheritanchor[from=plane optical system]{image focal plane bottom}
  \inheritanchor[from=plane optical system]{object focal plane top}
  \inheritanchor[from=plane optical system]{object focal plane bottom}
  \inheritsavedanchors[from=plane optical system]
  \backgroundpath{%
    \pgfdecorationsegmentlength=.25cm
    \pgfdecorationsegmentamplitude=.25cm
    \def\pgfdecorationangle{-135}%
    \pgfsetlinewidth{.8pt}
    \pgfdecoratepath{border alternate}{%
      \toppoint
      \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
      \bottompoint
      \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@y}}}
    \pgfusepath{stroke}
    \pgfsetarrowsstart{half angle 90 reversed}
    \pgfsetarrowsend{other half angle 90 reversed}
    \pgfsetlinewidth{1.6pt}
    \toppoint
    \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
    \bottompoint
    \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@y}}}
}

\pgfdeclareshape{plane mirror}{%
  \inheritanchor[from=plane optical system]{center}
  \inheritanchor[from=plane optical system]{top}
  \inheritanchor[from=plane optical system]{bottom}
  \inheritsavedanchors[from=plane optical system]
  \backgroundpath{%
    \pgfdecorationsegmentlength=.25cm
    \pgfdecorationsegmentamplitude=.25cm
    \def\pgfdecorationangle{-135}%
    \pgfsetlinewidth{.8pt}
    \pgfdecoratepath{border alternate}{%
      \toppoint
      \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
      \bottompoint
      \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@y}}}
    \pgfusepath{stroke}
    \pgfsetlinewidth{1.6pt}
    \toppoint
    \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
    \bottompoint
    \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@y}}}
}
%
\tikzset{every converging lens node/.style={draw}}
\tikzset{every diverging lens node/.style={draw}}
\tikzset{every converging mirror node/.style={draw}}
\tikzset{every diverging mirror node/.style={draw}}
\tikzset{every plane mirror node/.style={draw}}
%
\tikzset{%
  LR/.style 2 args= {%
    decoration={markings,mark=at position #2 with {\arrow{#1};}},
    postaction={decorate},
    thick,gray},
  VirtualLR/.style = {thick,dashed},
  LR>/.style = {LR={>}{#1}},
  LR>/.default = {0.5},
  LR>>/.style = {LR={>>}{#1}},
  LR>>/.default = {0.55},
  LR>>>/.style = {LR={>>>}{#1}},
  LR>>>/.default = {0.6},
  LR>>>>/.style = {LR={>>>>}{#1}},
  LR>>>>/.default = {0.65},
  LR>>>>>/.style = {LR={>>>>>}{#1}},
  LR>>>>>/.default = {0.7},
  LR>>>>>>/.style = {LR={>>>>>>}{#1}},
  LR>>>>>>/.default = {0.75},
  Interface/.style = {ultra thick},
  OpticalAxis/.style = {very thick,->}}

\tikzset{Medium/.style = {fill=gray,nearly transparent}}

\pgfdeclaredecoration{border alternate}{tick}{%
  \state{tick}[switch if less than=+\pgfdecorationsegmentlength to final,
               width=+\pgfdecorationsegmentlength]{%
    \pgfpathmoveto{\pgfpointorigin}
    \pgfpathlineto{%
      \pgfpointpolar{%
        \pgfdecorationsegmentangle}{+\pgfdecorationsegmentamplitude}}}
  \state{final}{%
    \pgfpathmoveto{\pgfpointorigin}
    \pgfpathlineto{%
      \pgfpointpolar{%
        \pgfdecorationsegmentangle}{+\pgfdecorationsegmentamplitude}}
    \pgfpathmoveto{\pgfpointdecoratedpathlast}}
}


\pgfdeclareshape{mark point |}{%
  \anchor{center}{\pgfpointorigin}
  \savedanchor{\centerpoint}{\pgfpointorigin}
  \savedanchor{\north}{\pgfpointorigin}
  \savedanchor{\south}{\pgfpointorigin}
  \savedanchor{\east}{\pgfpointorigin}
  \savedanchor{\west}{\pgfpointorigin}
  \savedanchor{\northeast}{\pgfpointorigin}
  \savedanchor{\northwest}{\pgfpointorigin}
  \savedanchor{\southeast}{\pgfpointorigin}
  \savedanchor{\southwest}{\pgfpointorigin}
  \backgroundpath{%
    \pgfsetlinewidth{.8pt}
    \pgfpathmoveto{\pgfpoint{0}{.8mm}}
    \pgfpathlineto{\pgfpoint{0}{-.8mm}}
    \pgfusepath{stroke}}}
\pgfdeclareshape{mark point +}{%
  \anchor{center}{\pgfpointorigin}
  \inheritsavedanchors[from=mark point |]
  \backgroundpath{%
    \pgfsetlinewidth{.8pt}
    \pgfpathmoveto{\pgfpoint{0}{.8mm}}
    \pgfpathlineto{\pgfpoint{0}{-.8mm}}
    \pgfpathmoveto{\pgfpoint{-.8mm}{0}}
    \pgfpathlineto{\pgfpoint{.8mm}{0}}
    \pgfusepath{stroke}}}
\pgfdeclareshape{mark point -}{%
  \anchor{center}{\pgfpointorigin}
  \inheritsavedanchors[from=mark point |]
  \backgroundpath{%
    \pgfsetlinewidth{.8pt}
    \pgfpathmoveto{\pgfpoint{-.8mm}{0}}
    \pgfpathlineto{\pgfpoint{.8mm}{0}}
    \pgfusepath{stroke}}}

\pgfkeysdef{/tikz/optics/object heigth}{%
  \pgfmathsetlengthmacro\pgfopticsobjectheigth{#1}}
\pgfkeysdef{/tikz/optics/given lens}{%
  \edef\pgfopticsgivenlens{#1}}

\tikzset{optics,
  object heigth=2cm,
  given lens=Lens1}

\pgfdeclareshape{object for a given lens}{%
  \savedmacro{\objectheigth}{\let\objectheigth\pgfopticsobjectheigth}
  \savedmacro{\givenlens}{\let\givenlens\pgfopticsgivenlens}
  \savedanchor{\bottom}{\pgfpointorigin}
  \anchor{bottom}{\bottom}
  \savedanchor{\top}{%
    \pgf@x=\z@
    \pgf@y=\objectheigth}
  \anchor{top}{\top}
  \savedanchor{\objecttopongivenlens}{%
    \pgf@xc=\z@
    \pgf@yc=\objectheigth
    \pgf@process{%
      \pgfpointanchor{\givenlens}{center}}
    \pgf@xb=\pgf@x
    \pgf@yb=\pgf@y
    \pgf@process{%
      \pgfpointanchor{\givenlens}{top}}%
      % The following code is taken from tikzlibrarycalc.code.tex
      % Ok, now we need to project (xc,yc) on the line (xb,yb) to (x,y)
      \advance\pgf@x by-\pgf@xb
      \advance\pgf@y by-\pgf@yb
      \advance\pgf@xc by-\pgf@xb
      \advance\pgf@yc by-\pgf@yb
      \pgf@process{\pgfpointnormalised{}}%
      % Scalar product
      \pgf@xc=\pgf@sys@tonumber{\pgf@xc}\pgf@x
      \advance\pgf@xc by\pgf@sys@tonumber{\pgf@yc}\pgf@y
      % and add
      \advance\pgf@xb by\pgf@sys@tonumber{\pgf@xc}\pgf@x
      \advance\pgf@yb by\pgf@sys@tonumber{\pgf@xc}\pgf@y
      % End of borrowed code
      \pgf@x=\pgf@xb
      \pgf@y=\pgf@yb}
  \anchor{object top on \pgfopticsgivenlens}{\objecttopongivenlens}
  \savedanchor{\imagetopbygivenlens}{%
    \pgf@xc=\z@
    \pgf@yc=\objectheigth
    \pgf@process{%
      \pgfpointanchor{\givenlens}{center}}
    \pgf@xb=\pgf@x
    \pgf@yb=\pgf@y
    \pgf@process{%
      \pgfpointanchor{\givenlens}{top}}%
      % The following code is taken from tikzlibrarycalc.code.tex
      % Ok, now we need to project (xc,yc) on the line (xb,yb) to (x,y)
      \advance\pgf@x by-\pgf@xb
      \advance\pgf@y by-\pgf@yb
      \advance\pgf@xc by-\pgf@xb
      \advance\pgf@yc by-\pgf@yb
      \pgf@process{\pgfpointnormalised{}}%
      % Scalar product
      \pgf@xc=\pgf@sys@tonumber{\pgf@xc}\pgf@x
      \advance\pgf@xc by\pgf@sys@tonumber{\pgf@yc}\pgf@y
      % and add
      \advance\pgf@xb by\pgf@sys@tonumber{\pgf@xc}\pgf@x
      \advance\pgf@yb by\pgf@sys@tonumber{\pgf@xc}\pgf@y
      % End of borrowed code
    %
    \edef\pgf@optics@temp{%
      \noexpand\pgfpointintersectionoflines
      {\noexpand\pgfpoint{0pt}{\objectheigth}}
      {\noexpand\pgfpointanchor{\givenlens}{center}}
      {\noexpand\pgfpoint{\the\pgf@xb}{\the\pgf@yb}}
      {\noexpand\pgfpointanchor{\givenlens}{image focus}}%
    }%
    \pgf@process{\pgf@optics@temp}}
  \anchor{image top by \pgfopticsgivenlens}{\imagetopbygivenlens}
  \backgroundpath{%
    \pgfsetlinewidth{.6mm}
    \pgfsetarrowsend{stealth}
    \pgfpathmoveto{\pgfpointorigin}
    \pgfpathlineto{\pgfpoint{\z@}{\pgfopticsobjectheigth}}
    \pgfusepath{stroke}}}

\begin{document}

\begin{tikzpicture}
  \coordinate (OpticalAxisLeft) at (0,0);
  \coordinate (OpticalAxisRight) at ($(OpticalAxisLeft)+(45:10)$);
  \draw[OpticalAxis] (OpticalAxisLeft) -- (OpticalAxisRight);
  %
  \node[shape=converging lens,rotate=45] (Lens1) at
    ($(OpticalAxisLeft)!.7!(OpticalAxisRight)$) {};
  \node[below] at (Lens1.object focus) {$F$};
  \node[shape=mark point |,rotate=45,label=below:$F'$] at (Lens1.image
focus) {};
  \node[shape=mark point |,rotate=45,label=below:$F$] at (Lens1.object
focus) {};
  \node[above right] at (Lens1.center) {$O$};
  %
  \node[object for a given lens,anchor=bottom,draw,rotate=45] (Object1) at
  ($(Lens1.center)!-2.5*\pgfopticsimagefocallength!(OpticalAxisRight)$)
  {};
  %
  \draw[LR>] (Object1.top) -- (Object1.object top on Lens1);
  \draw[LR>] (Object1.object top on Lens1) -- (Object1.image top by Lens1);
  \draw[LR>>] (Object1.top) -- (Lens1.center);
  \draw[LR>>] (Lens1.center) -- (Object1.image top by Lens1);
\end{tikzpicture}

\end{document}

--
Christophe

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: optics library (next idea)

by Christophe Jorssen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/8/26 Christophe Jorssen <jorssen.leraincy@...>:
> Hello all,
>
> Here is the code. In order not to disturb the list, I'll post the
> future code on my blog. Again, any comments or suggestions are
> welcomed.
>

Sorry: I forgot to say that my blog is

www.cjorssen.fr

In addition, the code I posted yesterday fails for more than one lens
(ie a lens node with a different name than Lens1). I'm working on it,
but I have to hack a bit the code of \pgfdeclareshape so it'll take
some time.

--
Christophe

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: optics library (next idea)

by Ken Starks :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christophe Jorssen wrote:

> 2009/8/26 Christophe Jorssen <jorssen.leraincy@...>:
>  
>> Hello all,
>>
>> Here is the code. In order not to disturb the list, I'll post the
>> future code on my blog. Again, any comments or suggestions are
>> welcomed.
>>
>>    
>
> Sorry: I forgot to say that my blog is
>
> www.cjorssen.fr
>
> In addition, the code I posted yesterday fails for more than one lens
> (ie a lens node with a different name than Lens1). I'm working on it,
> but I have to hack a bit the code of \pgfdeclareshape so it'll take
> some time.
>
>  
Please keep posing here (as well as on your blog). Your project is of
interest to me, but
most of your blog, because it is in French, is a real struggle for me.

My concept for your project would be to generate something a bit more
interactive than a
static diagram. The user (whether a lecturer or a  student in a  
practical  lab)  could run the
interactive diagrams in parallel with doing the experiments and
measurements with real lenses,
mirrors, laser-pens, opto-diodes, etc.

Ideally, they could take a few measurements experimentally, type them
into the computer, and
then compare the calculated (theoretical) result with genuine raw
observations. The educator's
sub-plot for this scenario is - of course - to tease out the boundary
between two models of
light ('straight line' and 'wave') neither of which is 'the truth' ( ?
quantum theory or something
beyond ? ...)

How ? many possibilities, including ..
+ Pgf/Tikz
+ interactive PDF (with 'forms', buttons, Etc ... PDF-Javascript )
+ interactive PDF (embedded video, audio)
+ interactive PDF (user-added comments and annotations)
+ Python embedded into PDF
+ Webservices
+ Multi-language versions (English, French, Esperanto ...)

If you have not already considered these possibilities and rejected
them, perhaps you have
jumped in too early at the actual coding.

Good luck,
Ken.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: optics library (next idea)

by Christophe Jorssen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ken Starks a écrit :
> Please keep posing here (as well as on your blog). Your project is of
> interest to me, but
> most of your blog, because it is in French, is a real struggle for me.

Ok. I won't be active on a regular basis, unfortunately.

>
> My concept for your project would be to generate something a bit more
> interactive than a
> static diagram. The user (whether a lecturer or a  student in a  
> practical  lab)  could run the
> interactive diagrams in parallel with doing the experiments and
> measurements with real lenses,
> mirrors, laser-pens, opto-diodes, etc.

Interesting ideas, but that's not what I want to do. I'm currently
writing my lectures in geometrical optics and all I want is to have an
efficient way to draw advanced light rays paths across not too complex
optical devices (made of thin lenses and mirrors).

Nevertheless, your ideas can be a (more advances) complement to what I'm
trying to do.

Anyway, thank you for your interest and I keep the list informed of my
(little and slow) progress.

Best regards

--
Christophe

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users