[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: next PCB release - 1.99za vs 4.0



On Sun, Sep 12, 2010 at 01:56:43PM -0400, DJ Delorie wrote:
> 
> > http://download.wpsoftware.net/code/pcb/layer.h
> 
> I would add a LayerPos to each Layer, and store the Layers separately.
>

Okay, here is the structure: attached to the PCB is a physical layer stack.
This has a well-defined stacking order, knows about layer geometries(?) and
knows what the TOP and BOTTOM layers are at any given point on the board.

In footprint mode, this also includes a dedicated Top and Bottom layer.
Normal PCBs don't have a dedicated Top or Bottom layer, since as you said,
we may want irregularly shaped PCBs and have different layers be the Top
at different positions.

From there, any number of drawing layers exist. Each of these is linked to
a number of physical layers (may be zero).

 
Vias exist on the physical stack independent of the drawing layers. I don't
really like this but I think it makes sense. Similarly, footprints that are
imported should exist on the physical layer stack (since they have Top and
Bottom layers, and what does the "top" drawing layer mean?).


Here are the relevant structures:


/*** BEGIN ***/

/*!
 * The type of drawing layer
 */
typedef enum
{
  LYR_COPPER,	/*! conductive */
  LYR_SILK,	/*! non-conductive */
  LYR_KEEPOUT,	/*! keepout layer */
  LYR_VIRTUAL	/*! internal (ie, ratsnest) */
}
LayerStyle;

/*!
 * Qualitive position in the physical layer stack
 */
typedef enum
{
  LYR_TOP,	/*! top ("component side") */
  LYR_INNER,	/*! middle */
  LYR_BOTTOM	/*! bottom ("solder side") */
  LYR_OUTER	/*! both top and bottom */
}
LayerPos;

/*!
 * Physical layer structure
 */
typedef struct
{
  const char *name;	/*! Layer name */
  const char *color;	/*! Layer color */

  LayerPos position;	/*! Top/Inner/Bottom (for footprints) */
  unsigned z_index;	/*! Stacking order (for PCBs and inner footprint layers) */

  void *geometry;	/*! The shape of the layer */
}
PhysicalLayer;

/*!
 * Drawing layer structure
 * Drawing layers are contained within "layer groups" or physical layers,
 * which in turn are placed on the layer stack.
 */
typedef struct
{
  const char *name;	/*! Layer name */
  const char *color;	/*! Layer color */

  LayerStyle style;	/*! Layer material */

  PhysicalLayer **layer;	/*! Associated physical layers */
  unsigned n_physical_layers;	/*! Number of physical layers */

  int b_visible;	/*! Visible in GUI */
  int b_active;		/*! Active layer in GUI */
  int b_vacuum;		/*! "Hole mode" in GUI */
  int b_locked;		/*! Un-editable in GUI */
}
DrawingLayer;

/*!
 * Layer stack structure
 */
typedef struct
{
  PhysicalLayer **layer;	/*! List of layers */
  unsigned n_layers;		/*! Number of layers */

  unsigned _allocated_layers;	/*! private */
}
LayerStack;

/*** END ***/


Andrew



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user