\documentclass[12pt]{beamer}
\input{BEAMERoptions.tex}

\usepackage[english]{babel}
\usepackage{graphics}
\usepackage{times}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{subfigure}
\usepackage{textpos}
\usepackage{color}
\usepackage{listings}
\usepackage{fancyvrb}
\usepackage{tikz}
   \usetikzlibrary{shapes, arrows, shadows, calc}
   

\newcommand{\Frametitle}[1]{\frametitle{\includegraphics[width=0.25in]{esp_logo.png}
      \hspace{0.05in} #1}}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]

\title[{\tt ESP} Session on the {\tt EGADS} API]{
  \includegraphics[width=1.0in]{esp_logo.png}\\
  The Use of Geometry from within the Engineering Sketch Pad -- Rev 1.28\\
  The {\tt EGADS} API
  }
\author[Haimes]{
Bob Haimes \\
  {\footnotesize \textcolor{blue}{bob@geocentrictech.com}~~or~~\textcolor{blue}{haimes@mit.edu} \\[-0.03in]
    Geocentric Technologies LLC}
}
 \date[July 2025]{}

\begin{document}

\begin{frame}
  \titlepage
\end{frame}


\begin{frame}
  \Frametitle{{\tt ESP} with {\tt CAPS}}

  % procedure that is part of CAPS
  \tikzstyle{iproc} = [rectangle,
                       draw,
                       fill=blue!15,
                       thick,
                       inner sep=0pt,
                       minimum width=15mm,
                       minimum height=15mm,
                       align=center]
 \tikzstyle{oproc} = [rectangle,
                       draw,
                       fill=blue!40,
                       thick,
                       inner sep=0pt,
                       minimum width=15mm,
                       minimum height=10mm,
                       align=center]
  % procedure that is external to CAPS
  \tikzstyle{eproc} = [rectangle,
                       draw,
                       fill=orange!20,
                       thick,
                       inner sep=0pt,
                       minimum width=15mm,
                       minimum height=15mm,
                       align=center]
  % file or database
  \tikzstyle{disc}  = [cylinder,
                       shape border rotate=90,
                       aspect=0.25,
                       draw,
                       fill=green!20,
                       thick,
                       inner sep=0pt,
                       minimum width=15mm,
                       minimum height=15mm,
                       align=center]
  % link between procedures and discs
  \tikzstyle{link}  = [<->,
                       very thick]

  \begin{center}
    \begin{tikzpicture}[font=\scriptsize\sf]
      % picture elements
      \node[oproc,  minimum height=12mm] (ESP)  at (0.43,6.80) {~~~~~ESP~~~~~ \\ UI};
      \node[iproc,  minimum height=12mm] (pyCaps)  at (0.43,5.15) {~~~~pyCAPS~~~~};
      \node[eproc, minimum height=40mm] (framework) at (0.43,2.05) {User \\ \\ -------- \\ \\ MDO \\ ~~Framework~~
                                                                                                               \vspace{0.04in} \\ \tiny \em MSTC Engr \\ \tiny OpenMDAO \\ \tiny \em ~ModelCenter~ \\ \tiny \em ~ModeFRONTIER~ };
      \node[eproc, double copy shadow]  (tools)     at (2.75,0.85) {Analysis \\ tools};
      \node[iproc, minimum height=45mm] (executive) at (2.75,4.35) {Computa- \\ tional \\ Aircraft \\ Prototype \\ Syntheses \\ (CAPS) \\ API};
      \node[disc]                       (probDB)    at (4.75,3.3) {Problem \\ Database};
%   \node[iproc]                      (analysis)  at (4.75,4.35) {Analysis \\ Subsystem};
      \node[oproc, minimum height=28mm]  (geometry)  at (4.75,6.1) {Geometry \\ Subsystem \\ --- \\ OpenCSM \vspace{0.01in} \\ \textcolor{espred}{EGADS}};
      \node[oproc,]                     (lite) at (10.0,2.0)  {\textcolor{espred}{EGADSlite}};
      \node[disc,  double copy shadow]  (analIO)    at (6.75,1.25) {Analysis \\ I/O Files};
      \node[iproc, double copy shadow]  (AIM)       at (6.75,4.35) {Analysis \\ Interface \\ Module \\ (AIM)};
      \node[iproc, double copy shadow]  (meshW) at (8.85,4.35) {Mesh \\ Writers};
      \node[disc]                       (geomDB)    at (6.75,6.65) {Geometry \\ Database};

      % links (arrows)
      \draw[link,dotted] (ESP)  to (pyCaps);
      \draw[link,dotted] (1.20,6.95)  to (4.0,6.95);
      \draw[link,dotted] (1.30,0.85)  to (tools);
%   \draw[link,dotted] (framework)  to (tools);
      \draw[link,dotted] (1.30,3.375)  to (2.0,3.375);
%   \draw[link,dotted] (framework)  to (executive);
      \draw[link]         (1.28,5.05) to (2.0, 5.05);
      \draw[link,dotted]        (pyCaps)      to (framework);
      \draw[link]        (3.5,1.2)      to (analIO);
      \draw[link]        (executive)  to (probDB);
%   \draw[link]        (3.50,4.375)  to (analysis);
%   \draw[link]        (executive)  to (analysis);
      \draw[link]        (executive)  to (geometry);
%   \draw[link]        (probDB)     to (analysis);
%   \draw[link]        (analysis)   to (geometry);
%   \draw[link]        (analysis)   to (AIM);
      \draw[link]        (executive) to (AIM);
      \draw[link]        (geometry) to (AIM);
      \draw[link]        (analIO)      to (AIM);
      \draw[link]        (meshW)    to (AIM);
      \draw[<-,very thick]  (AIM) to (6.0,2.4);
      \draw[<-,very thick]  (3.5,1.45) to (6.0,2.4);
      \draw[link]        (geometry)   to (geomDB);
      \draw[<-,very thick, dotted] (5.5,5.75) to (10.0, 5.75);
      \draw[->,very thick, dotted] (10.0, 5.75) to (lite);
      \draw[<-,very thick, dotted] (lite) to (10.0, 0.35);
      \draw[->,very thick, dotted] (10.0, 0.35) to (3.5,0.35);
    \end{tikzpicture}
  \end{center}

  \end{frame}

\begin{frame}
  \Frametitle{{\tt ESP}'s Geometry Subsystem Architecture}

  % procedure that is part of CAPS
  \tikzstyle{iproc} = [rectangle,
                       draw,
                       fill=blue!20,
                       thick,
                       inner sep=0pt,
                       minimum width=15mm,
                       minimum height=15mm,
                       align=center]
    \tikzstyle{oproc} = [rectangle,
                       draw,
                       fill=blue!35,
                       thick,
                       inner sep=0pt,
                       minimum width=15mm,
                       minimum height=15mm,
                       align=center]
  % procedure that is external to CAPS
  \tikzstyle{eproc} = [rectangle,
                       draw,
                       fill=orange!20,
                       thick,
                       inner sep=0pt,
                       minimum width=15mm,
                       minimum height=15mm,
                       align=center]
  % file or database
  \tikzstyle{disc}  = [cylinder,
                       shape border rotate=90,
                       aspect=0.25,
                       draw,
                       fill=green!20,
                       thick,
                       inner sep=0pt,
                       minimum width=15mm,
                       minimum height=15mm,
                       align=center]
  % link between procedures and discs
  \tikzstyle{link}  = [<->,
                       very thick]
  \tikzstyle{onedir}  = [->,
                       very thick]

  \begin{center}
    \begin{tikzpicture}[font=\scriptsize\sf]
      % picture elements
      \node[oproc, minimum height=30mm] (ESP) at (-2.5,2.75) { ~Engineering~ \\ Sketch Pad \\ (ESP) \\ UI};
      \node[oproc, minimum height=30mm] (scsm) at (-0.25,2.75) {serveESP};
      \node[oproc]                     (ocsm)   at (1.75,4.0) {OpenCSM};
      \node[oproc]                     (egads)  at (1.75,1.5) {\textcolor{red}{EGADS}};
      \node[eproc]                     (occ)      at (4.5,1.5) { ~OpenCASCADE~ };
      \node[oproc, double copy shadow,  minimum height=23mm]  (UDP)  at (4.0,4.0) {User \\ Defined \\ ~Primitives \& ~ \\ Functions \\ (UDPs \& \\UDFs) };
      \node[disc,  minimum height=21mm]   (compDB)    at (3.25,6.6) { ~Configuration~ \\ Database \\ *.csm};
      \node[disc,  minimum height=21mm]   (classDB)     at (1.0,6.6) {User \\ Defined \\ ~Components ~ \\ (UDCs) };

      % links (arrows)
      \draw[link,dotted] (ESP)  to (scsm);
      \draw[link]        (egads)        to (0.5,1.5);
      \draw[link]        (ocsm)         to (0.5,4.0);
      \draw[link]        (ocsm)         to (UDP);
      \draw[link]        (ocsm)         to (egads);
      \draw[link]        (UDP)          to (egads);
      \draw[link]        (egads)        to (occ);
      \draw[onedir]   (compDB)    to (classDB);
      \draw[link]        (compDB)   to (ocsm);
      \draw[link]        (classDB)    to (ocsm);
    \end{tikzpicture}
  \end{center}
\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} Overview}

 The Engineering Geometry Aircraft Design System ({\tt EGADS}) is an
    open-source geometry interface to OpenCASCADE

    \vspace{0.05in}
    \begin{itemize}
    \item reduces OpenCASCADE's 17,000 methods to about 100 calls
%     \begin{itemize}
       \item supports programming in C, C++, FORTRAN, Python and Julia
%     \end{itemize}
    \item allow {\it bottom-up} construction via geometric and
      topological primitives
%      \begin{itemize}
%      \item curve: line, circle, ellipse, parabola, hyperbola, offset,
%        bezier, BSpline (including NURBS)
%      \item surface: plane, spherical, conical, cylindrical, toroidal,
%        revolution, extrusion, offset, bezier, BSpline (including NURBS)
%      \end{itemize}
    \item allows {\it top-down} construction via solid creation and Boolean operations
    \item provides persistent user-defined attributes on
      topological entities
      \item adjustable tessellator ({\it vs} a surface mesher) with support for finite-differencing in the calculation of
      parametric sensitivities
    \end{itemize}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} Overview}

\vspace{-0.075in}
\begin{block}{{\tt EGADSlite} -- for HPC Environments}
\begin{itemize}
\item No construction supported
\vspace{-0.025in}
\item Same API and Object model as {\tt EGADS}
\begin{itemize}
\vspace{-0.025in}
\item Can use {\tt EGADS} to prototype/build {\tt EGADSlite} code
\end{itemize}
\vspace{-0.025in}
\item Suitable for an MPI setup:
\begin{itemize}
\vspace{-0.025in}
\item Data export from {\tt EGADS} via a {\it stream}
\item Data import to {\tt EGADSlite} from the {\it stream}
\item {\it Stream} setup to Broadcast (or write to disk)
\end{itemize}
\vspace{-0.025in}
\item ANSI C -- No OpenCASCADE
\vspace{-0.025in}
\item Tiny memory footprint
\vspace{-0.025in}
\item Thread safe and scalable
\begin{itemize}
\item {\tt EGADS'} OpenCASCADE evaluation functions replaced with those
written for {\tt EGADSlite}
\end{itemize}
\vspace{-0.025in}
\footnotesize
\item See \textcolor{blue}{\tt \$ESP\_ROOT/externApps/Pagoda/EGADSserver} for an MPI example
\end{itemize}
\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} Overview}

\vspace{-0.05in}
\begin{block}{System Support}
\begin{itemize}
\item MacOS (Intel or Mx) with {\bf clang}, {\bf ifort/ifx} and/or {\bf gfortran}
\item LINUX with {\bf gcc}, {\bf ifort/ifx} and/or {\bf gfortran}
\item Windows with Microsoft Visual Studio C++ and {\bf ifort/ifx}
\item No globals (but not entirely thread-safe due to OpenCASCADE)
\item Various levels of output (0-none, through 3-debug)
\item Written in C and C++
\item {\tt pyEGADS} only requires a current version of Python
\end{itemize}
\end{block}

\vspace{-0.05in}
\begin{block}{{\tt EGADS} Objects ({\bf ego}s)}
\begin{itemize}
\item Pointer to a C structure -- allows for an {\it Object-based} API
\item Treated as ``blind'' pointers (i.e., not meant to be dereferenced)
\item {\bf ego}s are INTEGER*8 variables in FORTRAN
\end{itemize}
\end{block}
\end{frame}

\begin{frame}
\Frametitle{{\tt EGADS} Objects -- {\bf ego}s}
\begin{itemize}
\item Context -- Holds the {\it globals}
\item Transform
\item Tessellation
\item \textcolor{gray}{Nil (allocated but not assigned) -- internal}
\item \textcolor{gray}{Empty -- internal}
\item \textcolor{gray}{Reference -- internal}
\item Geometry
\begin{itemize}
\item pcurve, curve, surface
\end{itemize}
\item Topology
\begin{itemize}
\item Node, Edge, Loop, Face, Shell, Body, Model
\end{itemize}
\end{itemize}
\vspace{0.1in}
\scriptsize
See \textcolor{blue}{\tt  \$ESP\_ROOT/doc/EGADS/egads.pdf} for a detailed description of all of the functions.\\
See \textcolor{blue}{\tt \$ESP\_ROOT/include/egadsTypes.h} for a list of \textcolor{magenta}{\tt define}s and structures.\\
See \textcolor{blue}{\tt \$ESP\_ROOT/include/egadsErrors.h} for a list of the return code \textcolor{magenta}{\tt define}s.
\end{frame}

\begin{frame}[fragile]
\Frametitle{{\tt EGADS} Objects}

\vspace{-0.085in}
\begin{block}{C structure definition  - an \textcolor{blue!25}{ego}}
\scriptsize
\begin{verbatim}
   typedef struct egObject {
      int    magicnumber;        /* must be properly set to validate
                                    the object */
      short  oclass;             /* object class */
      short  mtype;              /* object member type */
      void  *attrs;	             /* attributes or reference */
      void  *blind;	             /* blind pointer to OpenCASCADE or
                                    EGADS data */
      struct egObject *topObj;   /* top of the hierarchy or
                                    context (if top) */
      struct egObject *ref;      /* threaded list of references */
      struct egObject *prev;     /* back pointer */
      struct egObject *next;     /* forward pointer */
    } egObject;
    
  #define ego egObject*;
\end{verbatim}
\end{block}

\vspace{-0.075in}
\begin{block}{Context Object}
\begin{itemize}
\item Start of dual threaded-list of active \textcolor{blue}{ego}s
\vspace{-0.05in}
\item Pool of deleted objects
\end{itemize}
\end{block}

\end{frame}

  \begin{frame}
\Frametitle{{\tt EGADS}  Objects -- {\it Ownership}}

\begin{block}{Deleting Objects}
\begin{itemize}
\item Use the function {\tt EG\_deleteObject} to delete Objects
\item The Object must be reference {\it free} -- i.e. not used by another
\begin{itemize}
\item Delete in the opposite order of creation
\item If in a Body, delete the Body instead (unless the Body is in a Model)
\end{itemize}
\item {\tt EG\_deleteObject} on a Context does not delete the Context
\begin{itemize}
\item Deletes all Objects in the Context that are not in a Body
\item Use  {\tt EG\_close} to delete all objects in a Context (and the Context)
\end{itemize}
\end{itemize}
\end{block}

\begin{block}{Another Rule}
\begin{itemize}
\item A Body can only be in one Model
\begin{itemize}
\item Copy the Body of interest, then include the copy in the new Model
\end{itemize}
\end{itemize}
\end{block}

\end{frame}


\begin{frame}
\Frametitle{{\tt EGADS} Geometry Objects}

\vspace{-0.075in}
\begin{block}{surface}
\begin{itemize}
\item 3D surfaces in the space of 2 parameters: $[u,v]$
\vspace{-0.02in}
\item Types: {\scriptsize Plane, Spherical, Cylindrical, Revolution, Toriodal,
                  Trimmed, Bezier, BSpline, Offset, Conical, Extrusion}
\vspace{-0.02in}
\item All types abstracted to $[x,y,z] = f(u,v)$
\end{itemize}
\end{block}

\vspace{-0.075in}
\begin{block}{pcurve -- Parameter Space Curves}
\begin{itemize}
\item 2D curves in the Parametric space $[u,v]$ of a surface
\vspace{-0.02in}
\item Types: {\scriptsize Line, Circle, Ellipse, Parabola, Hyperbola, Trimmed,
                  Bezier, BSpline, Offset}
\vspace{-0.02in}
\item All types abstracted to $[u,v] = h(t)$
\end{itemize}
\end{block}

\vspace{-0.075in}
\begin{block}{curve}
\begin{itemize}
\item 3D curve in the space of 1 running parameter: $t$
\vspace{-0.02in}
\item Types: {\scriptsize Line, Circle, Ellipse, Parabola, Hyperbola, Trimmed,
                  Bezier, BSpline, Offset}
\vspace{-0.02in}
\item All types abstracted to $[x,y,z] = g(t)$
\end{itemize}
\end{block}

\end{frame}

\begin{frame}
  \Frametitle{The {\tt EGADS} API}

\begin{itemize}
\item All {\tt EGADS} C/C++ Functions begin with ``EG\_''
\item There is an attempt to have a descriptive function name 
\item Inputs are usually at the beginning of the argument list
\item Outputs are usually at the end
\item Return Values (\textcolor{espred}{{\tt icode}}):
  \begin{itemize}
  \item (Almost) all {\tt EGADS} function have an \textcolor{espred}{{\tt icode}} return value
  \item A value of 0 ({\tt EGADS\_SUCCESS}) indicates success
  \item A negative value indicates an error
    \begin{itemize}
    \item see \textcolor{blue}{\tt \$ESP\_ROOT/include/egadsErrors.h}
      for a list of the return code \textcolor{magenta}{\tt define}s.
    \end{itemize}
  \item Some functions have a positive return code to indicate partial
    success or provide other information to the caller
  \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Geometry}

\begin{block}{Create a Geometry Object}
{\scriptsize

{\tt
icode = EG\_makeGeometry(\textcolor{blue}{ego} context, \textcolor{magenta}{int} oclass, \textcolor{magenta}{int} mtype, \textcolor{blue}{ego} rGeom,\\
\hspace{1.525in}  \textcolor{magenta}{const int} *ints, \textcolor{magenta}{const double} *reals, \\
\hspace{1.525in} \textcolor{blue}{ego} *nGeom);}\\[0.05in]

\begin{description}
\item[context] the Context Object
\item[oclass] the Object Class: PCURVE, CURVE or SURFACE
\item[mtype] the Member Type (depends on \textcolor{espred}{oclass})
\item[rGeom] the reference Geometry Object (if none use \textcolor{magenta}{NULL})
\item[ints] the integer information (if none use \textcolor{magenta}{NULL})
\item[reals] the real data used to construct the geometry
\item[nGeom] the returned pointer to the new Geometry Object
\item[icode] the integer return code
\end{description}

\vspace{0.02in}
Notes:\\
\begin{enumerate}
\item \textcolor{espred}{ints} is required for either \textcolor{espred}{mtype} = BEZIER or BSPLINE\\[-0.05in]
\item See pages~16-29 of \textcolor{blue}{\tt  \$ESP\_ROOT/doc/EGADS/egads.pdf} for \textcolor{espred}{oclass/mtype} data requirements
\end{enumerate}
}

\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Geometry}

\begin{block}{Evaluating the Object}
{\scriptsize

{\tt
~icode = EG\_evaluate(\textcolor{blue}{ego} object, \textcolor{magenta}{double} *params, \textcolor{magenta}{double} *result);}\\[0.05in]

\begin{description}
\item[object] the input Object
\item[params] NODE -- ignored (can be \textcolor{magenta}{NULL})\\
 PCURVE, CURVE, EDGE -- the $t$ value\\
SURFACE, FACE -- $u$ then $v$\\
\item[result] the filled returned position, $1^{st}$ and $2^{nd}$ derivatives:\\[0.05in]
{\renewcommand{\arraystretch}{1.2}
     \begin{tabular}{|l|c|c|c|c|}
      \hline
      & &  & Edge  & Face  \\
      length $\Rightarrow$          & Node -- 3 & PCurve -- 6  & Curve -- 9 & Surface -- 18   \\ \hline
      Position     & $[x,y,z]$ & $[u,v]$ & $[x,y,z]$  & $[x,y,z]$  \\
      $1^{st}$   & -- & $[du,dv]$  & $[dx,dy,dz]$ & $[dx_u,dy_u,dz_u]$ \\
                      &    &                 &                      & $[dx_v,dy_v,dz_v]$ \\
      $2^{nd}$   & -- & $[du^2, dv^2]$  & $[dx^2,dy^2,dz^2]$ & $[dx_u^2,dy_u^2,dz_u^2]$\\
                        &    &                          &                                 & $[dx_{uv},dy_{uv},dz_{uv}]$\\
                        &    &                          &                                 & $[dx_v^2,dy_v^2,dz_v^2]$\\
       \hline
    \end{tabular}}
\item[icode] the integer return code
\end{description}

\vspace{-0.05in}
Note: You cannot evaluate a DEGENERATE Edge.}

\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Geometry}

\begin{block}{Inverse evaluation on the Object}
{\scriptsize

{\tt
icode = EG\_invEvaluate(\textcolor{blue}{ego} object, \textcolor{magenta}{double} *pos, \textcolor{magenta}{double} *params,\\
\hspace{1.465in} \textcolor{magenta}{double} *result);}\\[0.05in]

\begin{description}
\item[object] the input Object
\item[pos] is $[u,v]$ for a PCURVE and $[x,y,z]$ for all others
\item[params] the returned parameter(s) found for the nearest position on the Object:\\
                  for PCURVE, CURVE or EDGE the one value is $t$\\
                  for SURFACE or FACE the 2 values are $u$ then $v$
\item[result] the closest position found is returned:\\
$[u,v]$ for a PCURVE (len = 2)\\
$[x,y,z]$ for all others (len = 3)\\
\item[icode] the integer return code
\end{description}

\vspace{0.04in}
Note: When using this with a Face the timing is significantly slower than making the call with the \\
Face's reference surface (due to the clipping). If you don't need this limiting call {\tt EG\_invEvaluate} \\[-0.075in]
with the underlying Surface Object.}

\end{block}

\end{frame}

\begin{frame}
\Frametitle{{\tt EGADS} Topology}
{\bf Boundary Representation -- BRep}

\begin{columns}
  \begin{column}{0.07\textwidth}
  \begin{center}
  \vspace{-0.125in}
  \small
  {\it Top\\[-0.04in]
  Down}
  $\Bigg\downarrow$\\
  \vspace{0.175in}
  $\Bigg\uparrow$\\
  {\it Bottom\\[-0.04in]
  Up}
  \end{center}
  \end{column}

  \begin{column}{0.91\textwidth}
  \vspace{-0.05in}
  \begin{center}
  \begin{tabular}{| l | l | l |}
       \hline
   \bf Topology & \bf Geometric Entity & \bf Function \\
       \hline
       \hline
    Model      &    &  \\
        \hline
    Body         &  Solid, Sheet, Face, Wire  &   \\
       \hline
    Shell     &              &  \\
        \hline
    Face         &    {\bf surface}  & $(x,y,z) = $ {\bf f}$(u,v)$ \\
        \hline
    Loop      &   ~~~~{\bf pcurve}  (non-planar)        &  \\
        \hline
    Edge    & {\bf curve} & $(x,y,z) = $ {\bf g}$(t)$ \\
        \hline
    Node    & {\bf point} & \\
    \hline
  \end{tabular}
  \end{center}
  \end{column}
  \end{columns}

\vspace{0.135in}
 \begin{itemize}
\item Nodes that bound Edges may not be exactly on the underlying curves
\item Edges in the Loops that trim the Face may not exactly sit on the surface, hence the use of pcurves
  \end{itemize}
\end{frame}

\begin{frame}
\Frametitle{{\tt EGADS} Topology Objects}

\vspace{-0.075in}
  \begin{block}{Node}
  \begin{itemize}
  \item Contains $[x,y,z]$
  \item Types: none
  \end{itemize}
  \end{block}

  \vspace{-0.065in}
  \begin{block}{Edge}
  \begin{itemize}
  \item Has a 3D curve (if not Degenerate)
  \vspace{-0.02in}
  \item Has a $t$ range ($t_{min}$ to $t_{max}$, where $t_{min} < t_{max}$) \\
  Note:  The positive orientation is going from $t_{min}$ to $t_{max}$
    \vspace{-0.02in}
  \item Has a Node for $t_{min}$ and for $t_{max}$ -- can be the same Node
    \vspace{-0.02in}
  \item Types:
   \vspace{-0.02in}
  \begin{itemize}
  \item OneNode -- periodic
  \item TwoNode -- normal
  \item Degenerate -- single Node, $t$ range used for the associated pcurve
  \end{itemize}
  \end{itemize}

  \vspace{-0.2in}
   \center
        \scriptsize
\begin{tikzpicture}
        \draw[semithick] (-.5,0.5) -- (0,0.5);
	\draw[o-,semithick] (0,0.5) -- (4,0.5);
	\draw[o->,semithick] (4,0.5) -- (4.5,0.5);
	\draw (0.25,0.8) node {$t=t_{min}$};
	\draw (4.25,0.8) node {$t=t_{max}$};
	\draw (0.1,0.2) node {$N_1$};
	\draw (4.1,0.2) node {$N_2$};
\end{tikzpicture}
\vspace{-0.04in}
  \end{block}

\end{frame}

\begin{frame}
\Frametitle{{\tt EGADS} Topology Objects}

  \begin{block}{Loop -- without a reference surface}
  \begin{enumerate}
  \item Free standing connected Edges that can be used in a non-manifold setting (for example in WireBodies)
  \item A list of connected Edges associated with a Plane (which does not require pcurves)
  \end{enumerate}
  \vspace{-0.1in}
  \begin{itemize}
   \item An ordered collection of Edge objects with associated senses %that define the connected {\it Wire/Contour/Loop}
  \item Edges must not be Degenerate
  \item Types: % Open or Closed (comes back on itself)
  \end{itemize}
  \begin{figure}
  \vspace{-0.3in}
 \center
 \begin{tikzpicture}
        \footnotesize
        \draw (0.65,-0.7) node {Open: +$E_1$ +$E_2$ -$E_3$};
        \scriptsize
	\draw[semithick,-o] (0.18,0) -- (2.0,0);
	\draw[semithick,->] (0.18,0) -- (1.83,0);
	\draw[semithick,-o] (1.91,0.1) -- (1.91,2.0);
	\draw[semithick,->] (1.91,0.1) -- (1.91,1.83);
	\draw[semithick,-o] (1.82,1.91) -- (0.0,1.91);
	\draw[semithick,->] (0.18,1.91) -- (1.82,1.91);
	\draw[semithick,-o] (0.09,0.09) -- (0.09,-.09);
	\draw (-0.2,-0.2) node {$N_1$};
	\draw (2.2, -0.2) node {$N_2$};
	\draw (2.2, 2.0) node {$N_3$};
	\draw (-0.2,2.0) node {$N_4$};
	\draw (1.0,-0.25) node {$E_1$};
	\draw (2.2, 1.0) node {$E_2$};
	\draw (1.0, 2.2) node {$E_3$};
	\tiny
	\draw (1.0,0.2) node {$+$};
	\draw (1.75, 1.0) node {$+$};
	\draw (1.0, 1.8) node {$-$};
\end{tikzpicture}
\hspace{0.15in}
 \begin{tikzpicture}
        \footnotesize
        \draw (0.85,-0.7) node {Closed: +$E_1$ +$E_2$ -$E_3$ -$E_4$};
        \scriptsize
	\draw[semithick,-o] (0.18,0) -- (2.0,0);
	\draw[semithick,->] (0.18,0) -- (1.83,0);
	\draw[semithick,-o] (1.91,0.1) -- (1.91,2.0);
	\draw[semithick,->] (1.91,0.1) -- (1.91,1.83);
	\draw[semithick,-o] (1.82,1.91) -- (0.0,1.91);
	\draw[semithick,->] (0.18,1.91) -- (1.82,1.91);
	\draw[semithick,-o] (0.09,1.82) -- (0.09,-.09);
	\draw[semithick,->] (0.09,0.9) -- (0.09,1.82);
	\draw (-0.2,-0.2) node {$N_1$};
	\draw (2.2, -0.2) node {$N_2$};
	\draw (2.2, 2.0) node {$N_3$};
	\draw (-0.2,2.0) node {$N_4$};
	\draw (1.0,-0.25) node {$E_1$};
	\draw (2.2, 1.0) node {$E_2$};
	\draw (1.0, 2.2) node {$E_3$};
	\draw (-0.2,1.0) node {$E_4$};
	\tiny
	\draw (1.0,0.2) node {$+$};
	\draw (1.75, 1.0) node {$+$};
	\draw (1.0, 1.8) node {$-$};
	\draw (0.25,1.0) node {$-$};
\end{tikzpicture}
\end{figure}

  \end{block}
 \end{frame}

 \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects}

  \begin{block}{Loop -- with a reference surface}
  \begin{enumerate}
  \item Collections of Edges %(like without a surface)
  followed by a corresponding  collection of pcurves that define the $[u,v]$ trimming on the surface
  \end{enumerate}
%  \vspace{-0.1in}
  \begin{itemize}
   \item An ordered collection of Edge objects with associated senses %that define the connected {\it Wire/Contour/Loop}
   \item Degenerate Edges are required when the $[u,v]$ mapping collapses like at the apex of a cone (note that the pcurve is needed to be fully defined using the Edge's $t$ range)
     \item Trims the surface by maintaining material to the left of the running Loop
  \item An Edge may be found in a Loop twice (with opposite senses) and with different pcurves. %For example a closed cylindrical surface at the seam -- one pcurve would represent the beginning of the period where the other is the end of the periodic range.
  \item Types: Open or Closed (comes back on itself)
  \end{itemize}
  \end{block}
 \end{frame}

 \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects}

  \begin{block}{Face}
  \begin{itemize}
   \item A surface bounded by one or more Loops with associated senses
   \item Only one outer Loop (sense = 1) and any number of inner Loops (sense = -1). Note that under very rare conditions a Loop may be found in more than 1 Face -- in this case the one marked with sense = +/- 2 must be used in a reverse manner.
   \item All Loops must be Closed
   \item Loop(s) must not contain reference geometry for Planar surfaces
   \item If the surface is not a Plane then the Loop's reference Object must match that of the Face
  \item Type is the orientation of the Face based on surface's $\vec{U} \times \vec{V}$:
  \begin{itemize}
     \item SFORWARD or SREVERSE when the orientations are opposed
   \end{itemize}
   \scriptsize
   Note that this is coupled with the Loop's orientation (i.e. an outer Loop traverses the Face in a right-handed manner defining the outward direction)
  \end{itemize}
  \end{block}
 \end{frame}

  \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects -- Face Examples}
    \center
    \begin{tikzpicture}
        \scriptsize
	\draw[semithick,-o] (0.18,0) -- (4.0,0);
	\draw[semithick,->] (0.18,0) -- (3.83,0);
	\draw[semithick,-o] (3.91,0.1) -- (3.91,4.0);
	\draw[semithick,->] (3.91,0.1) -- (3.91,3.83);
	\draw[semithick,-o] (3.82,3.91) -- (0.0,3.91);
	\draw[semithick,->] (0.18,3.91) -- (3.82,3.91);
	\draw[semithick,-o] (0.09,3.82) -- (0.09,-.09);
	\draw[semithick,->] (0.09,0.9) -- (0.09,3.82);
	\draw (-0.2,-0.2) node {$N_1$};
	\draw (4.2, -0.2) node {$N_2$};
	\draw (4.2, 4.0) node {$N_3$};
	\draw (-0.2,4.0) node {$N_4$};
	\draw (2.0,-0.25) node {$E_1$};
	\draw (4.2, 2.0) node {$E_2$};
	\draw (2.0, 4.2) node {$E_3$};
	\draw (-0.2,2.0) node {$E_4$};
	\draw[semithick,-o] (2.75,2.0) arc (0:180:0.75);
	\draw[semithick,->] (1.25,2.20) to (1.25,2.17);
	\draw[semithick,-o] (1.25,2.0) arc (0:180:-0.75);
	\draw[semithick,->] (2.75,1.81) to (2.75,1.84);
	\draw (2.47,1.9) node {$N_5$};
	\draw (1.55,2.05) node {$N_6$};
	\draw (2.0,2.55) node {$E_5$};
	\draw (2.0,1.45) node {$E_6$};
	\draw[dashed,->] (0.24,0.15) -- (3.76,0.15);
	\draw[dashed,->] (3.78,0.12) -- (3.78,3.77);
	\draw[dashed,->] (0.24,3.77) -- (3.76,3.77);
	\draw[dashed,->] (0.23,0.18) -- (0.23,3.77);
	\draw[dashed,->] (2.85,2.0) arc (0:165:0.85);
	\draw[dashed,->] (1.15,2.0) arc (0:165:-0.85);
	\tiny
	\draw (2.0,0.3) node {$+$};
	\draw (3.625, 2.0) node {$+$};
	\draw (2.0, 3.65) node {$-$};
	\draw (0.38,2.0) node {$-$};
	\draw (2.0,2.95) node {$-$};
	\draw (2.0,1.05) node {$-$};
\end{tikzpicture}

\begin{itemize}
\item Outer Loop -- right handed/counterclockwise: +$E_1$  +$E_2$  -$E_3$  -$E_4$
 \item Inner Loop -- left handed/clockwise: -$E_5$ -$E_6$
 \end{itemize}
\end{frame}

  \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects -- Face Examples}

\begin{figure}
    \center
\begin{tikzpicture}
	\draw[dashed,color=gray] (0,0) arc (0:180:1.5 and 0.5);% back half of the left ellipse
	\draw[semithick] (-3.0,0) arc (180:360:1.5 and 0.5);% front half of the left ellipse
	\draw[semithick] (0,3.5) arc (0:360:1.5 and 0.5);
	\draw[semithick] (0,0) -- (0,3.5);% left line
	\draw[semithick] (-3.0,0) -- (-3,3.5);% right line
	\draw[semithick] (-1.5,-.5) -- (-1.5,3.0);
         \draw[draw=black,fill=white] (-1.5,-.5) circle (0.075);
         \draw[draw=black,fill=white] (-1.5,3.0) circle (0.075);
         \scriptsize
         \draw (-1.5,-0.75) node {$N_1$};
         \draw (-1.5,3.25) node {$N_2$};
         \draw (-1.3,1.65) node {$E_2$};
\end{tikzpicture}
  \hspace{0.3in}
    \begin{tikzpicture}
        \scriptsize
	\draw[semithick,-o] (0.18,0) -- (4.0,0);
	\draw[semithick,->] (0.18,0) -- (3.83,0);
	\draw[semithick,-o] (3.91,0.1) -- (3.91,4.0);
	\draw[semithick,->] (3.91,0.1) -- (3.91,3.83);
	\draw[semithick,-o] (3.82,3.91) -- (0.0,3.91);
	\draw[semithick,->] (0.18,3.91) -- (3.82,3.91);
	\draw[semithick,-o] (0.09,3.82) -- (0.09,-.09);
	\draw[semithick,->] (0.09,0.9) -- (0.09,3.82);
	\draw (-0.2,-0.2) node {$N_1$};
	\draw (4.2, -0.2) node {$N_1$};
	\draw (4.1, 4.125) node {$N_2$};
	\draw (-0.1,4.125) node {$N_2$};
	\draw (2.0,-0.25) node {$E_1$};
	\draw (4.2, 2.0) node {$E_2$};
	\draw (2.0, 4.2) node {$E_3$};
	\draw (-0.2,2.0) node {$E_2$};
	\draw (2.0,0.30) node {$PC_1$};
	\draw (3.4, 2.05) node {$PC_2$};
	\draw (2.0, 3.55) node {$PC_3$};
	\draw (0.6,2.0) node {$PC_4$};
	\draw[dashed,->] (0.24,0.15) -- (3.76,0.15);
	\draw[dashed,->] (3.78,0.12) -- (3.78,3.77);
	\draw[dashed,->] (0.24,3.77) -- (3.76,3.77);
	\draw[dashed,->] (0.23,0.18) -- (0.23,3.77);
	\tiny
	\draw (0.0,-0.55) node {$u=0$};
	\draw (4.0,-0.55) node {$u=2\pi$};
	\draw (4.75,0.) node {$v=v_{min}$};
	\draw (4.75,3.91) node {$v=v_{max}$};
\end{tikzpicture}
\end{figure}
\center
Unrolled periodic cylinder Face\\
Single Outer Loop -- right handed/counterclockwise:\\
 +$E_1$  \textcolor{red}{+$\color{red} E_2$}  -$E_3$  \textcolor{red}{-$\color{red} E_2$}
\end{frame}

 \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects -- Face Examples}

\begin{figure}
    \center
\begin{tikzpicture}
	\draw[dashed,color=gray] (0,0) arc (0:180:1.5 and 0.5);% back half of the left ellipse
	\draw[semithick] (-3.0,0) arc (180:360:1.5 and 0.5);% front half of the left ellipse
	\draw[semithick] (0,0) -- (-1.5,3.25);% left line
	\draw[semithick] (-3.0,0) -- (-1.5,3.25);% right line
	\draw[semithick] (-1.5,-.5) -- (-1.5,3.25);
         \draw[draw=black,fill=white] (-1.5,-.5) circle (0.075);
         \draw[draw=black,fill=white] (-1.5,3.25) circle (0.075);
         \scriptsize
         \draw (-1.5,-0.75) node {$N_1$};
         \draw (-1.5,3.5) node {$N_2$};
         \draw (-1.3,1.65) node {$E_2$};
\end{tikzpicture}
  \hspace{0.3in}
    \begin{tikzpicture}
        \scriptsize
	\draw[semithick,-o] (0.18,0) -- (4.0,0);
	\draw[semithick,->] (0.18,0) -- (3.83,0);
	\draw[semithick,-o] (3.91,0.1) -- (3.91,4.0);
	\draw[semithick,->] (3.91,0.1) -- (3.91,3.83);
	\draw[semithick,-o] (3.82,3.91) -- (0.0,3.91);
	\draw[semithick,->] (0.18,3.91) -- (3.82,3.91);
	\draw[semithick,-o] (0.09,3.82) -- (0.09,-.09);
	\draw[semithick,->] (0.09,0.9) -- (0.09,3.82);
	\draw (-0.2,-0.2) node {$N_1$};
	\draw (4.2, -0.2) node {$N_1$};
	\draw (4.2, 4.0) node {$N_2$};
	\draw (-0.2,4.0) node {$N_2$};
	\draw (2.0,-0.25) node {$E_1$};
	\draw (4.2, 2.0) node {$E_2$};
	\draw (2.0, 4.2) node {$E_3 - Degenerate$};
	\draw (-0.2,2.0) node {$E_2$};
	\draw (2.0,0.30) node {$PC_1$};
	\draw (3.45, 2.0) node {$PC_2$};
	\draw (2.0, 3.55) node {$PC_3$};
	\draw (0.6,2.0) node {$PC_4$};
	\draw[dashed,->] (0.24,0.15) -- (3.76,0.15);
	\draw[dashed,->] (3.78,0.12) -- (3.78,3.77);
	\draw[dashed,->] (0.24,3.77) -- (3.76,3.77);
	\draw[dashed,->] (0.23,0.18) -- (0.23,3.77);
	\tiny
	\draw (0.0,-0.55) node {$u=0$};
	\draw (4.0,-0.55) node {$u=2\pi$};
\end{tikzpicture}
\end{figure}
\center
Unrolled Cone\\[0.05in]

\end{frame}

 \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects -- Face Examples}

    \center
    \begin{tikzpicture}
        \scriptsize
	\draw[semithick,-o] (0.18,0) -- (6.0,0);
	\draw[semithick,->] (0.18,0) -- (5.83,0);
	\draw[semithick,-o] (5.91,0.1) -- (5.91,4.0);
	\draw[semithick,->] (5.91,0.1) -- (5.91,3.83);
	\draw[semithick,-o] (5.82,3.91) -- (0.0,3.91);
	\draw[semithick,->] (0.18,3.91) -- (5.82,3.91);
	\draw[semithick,-o] (0.09,3.82) -- (0.09,-.09);
	\draw[semithick,->] (0.09,0.9) -- (0.09,3.82);
	\draw (-0.2,-0.2) node {$N_1$};
	\draw (6.2, -0.2) node {$N_2$};
	\draw (6.2, 4.0) node {$N_3$};
	\draw (-0.2,4.0) node {$N_4$};
	\draw (3.0,-0.25) node {$E_1$};
	\draw (6.2, 2.0) node {$E_2$};
	\draw (3.0, 4.2) node {$E_3$};
	\draw (-0.2,2.0) node {$E_4$};
	\draw[semithick] (3.0,2.0) arc (0:360:0.75);
	\draw[semithick,->] (1.5,2.10) to (1.5,2.08);
	\draw[semithick,->] (3.0,1.90) to (3.0,1.92);
	\draw[semithick] (4.5,2.0) arc (0:360:0.75);
	\draw[semithick,->] (4.5,2.10) to (4.5,2.08);
	\draw[draw=black,fill=white] (1.5,2.0) circle (0.075);
	\draw[draw=black,fill=white] (3.0,2.0) circle (0.075);
	\draw[draw=black,fill=white] (4.5,2.0) circle (0.075);
	\draw (4.25,1.9) node {$N_7$};
	\draw (2.72,1.9) node {$N_6$};
	\draw (1.80,2.05) node {$N_5$};
	\draw (2.25,2.55) node {$E_5$};
	\draw (2.25,1.45) node {$E_6$};
	\draw (3.75,2.55) node {$E_7$};
	\draw (3.75,1.45) node {$E_8$};
	\tiny
	\draw (3.0,0.15) node {$+$};
	\draw (5.75, 2.0) node {$+$};
	\draw (3.0, 3.8) node {$-$};
	\draw (0.25,2.0) node {$-$};
	\draw (2.25,2.90) node {$-$};
	\draw (2.25,1.10) node {$-$};
	\draw (3.75,2.90) node {$+$};
	\draw (3.75,1.10) node {$+$};
\end{tikzpicture}

\begin{itemize}
\item Outer Loop -- right handed/counterclockwise: +$E_1$  +$E_2$  -$E_3$  -$E_4$
 \item Inner Loop \#1 -- left handed/clockwise: -$E_5$ -$E_6$
 \item Inner Loop \#2 -- left handed/clockwise: +$E_7$ +$E_8$
 \end{itemize}

\end{frame}

 \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects -- Face Examples}

    \center
    \begin{tikzpicture}
        \scriptsize
	\draw[semithick,-o] (0.18,0) -- (2.08,0);
	\draw[semithick,->] (0.18,0) -- (1.92,0);
	\draw[semithick,-o] (2.08,0) -- (4.00,0);
	\draw[semithick,->] (2.08,0) -- (3.83,0);
	\draw[semithick,-o] (3.91,0.1) -- (3.91,4.0);
	\draw[semithick,->] (3.91,0.1) -- (3.91,3.83);
	\draw[semithick,-o] (3.82,3.91) -- (0.0,3.91);
	\draw[semithick,->] (0.18,3.91) -- (3.82,3.91);
	\draw[semithick,-o] (0.09,3.82) -- (0.09,-.09);
	\draw[semithick,->] (0.09,0.9) -- (0.09,3.82);
	\draw (-0.2,-0.2) node {$N_1$};
	\draw (2.0,-0.3) node {$N_2$};
	\draw (4.2, -0.2) node {$N_4$};
	\draw (4.2, 4.0) node {$N_5$};
	\draw (-0.2,4.0) node {$N_6$};
	\draw (1.0,-0.25) node {$E_1$};
	\draw (3.0,-0.25) node {$E_4$};
	\draw (4.2, 2.0) node {$E_5$};
	\draw (2.0, 4.2) node {$E_6$};
	\draw (-0.2,2.0) node {$E_7$};
	\draw[semithick] (2.75,2.0) arc (0:360:0.75);
	\draw[semithick] (2.0,0.09) -- (2.0,1.25);
	\draw[semithick,->] (2.0,1.18) to (2.0,1.20);
	\draw[semithick,->] (2.08, 1.25) to (2.05, 1.25);
        \draw[draw=black,fill=white] (2.0,1.25) circle (0.075);
        \draw (1.6,0.65) node {$E_2$};
        \draw (2.0,2.55) node {$E_3$};
	\draw (2.0,2.55) node {$E_3$};
	\draw (2.0,1.475) node {$N_3$};
	\tiny
	\draw (1.0,0.15) node {$+$};
	\draw (3.0,0.15) node {$+$};
	\draw (3.75, 2.0) node {$+$};
 	\draw (2.0, 3.8) node {$-$};
	\draw (0.25,2.0) node {$-$};
	\draw (1.85,0.65) node {$+$};
	\draw (2.0,2.9) node {$+$};
	\draw (2.15,0.65) node {$-$};
\end{tikzpicture}

\vspace{0.1in}
Single Outer Loop -- right handed/counterclockwise:\\
 +$E_1$  \textcolor{red}{+$\color{red} E_2$}  +$E_3$  \textcolor{red}{-$\color{red} E_2$}  +$E_4$  +$E_5$  -$E_6$  -$E_7$\\[0.1in]
 \scriptsize
Note: PCurve the same for both sides of $E_2$

\end{frame}

  \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects}

\vspace{-0.075in}
  \begin{block}{Shell}
  \begin{itemize}
   \item A collection of one or more connected Faces, that if Closed segregates regions of 3-Space
   \item All Faces must be properly oriented
   \item Non-manifold Shells can have more than 2 Faces sharing an Edge
   \item Types: Open (including non-manifold) or Closed
  \end{itemize}

  \vspace{-0.15in}
    \center
    \begin{tikzpicture}
        \scriptsize
	\draw[semithick,-o] (0.18,0) -- (2.0,0);
	\draw[semithick,->] (0.18,0) -- (1.83,0);
	\draw[semithick,-o] (1.91,0.1) -- (1.91,2.0);
	\draw[semithick,->] (1.91,0.1) -- (1.91,1.83);
	\draw[semithick,-o] (1.82,1.91) -- (0.0,1.91);
	\draw[semithick,->] (0.18,1.91) -- (1.82,1.91);
	\draw[semithick,-o] (0.09,1.82) -- (0.09,-.09);
	\draw[semithick,->] (0.09,0.9) -- (0.09,1.82);
	\draw[semithick,-o] (2.00,0.04) -- (3.5,1.0);
	\draw[semithick,->] (2.00,0.04) -- (3.33,0.90);
	\draw[semithick,-o] (3.42,1.03) -- (3.42,2.91);
	\draw[semithick,->] (3.42,1.03) -- (3.42,2.75);
        \draw[semithick,->] (1.96,1.96) -- (3.35,2.81);
	\draw (-0.2,-0.2) node {$N_1$};
	\draw (2.1, -0.25) node {$N_2$};
	\draw (2.0, 2.2) node {$N_3$};
	\draw (-0.2,2.0) node {$N_4$};
	\draw (3.7,1.0) node {$N_5$};
	\draw (3.7,2.75) node {$N_6$};
	\draw (1.0,-0.25) node {$E_1$};
	\draw (1.35, 2.7) node {$E_2$};
        \draw[semithick,blue,->] (1.35,2.55) arc (0:45:-1.75);
	\draw (1.0, 2.2) node {$E_3$};
	\draw (-0.2,1.0) node {$E_4$};
	\draw (2.85,0.35) node {$E_5$};
        \draw (3.65, 1.95) node {$E_6$};
       	\draw (2.7,2.7) node {$E_7$};
	\draw (1.0,1.0) node {$F_1$};
	\draw (2.75,1.4) node {$F_2$};
	\draw[dashed,->] (0.24,0.15) -- (1.76,0.15);
	\draw[dashed,->] (1.78,0.12) -- (1.78,1.77);
	\draw[dashed,->] (0.24,1.77) -- (1.76,1.77);
	\draw[dashed,->] (0.23,0.18) -- (0.23,1.77);
 	\draw[dashed,->] (2.04,0.18) -- (3.26,0.96);
	\draw[dashed,->] (2.02,0.16) -- (2.02,1.85);
	\draw[dashed,->] (2.02,1.87) -- (3.28,2.62);
 	\draw[dashed,->] (3.32,1.0) -- (3.32,2.68);
	\tiny
	\draw (1.0,0.3) node {$+$};
	\draw (1.625, 1.0) node {$+$};
	\draw (1.0, 1.65) node {$-$};
	\draw (0.38,1.0) node {$-$};
	\draw (2.13, 1.0) node {$-$};
	\draw (2.80, 0.85) node {$+$};
	\draw (3.2, 1.75) node {$+$};
	\draw (2.80, 2.2) node {$-$};
\end{tikzpicture}

%\vspace{0.05in}
\scriptsize
Face \#1 Loop: +$E_1$ +$E_2$ -$E_3$ -$E_4$\\
Face \#2 Loop: +$E_5$ +$E_6$ -$E_7$ -$E_2$

  \end{block}

  \end{frame}

  \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects}

\vspace{-0.05in}
  \begin{block}{SolidBody}
  \begin{itemize}
    \item Manifold collection of one or more Closed Shells %with associated senses
    \item One outer Shell (sense = 1); any number of inner (sense = -1)
    \item Edges (except Degenerate) are found exactly twice (sense = $\pm 1$)
  \end{itemize}
  \vspace{-0.2in}
  \center
\resizebox{0.55\textwidth}{!}{
\begin{tikzpicture}
	% general shift to north east
	\coordinate (O) at (0.5,0.5);
	\draw[semithick] (0,0) -- (4,1);% bottom line in front
	\draw[dashed,color=gray] (O) -- ($(4,1)+(O)$);% bottom line in the back
	\draw[semithick] (0,3) -- (4,2);% top line in front
	\draw[semithick] ($(0,3)+(O)$) -- ($(4,2)+(O)$);% top line in the back
	\draw[semithick] (0,3) -- ($(0,3)+(O)$);% line to the back, top left
	\draw[semithick] (4,2) -- ($(4,2)+(O)$);% line to the back, top right
	\draw[semithick] (4,1) -- ($(4,1)+(O)$);% line to the back, bottom right
	\draw[dashed,color=gray] (0,0) -- (O);% line to the back, bottom left
	\draw[semithick] (0,0) arc (194.036:165.964:6.185);% left arc in front
	\draw[dashed,color=gray] (O) arc (194.036:165.964:6.185);% left arc in the back
	\draw[semithick] (4,1) arc (194.036:165.964:2.062);% right arc in front
	\draw[semithick] ($(4,1)+(O)$) arc (194.036:165.964:2.062);% right arc in the back
        \tiny
	\draw (0,-0.2) node {$N_1$};
	\draw (4,0.80) node {$N_2$};
	\draw (3.92,2.20) node {$N_3$};
	\draw (-0.2,3.02) node {$N_4$};
        \draw (0.7,0.75) node {$\color{gray} N_5$};
        \draw (4.72,1.5) node {$N_6$};
        \draw (4.7,2.45) node {$N_7$};
        \draw (0.61,3.63) node {$N_7$};

        \draw (1.95,0.30) node {$E_1$};
        \draw (3.8,1.55) node {$E_2$};
        \draw (2.0,2.30) node {$E_3$};
        \draw (-0.35,1.7) node {$E_4$};
        \draw (4.4,1.1) node {$E_5$};
        \draw (2.1,1.05) node {$\color{gray} E_6$};
        \draw (0.2,0.4) node {$\color{gray} E_7$};
        \draw (4.65,1.95) node {$E_8$};
        \draw (2.45,3.15) node {$E_9$};
        \draw (0.55,1.9) node {$\color{gray} E_{10}$};
 	\draw (4.0, 3.3) node {$E_{11}$};
        \draw[semithick,blue,->] (4.0,3.15) arc (0:30:-1.75);
        \draw (0.05, 3.4) node {$E_{12}$};

        \draw (1.9,1.5) node{$F_1$};
        \draw (1.95,0.69) node {$\color{gray} F_2$};
        \draw (2.15,1.85) node {$\color{gray} F_3$};
        \draw (2.20,2.75) node {$F_4$};
        \draw (4.25,1.75) node {$F_5$};
        \draw (0.1,1.75) node {$\color{gray} F_6$};
\end{tikzpicture}
}

\footnotesize
\vspace{-0.025in}
Simple SolidBody: 8 Nodes, 12 Edges, 6 Loops and 6 Faces
  \end{block}

  \end{frame}

  \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects}

\begin{block}{Manifold vs. Nonmanifold}
\vspace{0.075in}
  \begin{center}
    \includegraphics[width=4.5in]{manifold.png}\\
  \end{center}
  \vspace{-0.15in}
  ~~~~~~~~nonmanifold~~~~~~~~~~~~~~~~~~~manifold~~~~~~~~~~~~~~~~~~~~~~~~manifold

\vspace{0.15in}
\tiny
figure stolen from ``An introduction to Geometrical Modelling and Mesh Generation: The Gmsh Companion'' by
Christophe Geuzaine,  Emilie Marchandise \& Jean-Fran\c cois Remacle -- used without permission!
\end{block}
\vspace{-0.125in}
\center
{\it Can the geometry be manufactured?}

\end{frame}

  \begin{frame}
\Frametitle{{\tt EGADS} Topology Objects}

  \vspace{-0.1in}
  \begin{block}{Body -- including SolidBody}
  \begin{itemize}
   \item Container used to aggregate Topology
   \item Connected to support non-manifold collections at the Model level
   \item {\it Owns} all the Objects contained within it
   \item Types:
   \vspace{-0.05in}
   \begin{itemize}
     \item A WireBody contains a single Loop
     \item A FaceBody contains a single Face -- IGES import
     \item A SheetBody contains a single Shell which can be either non-manifold or manifold (though usually a manifold Body of this type is promoted to a SolidBody)
    \end{itemize}
  \end{itemize}
  \end{block}

  \vspace{-0.075in}
  \begin{block}{Model}
  \begin{itemize}
    \item A collection of Bodies -- becomes the {\it Owner} of contained Objects
    \item Returned by SBO \& Sew Functions
    \item Read and Written by {\tt EGADS}
  \end{itemize}
  \end{block}

  \end{frame}
  
  \begin{frame}
  \Frametitle{{\tt EGADS} API -- Topology}

\begin{block}{Create a simple Solid Body}
{\scriptsize

{\tt
icode = EG\_makeSolidBody(\textcolor{blue}{ego} context, \textcolor{magenta}{int} stype,  \textcolor{magenta}{const double} *data,\\
 \hspace{1.59in} \textcolor{blue}{ego} *body);}\\[0.05in]

\begin{description}
\item[context] the Context Object
\item[stype] one of: BOX, SPHERE, CONE, CYLINDER, TORUS
\item[data] length and fill depends on \textcolor{espred}{stype}: \\[0.015in]
{\renewcommand{\arraystretch}{1.2}
  \begin{tabular}{l c l}
              	BOX & 6 &       	$[x,y,z]$ then $[dx,dy,dz]$ for the size of box\\
              	SPHERE &4 &  $[x,y,z]$ of center then the radius\\
              	CONE & 7 & 	apex $[x,y,z]$, base center $[x,y,z]$, then the radius\\
              	CYLINDER & 7 &	2 axis points and the radius\\
              	TORUS & 8 &       	$[x,y,z]$ of center, direction of rotation, then the\\
                                 & &   	major radius and minor radius
	\end{tabular}}
\item[body] the resultant Solid Body Object
\item[icode] the integer return code
\end{description}

%\vspace{0.035in}
%Creates a simple Solid Body Object. Can be either a box, sphere, cone, cylinder, or torus.
}

\end{block}

\end{frame}


\begin{frame}
  \Frametitle{{\tt EGADS} API -- Topology}

  \vspace{-0.1in}
\begin{block}{Create a Topology Object}
{\scriptsize

{\tt
icode = EG\_makeTopology(\textcolor{blue}{ego} context, \textcolor{blue}{ego} geom, \textcolor{magenta}{int} oclass, \textcolor{magenta}{int} mtype, \\
\hspace{1.525in}  \textcolor{magenta}{double} *reals, \textcolor{magenta}{int} nchild, \textcolor{blue}{ego} *children,\\
\hspace{1.525in} \textcolor{magenta}{int} *senses, \textcolor{blue}{ego} *topo);}\\[0.05in]

\begin{description}
\item[context] the Context Object
\item[geom] the reference Geometry Object (if none use \textcolor{magenta}{NULL})
\item[oclass] the Object Class: NODE, EDGE, LOOP, FACE, SHELL, BODY or MODEL
\item[mtype] the Member Type (depends on \textcolor{espred}{oclass})
\item[reals] the real data: may be \textcolor{magenta}{NULL} except for NODE that contains the $[x,y,z]$ location and
EDGE where the $t_{min}$ and $t_{max}$ (the parametric bounds) are specified
\item[nchild] number of children (lesser) Topological Objects
\item[children] vector of children objects (\textcolor{espred}{nchild} in length)\\
              if a LOOP with a reference SURFACE, then 2*\textcolor{espred}{nchild} in length (PCurves follow)
\item[senses] a vector of children integer senses: SFORWARD/SREVERSE for LOOP, and SOUTER/SINNER for FACE \textcolor{espred}{nchild } $>$ 1 (may be \textcolor{magenta}{NULL} for FACE \textcolor{espred}{nchild} = 1)
\item[topo] the returned pointer to the new Topology Object
\item[icode] the integer return code
\end{description}

}

\end{block}

\end{frame}


\begin{frame}
  \Frametitle{{\tt EGADS} API -- Topology}
\begin{block}{Query a Topology Object}
{\scriptsize

{\tt
icode = EG\_getTopology(\textcolor{blue}{ego} topo, \textcolor{blue}{ego} *geom, \textcolor{magenta}{int} *oclass, \textcolor{magenta}{int} *mtype, \\[-0.01in]
\hspace{1.46in}  \textcolor{magenta}{double} *reals, \textcolor{magenta}{int} *nchild, \textcolor{blue}{ego} **children,\\[-0.01in]
\hspace{1.46in} \textcolor{magenta}{int} **senses);}\\[0.05in]

\begin{description}
\item[topo] the Topology or {\it Effective Topology} Object to query
\item[geom] the returned reference Geometry Object (can be \textcolor{magenta}{NULL})
\item[oclass] the returned Topology Object Class
\item[mtype] the returned Member Type (depends on \textcolor{espred}{oclass})
\item[reals] the real data (at most 4 \textcolor{magenta}{double}s are filled): NODE -- contains the $[x,y,z]$ location,\\
EDGE where the $t_{min}$ and $t_{max}$ (the parametric bounds) are returned and\\
FACE where the $[u,v]$ box is filled $\rightarrow$ the limits first for $u$ then for $v$ (4 in length)
\item[nchild] the returned number of children (lesser) Topological Objects
\item[children] the returned pointer to a vector of children objects (\textcolor{espred}{nchild} in length)\\
              if a LOOP with a reference SURFACE, then 2*\textcolor{espred}{nchild} in length (PCurves follow)\\
              if a MODEL -- \textcolor{espred}{nchild} is the number of Body Objects, \textcolor{espred}{mtype} the total \textcolor{blue}{ego} count
\item[senses] a vector of senses for the children (LOOPs) or inner/outer for (FACEs \& SHELLs)
\item[icode] the integer return code
\end{description}

}

\end{block}

\end{frame}


\begin{frame}
  \Frametitle{{\tt EGADS} API -- Topology}

\begin{block}{Queries the Objects in a Body}
{\scriptsize

{\tt
icode = EG\_getBodyTopos(\textcolor{blue}{const ego} body, \textcolor{blue}{ego} ref, \textcolor{magenta}{int} oclass,  \\
 \hspace{1.525in} \textcolor{magenta}{int} *ntopo, \textcolor{blue}{ego} **topos);}\\[0.05in]

\begin{description}
\item[body] the Body Object
\item[ref] 	reference Topology Object or \textcolor{magenta}{NULL}. Sets the context for the returned Objects \\
                 (i.e., all objects of the class \textcolor{espred}{oclass} in the tree looking towards that class from \textcolor{espred}{ref})\\
              	\textcolor{magenta}{NULL} starts from the \textcolor{espred}{body} (for example all Nodes in the Body)
\item[oclass] is NODE, EDGE, LOOP, FACE or SHELL -- must not be the same class as \textcolor{espred}{ref}\\
                    for EBODY can be EEDGE, ELOOPX, EFACE, ESHELL or the above
\item[ntopo] the returned number of Topology Objects
\item[topos] is a returned pointer to the vector of Objects, it is possible that an
		individual Object may be \textcolor{magenta}{NULL} ({\it freeable})\\
		Note: the argument can be \textcolor{magenta}{NULL} so the Objects are not filled
\item[icode] the integer return code
\end{description}

This allows for the traversal of the Topology {\it tree} by jumping levels and/or looking up the hierarchy.
}

\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Topology}

\begin{block}{Get the index of the Object in a Body}
{\scriptsize

{\tt
index = EG\_indexBodyTopo(\textcolor{blue}{const ego} body, \textcolor{blue}{const ego} obj)};\\[0.05in]

\begin{description}
\item[body] the Body Object
\item[obj] 	is the Topology Object in the Body
\item[index] the index (bias 1) or the integer return code (negative)
\end{description}

}

\end{block}

\begin{block}{Get the Object in a Body by index}
{\scriptsize

{\tt
icode = EG\_objectBodyTopo(\textcolor{blue}{const ego} body, \textcolor{magenta}{int} oclass, \textcolor{magenta}{int} index, \\
\hspace{1.66in} \textcolor{blue}{ego} *obj);}\\[0.05in]

\begin{description}
\item[body] the Body Object
\item[oclass] the Topology Object class
\item[index] the index (bias 1) of the entity requested
\item[obj] 	is the returned Topology Object from the Body
\item[icode] the integer return code
\end{description}

}

\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Topology}

\begin{block}{Return the Bounding Box info}
{\scriptsize

{\tt
icode = EG\_getBoundingBox(\textcolor{blue}{const ego} object, \textcolor{magenta}{double} *bbox);}\\[0.05in]

\begin{description}
\item[object] any topological object
\item[bbox] 6 \textcolor{magenta}{double}s filled reflecting $[x,y,z]_{min}$ and $[x,y,z]_{max}$
\item[icode] the integer return code
\end{description}

Computes the smallest Cartesian bounding box surrounding the \textcolor{espred}{object}.
}

\end{block}

\begin{block}{Returns the Mass Properties}
{\scriptsize

{\tt
icode = EG\_getMassProperties(\textcolor{blue}{const ego} object, \textcolor{magenta}{double} *props);}\\[0.05in]

\begin{description}
\item[object] can be EDGE, LOOP, FACE, SHELL, BODY or {\it Effective Topology} counterpart
\item[props] 14 \textcolor{magenta}{double}s filled reflecting Volume, Area (or Length), Center of Gravity (3) and the inertia matrix at CG (9)
\item[icode] the integer return code
\end{description}

Computes and returns the physical and inertial properties of a Topology Object.
}

\end{block}

\end{frame}


  \begin{frame}
  \Frametitle{{\tt EGADS} API -- Utility \& IO Functions}

\begin{block}{Memory Functions}
\vspace{0.05in}
\footnotesize
These functions need to be used instead of the C/C++ variants for persistent memory due to the need to allocate/free from the same DLL under Windows.\\[0.15in]
{\scriptsize

{\tt
~~~~~~~~~~~~EG\_free(\textcolor{magenta}{void} *ptr);\\[0.15in]

\textcolor{magenta}{void} *ptr = EG\_alloc(\textcolor{magenta}{size\_t}~nbytes);\\[0.15in]

\textcolor{magenta}{void} *ptr = EG\_calloc(\textcolor{magenta}{size\_t} nele, \textcolor{magenta}{size\_t} size);\\[0.15in]

\textcolor{magenta}{void} *ptr = EG\_reall(\textcolor{magenta}{void} *pointer, \textcolor{magenta}{size\_t} nbytes);\\[0.15in]

\textcolor{magenta}{char} *str = EG\_strdup(\textcolor{magenta}{const char} *string);\\
}

}

\end{block}
\end{frame}


\begin{frame}
  \Frametitle{{\tt EGADS} API -- Utility \& IO Functions}

\begin{block}{Get revision}
{\scriptsize

{\tt
~~~~~EG\_revision(\textcolor{magenta}{int} *imajor, \textcolor{magenta}{int} *iminor, \textcolor{magenta}{const char} **OCCrev);}\\[0.05in]

\begin{description}
\item[imajor] the returned major revision
\item[iminor] the returned minor revision number
\item[OCCrev] the returned revision of {\tt OpenCASCADE} in use
\end{description}
Returns the version information for both {\tt EGADS} and {\tt OpenCASCADE}.}

\end{block}

\begin{block}{Open}
{\scriptsize

{\tt
icode = EG\_open(\textcolor{blue}{ego} *context);}\\[0.05in]

\begin{description}
\item[context] the returned Context Object
\item[icode] the integer return code
\end{description}

Opens and returns a Context object. This is required for the use of all {\tt EGADS} (except for the above).}

\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Utility \& IO Functions}

\begin{block}{Close a Context}
{\scriptsize

{\tt
icode = EG\_close(\textcolor{blue}{ego} context);}\\

\begin{description}
\item[context] the Context Object to close
\item[icode] the integer return code
\end{description}
Cleans up and closes the Context.}

\end{block}

\begin{block}{Delete Object}
{\scriptsize

{\tt
icode = EG\_deleteObject(\textcolor{blue}{ego} object);}\\[0.05in]

\begin{description}
\item[object] the Object to delete
\item[icode] the integer return code
\end{description}

\vspace{0.05in}
Deletes an Object (if possible). A positive return indicates that the Object is still referenced by this number\\
of other Objects and has not been removed from the Context. If the Object is the Context then all \\
Geometry/Topology Objects in the Context are deleted except those attached to Body or
Model Objects.\\
}
\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Utility \& IO Functions}

\begin{block}{Read Geometric data from a File}
{\scriptsize

{\tt
icode = EG\_loadModel(\textcolor{blue}{ego} context, \textcolor{magenta}{int} bitFlag, \textcolor{magenta}{const char} *name, \\
\hspace{1.33in} \textcolor{blue}{ego} *model);}\\[0.05in]

\begin{description}
\item[context] the Context Object to receive the geometry
\item[bitFlag] Options (additive):
 \begin{tabular}{ r  l }
    1 & Don't split closed and periodic entities \\
    2 &  Split to maintain at least $C^1$ in BSPLINEs  \\
    4 &  Don't maintain Units on STEP/IGES read (always millimeters) \\
    8 & Try to merge Edges and Faces (with same geometry) \\
  16 & Load unattached Edges as WireBodies (stp/step \& igs/iges) \\
  \end{tabular}
\item[name] path of file to load (with extension -- case insensitive):
 \begin{tabular}{ c  l }
    igs/iges & IGES file \\
    stp/step &  STEP file  \\
    brep  &  native {\tt OpenCASCADE} file  \\
    egads & native file format with persistent Attributes (splits ignored) \\
  \end{tabular}
\item[model] the returned Model Object that was read
\item[icode] the integer return code
\end{description}

Loads and returns a Model Object from disk and puts it in the Context.\\
}

\end{block}

\end{frame}


\begin{frame}
  \Frametitle{{\tt EGADS} API -- Utility \& IO Functions}

\begin{block}{Writes the Model to a File}
{\scriptsize

{\tt
icode = EG\_saveModel(\textcolor{blue}{const ego} object, \textcolor{magenta}{const char} *name);}\\[0.05in]

\begin{description}
\item[object] the Model Object to write
\item[name] path of file to write, type based on extension (case insensitive):
 \begin{tabular}{ c  l }
    igs/iges & IGES file \\
    stp/step &  STEP file  \\
    brep  &  a native {\tt OpenCASCADE} file  \\
    egads & a native file format with persistent Attributes and the ability to write\\
               & EBody and Tessellation data \\
  \end{tabular}
\item[icode] the integer return code
\end{description}

\vspace{0.05in}
Writes the BReps (with optional Tessellation and EBody Objects) contained in the Model to disk. Only writes BRep data for anything but {\tt EGADS} output.

\vspace{0.05in}
Note: \textcolor{espred}{object} can be a single Body for convenience
}

\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Utility \& IO Functions}

\vspace{-0.05in}
\begin{block}{Copy and optionally Transform an Object}
{\scriptsize

{\tt
~icode = EG\_copyObject(\textcolor{blue}{const ego} object, \textcolor{magenta}{void} *other, \textcolor{blue}{ego} *newObj);}\\

\begin{description}
\item[object] the Object to copy
\vspace{-0.025in}
\item [other] Transformation Object, Body Object, \textcolor{magenta}{NULL} for a strict copy, or a vector of \textcolor{magenta}{double}s
\vspace{-0.025in}
\item[newObj] The resultant new Object
\vspace{-0.025in}
\item[icode] the integer return code
\end{description}

\vspace{0.01in}
Creates a new {\tt EGADS} Object by copying and optionally transforming the input object. A Tessellation or PCurve
Object cannot be transformed. For a Tessellation Object, \textcolor{espred}{other} can be a vector of displacements that is 3 times the number of
 vertices of \textcolor{magenta}{double}s in length to {\it morph} the tessellation. Also, if \textcolor{espred}{object} is a Tessellation Object or
 an EBody Object and  \textcolor{espred}{other} is a Body Object, the existing Object is copied but associated with the Body specified (not
the original referenced object). Note that \textcolor{espred}{other} is not checked if it is compatible with the original referenced Body.\\[0.075in]

If \textcolor{espred}{ other} is a Context, then \textcolor{espred}{object} is copied to this target Context. This is useful in multithreaded settings.\\[0.05in]
}

\end{block}

\vspace{-0.05in}
\begin{block}{Get the Context}
{\scriptsize

{\tt
~icode = EG\_getContext(\textcolor{blue}{ego} object, \textcolor{blue}{ego} *context);}\\

\begin{description}
\item[object] the queried Object
\vspace{-0.025in}
\item[context] the returned owning Context
\vspace{-0.025in}
\item[icode] the integer return code
\end{description}
\vspace{-0.05in}
%Returns the Context given an object. 
}

\end{block}

\end{frame}


\begin{frame}
\Frametitle{{\tt EGADS} Objects -- Attribution}
\begin{itemize}
\item Attributes -- metadata consisting of name/value pairs
\begin{itemize}
\item Unique name -- no spaces
\item A single type: Integer, Real, String, CSys, Pointer (not persistent)
\item A length (for Integers \& Reals)
\end{itemize}
\item Objects
\begin{itemize}
\item Any (non-internal) Object can have multiple Attributes
\item Only Attributes on Topological Objects are copied and are persistent (saved)
\end{itemize}
\item SBO \& Intersection Functions
\begin{itemize}
\item Unmodified Topological Objects maintain their Attributes
\item Face Attributes are carried through to the resultant fragments
\item All other Attributes may be lost
\end{itemize}
\item CSys Attributes are modified through Transformations
\end{itemize}
\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Attribution}

\begin{block}{Add an Attribute to an Object}
{\scriptsize

{\tt
icode = EG\_attributeAdd(\textcolor{blue}{ego} object, \textcolor{magenta}{const char} *name, \textcolor{magenta}{int} type, \\
\hspace{1.52in} \textcolor{magenta}{int} len, \textcolor{magenta}{const int} *ints, \textcolor{magenta}{const double} *reals, \\
\hspace{1.52in} \textcolor{magenta}{const char} *string);}\\[0.05in]

\begin{description}
\item[object] the Object to attribute
\item[name] the name of the attribute
\item[type] the attribute type: \\
ATTRINT, ATTRREAL, ATTRSTRING, ATTRCSYS or ATTRPTR
\item[len] 	the number of integers or reals (ignored for strings and pointers)
\item[ints] the integers for ATTRINT
\item [reals] the floating-point data for ATTRREAL or ATTRCSYS
\item[string] the character string pointer for ATTRSTRING or ATTRPTR types
\item[icode] the integer return code
\end{description}

Notes:\\
\begin{enumerate}
\item Only the one appropriate attribute value (of \textcolor{espred}{ints}, \textcolor{espred}{reals} or \textcolor{espred}{string}) is required.
\item If the \textcolor{espred}{name} already exists the type and value(s) are overwritten.
\end{enumerate}
}

\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Attribution}

\begin{block}{Delete an Attribute from an Object}
{\scriptsize

{\tt
icode = EG\_attributeDel(\textcolor{blue}{ego} object, \textcolor{magenta}{const char} *name);}\\[0.05in]

\begin{description}
\item[object] the Object
\item[name] the name of the attribute to delete
\item[icode] the integer return code
\end{description}

Deletes an attribute from the Object. If the name is \textcolor{magenta}{NULL}  then all attributes are 
removed from this Object.}

\end{block}

\begin{block}{The number of Object Attributes}
{\scriptsize

{\tt
icode = EG\_attributeNum(\textcolor{blue}{ego} object, \textcolor{magenta}{int} *nAttr)};\\[0.05in]

\begin{description}
\item[object] the Object
\item[nAttr] the returned number of attributes attached to the Object
\item[icode] the integer return code
\end{description}

Returns the number of attributes found with this object.}

\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Attribution}

\begin{block}{Return an Attribute on an Object}
{\scriptsize

{\tt
~~icode = EG\_attributeRet(\textcolor{blue}{ego} object, \textcolor{magenta}{const char} *name, \textcolor{magenta}{int} *type, \\
\hspace{1.65in} \textcolor{magenta}{int} *len, \textcolor{magenta}{const int} **ints, \\
\hspace{1.65in} \textcolor{magenta}{const double} **reals, \textcolor{magenta}{const char} **string);}\\[0.05in]

\begin{description}
\item[object] the Object to query
\item[name] the name to query
\item[type] the type: ATTRINT, ATTRREAL, ATTRSTRING, ATTRCSYS or ATTRPTR
\item[len] 	the returned number of integers or reals
\item[ints] the returned pointer to integers for ATTRINT
\item [reals] the returned pointer to floating-point data for ATTRREAL or ATTRCSYS
\item[string] the returned pointer to a character string for ATTRSTRING or ATTRPTR types
\item[icode] the integer return code
\end{description}

Notes:\\
\begin{enumerate}
\item Only the appropriate attribute value (of \textcolor{espred}{ints}, \textcolor{espred}{reals} or \textcolor{espred}{string}) is returned.\\[-0.075in]
\item The CSys (12 reals) is returned in \textcolor{espred}{reals} after the \textcolor{espred}{len} values.
\end{enumerate}
}

\end{block}

\end{frame}


\begin{frame}
  \Frametitle{{\tt EGADS} API -- Attribution}

\begin{block}{Get an Attribute on an Object}
{\scriptsize

{\tt
icode = EG\_attributeGet(\textcolor{blue}{ego} object, \textcolor{magenta}{int} index, \textcolor{magenta}{const char} **name, \\
\hspace{1.52in}  \textcolor{magenta}{int} *type, \textcolor{magenta}{int} *len,~~~\textcolor{magenta}{const int}~~**ints, \\
\hspace{1.52in} \textcolor{magenta}{const double} **reals,~~\textcolor{magenta}{const char} **string);}\\[0.05in]

\begin{description}
\item[object] the Object to query
\item[index] the index (1 to \textcolor{espred}{nAttr} from {\tt EG\_attributeNum})
\item[name] the returned name
\item[type] the type: ATTRINT, ATTRREAL, ATTRSTRING, ATTRCSYS or ATTRPTR
\item[len] 	the returned number of integers or reals
\item[ints] the returned pointer to integers for ATTRINT
\item [reals] the returned pointer to floating-point data for ATTRREAL or ATTRCSYS
\item[string] the returned pointer to a character string for ATTRSTRING or ATTRPTR types
\item[icode] the integer return code
\end{description}

Notes:\\
\begin{enumerate}
\item Only the appropriate attribute value (of \textcolor{espred}{ints}, \textcolor{espred}{reals} or \textcolor{espred}{string}) is returned.\\[-0.075in]
\item The CSys (12 reals) is returned in \textcolor{espred}{reals} after the \textcolor{espred}{len} values.
\end{enumerate}

}

\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Attribution}

\begin{block}{Copy the Attributes from an Object to another}
{\scriptsize

{\tt
icode = EG\_attributeDup(\textcolor{blue}{ego} src, \textcolor{blue}{ego} dst);}\\[0.05in]

\begin{description}
\item[src] the source Object
\item[dst] the Object to receive \textcolor{espred}{src}'s attributes
\item[icode] the integer return code
\end{description}

Deletes an attribute from the destination Object and then copies the source's attributes to the destination.\\[-0.075in]
ATTRPTR attributes copy the pointer, other types allocate new data and copy the contents of the source.}

\end{block}
\end{frame}

  \begin{frame}
\Frametitle{{\tt EGADS} Tessellation Objects}

\vspace{-0.05in}
  \begin{block}{Geometry}
  \begin{itemize}
    \item Unconnected discretization of a range of the Object
    \begin{itemize}
      \item Polyline for curves at constant $t$ increments
      \item Regular grid for surfaces at constant increments (isoclines)
    \end{itemize}
  \end{itemize}
  \end{block}

\vspace{-0.05in}
   \begin{block}{Body Topology}
  \begin{itemize}
    \item Connected and trimmed tessellation including:
    \begin{itemize}
      \item Polyline for Edges
      \item Triangulation for Faces
      \item Optional Quadrilateral Patching for Faces
    \end{itemize}
   \item Ownership and Geometric Parameters for Vertices
   \item Adjustable parameters for side length and curvature (x2)
   \item Watertight
   \item Exposed per Face/Edge or Global indexing
  \end{itemize}
  \end{block}

\end{frame}

 \begin{frame}
\Frametitle{{\tt EGADS} Tessellation Objects}

\vspace{-.2in}
  \begin{center}
    \includegraphics[width=2.3in]{vGeom.png}
    \includegraphics[width=2.3in]{vTess.png}\\
  \end{center}
  \vspace{-0.15in}
  ~~~~~~from \$ESP\_ROOT/bin/vGeom~~~~~~~~~~from \$ESP\_ROOT/bin/vTess
\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Tessellation}

\begin{block}{Creates a Discrete Object from a Body}
{\scriptsize

{\tt
icode = EG\_makeTessBody(\textcolor{blue}{ego} body, \textcolor{magenta}{double} *parms, \textcolor{blue}{ego} *tess);}\\

\begin{description}
\item[body] the input Body or closed EBody Object, may be any Body type
\item[parms] a set of 3 parameters that drive the Edge discretization and the Face
		triangulation:\\
		\textcolor{espred}{params[0]} -- the maximum length of an Edge segment or
		triangle side (in physical space); a zero is no limit, and a negative value only tessellates Edges.\\
		\textcolor{espred}{params[1]} -- a curvature-based value that looks locally at the deviation
		between the centroid of the discrete object and the underlying geometry.
		Any deviation larger than the input value will cause the tessellation to be
		enhanced in those regions.\\
		\textcolor{espred}{params[2]} -- the maximum interior dihedral
		angle (in degrees) between triangle facets (or Edge segment tangents
		for a WIREBODY tessellation), note that a zero ignores this phase.
\item[tess] the returned resultant Tessellation of \textcolor{espred}{body}
\item[icode] the integer return code
\end{description}}

\center
\footnotesize
See the next page for attribute-based tessellation control.
\end{block}

\end{frame}

\begin{frame}
  \Frametitle{{\tt EGADS} API -- Tessellation}

\begin{block}{Tessellation control at the Topological level}
{\scriptsize

\begin{description}
\item[.tParams] this attribute can be placed on the Body, individual Faces or Edges which overrides \textcolor{espred}{parms} locally (the minimums are used). This attribute must be ATTRREAL and have 3 values (as described in EG\_makeTessBody).
\item[.tParam] like the attribute \textcolor{espred}{.tParams}, this attribute completely overrides \textcolor{espred}{parms} locally (without using the minimum).
\item[.tPos] this ATTRREAL attribute on an Edge directly sets the $t$s for interior Edge positions.
\item[.rPos] this ATTRREAL attribute sets the relative spacing (in arc-length) for interior Edge positions.
\item[.nPos] this ATTRINT attribute sets the number of interior vertices (length is 1). The spacing is set equal in arc-length.
\item[.inserts] this ATTRREAL attribute (on a Face) specifies that these vertex $[u,v]$ positions will be inserted into the tessellation. The
length must be 2 times the number of inserts.
\item[.insert!] like the attribute \textcolor{espred}{.inserts}, this specifies the $[u,v]$ positions to be inserted, but after these inserts the Face tessellation terminates (i.e., no additional insertions are performed by the normal algorithm).
\end{description}

Note:\\[-0.05in]
 An ATTRINT attribute \textcolor{espred}{.tPos}  or \textcolor{espred}{.rPos} of length 1 and containing a zero indicates no interior points.
}
\end{block}

\end{frame}


\begin{frame}
  \Frametitle{{\tt EGADS} API -- Tessellation}

\begin{block}{Gets the Edge discretization data}
{\scriptsize

{\tt
icode = EG\_getTessEdge(\textcolor{blue}{const ego} tess, \textcolor{magenta}{int} eIndex, \textcolor{magenta}{int} *len,\\
\hspace{1.455in} \textcolor{magenta}{const double} **xyzs, \textcolor{magenta}{const double} **ts);}\\[0.05in]

\begin{description}
\item[tess] the input Body Tessellation Object
\item[eIndex] the Edge index (1 bias). The Edge Objects and number of Edges
		can be retrieved via {\tt EG\_getBodyTopos} and/or {\tt EG\_indexBodyTopo} .
		A minus index refers to the use of a mapped (+) Edge index from applying
		the functions {\tt EG\_mapBody} and {\tt EG\_mapTessBody}.
\item[len] the returned number of vertices in the Edge discretization
\item[xyzs] the returned pointer to the set of coordinate data -- 3*\textcolor{espred}{len} in length
\item[ts] the returned pointer to the parameter values associated with each
		vertex -- \textcolor{espred}{len} in length
\item[icode] the integer return code
\end{description}

\vspace{0.025in}
Note: DEGENERATE Edges return 2 vertices (both the same coordinates of the single Node) and the $t$\\[-0.075in]
range in \textcolor{espred}{ts}. This Edge will not be referenced in the associated Face tessellation.
}

\end{block}

\end{frame}


\begin{frame}
  \Frametitle{{\tt EGADS} API -- Tessellation}

\begin{block}{Gets the Face triangulation data}
{\scriptsize

{\tt
icode = EG\_getTessFace(\textcolor{blue}{const ego} tess, \textcolor{magenta}{int} fIndex, \textcolor{magenta}{int} *len,\\[-0.01in]
\hspace{1.455in} \textcolor{magenta}{const double} **xyz, \textcolor{magenta}{const double} **uv, \\[-0.01in]
\hspace{1.455in} \textcolor{magenta}{const int} **ptype, \textcolor{magenta}{const int} **pindx, \textcolor{magenta}{int} *ntri, \\[-0.01in]
\hspace{1.455in} \textcolor{magenta}{const int} **tris, \textcolor{magenta}{const int} **tric);}\\[0.05in]


\begin{description}
\item[tess] the input Body Tessellation Object
\item[fIndex] the Face index (1 bias) -- Minus index refers to a mapped (+) Face index (if it exists).
%. The Face Objects and number of Faces
%		can be retrieved via {\tt EG\_getBodyTopos} (page~\pageref{EGgetBodyTopos}) and/or
%		 {\tt EG\_indexBodyTopo} (page~\pageref{EGindexBodyTopo}).
\item[len] the returned number of vertices in the Face triangulation
\item[xyz] the returned pointer to the set of coordinate data -- 3*\textcolor{espred}{len} in length
\item[uv] the returned pointer to the parameters for each vertex -- 2*\textcolor{espred}{len} in length
\item[ptype] returned pointer to the vertex type (-1 - internal, 0 - Node, $>0$ Edge) -- \textcolor{espred}{len} in length
\item[pindx] returned pointer to vertex index (-1 internal) -- \textcolor{espred}{len} in length
\item[ntri] returned number of triangles
\item[tris] returned pointer to triangle indices, 3 per triangle (1 bias) -- 3*\textcolor{espred}{ntri} in length\\
orientation consistent with the Face's \textcolor{espred}{mtype}
\item[tric] returned pointer to neighbor information, 3 per triangle looking at opposing side:\\
		triangle (1-ntri), negative is Edge index for an external side -- 3*\textcolor{espred}{ntri} in length
\item[icode] the integer return code
\end{description}
}

\end{block}

\end{frame}


\begin{frame}[fragile]
  \Frametitle{{\tt EGADS} API -- Tessellation}

\begin{block}{Status of a Tessellation Object}
{\scriptsize

{\tt
icode = EG\_statusTessBody(\textcolor{blue}{ego} tess, \textcolor{blue}{ego} *body, \textcolor{magenta}{int} *stat, \textcolor{magenta}{int} *npts);}\\[0.05in]

\begin{description}
\item[tess] the Tessellation Object to query
\item[body] the returned associated Body Object
\item[stat] the returned state of the tessellation: -1 -- closed but warned, 0 -- open, 1 -- OK,\\ 2 -- displaced
\item[npts] the returned number of global points in the tessellation (0 -- open)
\item[icode] the integer return code: EGADS\_SUCCESS -- complete, EGADS\_OUTSIDE -- still open
\end{description}

Note: Placing the attribute ``.mixed'' on \textcolor{espred}{tess} before invoking this function allows for tri/quad (2 tris)\\
tessellations. The type must be ATTRINT and the length is the number of Faces, where the values are\\
the number of quads (triangle pairs) per Face. Single triangles are followed by triangle pairs for a Face\\
with both triangle and quads.\\[-0.075in]
%
\begin{center}
\begin{columns}
\begin{column}{0.25\textwidth}
Given quad 1 2 3 4 ==$>$ \\
trias 1 2 3 and 1 3 4
\end{column}
\begin{column}{0.1\textwidth}
\begin{verbatim}
4---3
| / |
1---2
\end{verbatim}
\end{column}
\begin{column}{0.4\textwidth}
\end{column}
\end{columns}
\end{center}
}

\end{block}

\end{frame}



\begin{frame}
  \Frametitle{{\tt EGADS} API -- Tessellation}

\vspace{-0.05in}
\begin{block}{Global Lookup}
{\scriptsize

{\tt
icode = EG\_localToGlobal(\textcolor{blue}{const ego} tess, \textcolor{magenta}{int} ind, \textcolor{magenta}{int} locl, \textcolor{magenta}{int} *gbl);}

\begin{description}
\item[tess] the closed Tessellation Object
\item[ind] the topological index (1 bias) -- 0 Node, (-) Edge, (+) Face
\item[locl] the local (or Node) index
\item[gbl] the returned global vertex index
\item[icode] the integer return code
\end{description}
}

\end{block}

\vspace{-0.05in}
\begin{block}{Gets the vertex type and index}
{\scriptsize

{\tt
icode = EG\_getGlobal(\textcolor{blue}{const ego} tess, \textcolor{magenta}{int} global, \textcolor{magenta}{int} *pytpe,\\[-0.01in]
\hspace{1.325in} \textcolor{magenta}{int} *pindex, \textcolor{magenta}{double} *xyz);}

\begin{description}
\item[tess] the closed Tessellation Object
\item[global] the global index (1 bias)
\item[ptype] the point type (-) Face local index, (0) Node, (+) Edge local index
\item[pindex] the point topological index (1 bias)
\item[xyz] the filled (3 in length) coordinates at this global index (can be \textcolor{magenta}{NULL})
\item[icode] the integer return code
\end{description}
}

\end{block}

\end{frame}

\begin{frame}
\Frametitle{Exercises}
 \vspace{-0.05in}
In the {\it exercise/session02} directory:
\begin{itemize}
 \vspace{-0.025in}
\item Examine the {\tt Makefile} (or {\tt NMakefile} on Windows). Notice the library(s) included.
 \vspace{-0.025in}
\item Build the executable and run it. The output should look like:\\[0.05in]
{\tiny \tt
 Using EGADS  1.28 Interim Release with OpenCASCADE 7.8.1\\[0.05in]

 Number of Bodies = 2\\[0.05in]

 Body 0: Name = capsLength  String = cm\\
~~~Tessellation  0  npts = 1306 (Solid)\\
~~~Volumes = 7.280172e+00  7.296560e+00\\
 Body 1: Name = capsLength  String = cm\\
~~~Tessellation  0  npts = 2263 (Solid)\\
~~~Volumes = 3.454432e+01  3.464152e+01\\[0.05in]

 EGADS Info: 0 Objects, 0 Reference in Use (of 247) at Close!\\
 }
 \vspace{-0.025in}
\item Modify {\tt myExample.c} to print all attributes using {\tt EG\_getBodyTopos} for all of the
FACEs, EDGEs and NODEs in each Body. Note that you must {\it free} the vectors of Objects.
\item Modify {\tt myExample.c} to traverse the BRep Topology from Model to Nodes using
{\tt EG\_getTopology} and output all attributes attached to each Topological entity.
 \vspace{-0.025in}
\end{itemize}

\end{frame}


\end{document}
