Commit a91eabb8 authored by unknown's avatar unknown Committed by jean-pierre charras
Browse files

Apply vrml_layer_pth, from Cirilo Bernardo

parent 52d2e7eb
Loading
Loading
Loading
Loading
+70 −72
Original line number Original line Diff line number Diff line
@@ -25,37 +25,6 @@
 */
 */




/*
 * NOTE:
 * 1. for improved looks, create a DRILL layer for PTH drills.
 *      To render the improved board, render the vertical outline only
 *      for the board (no added drill holes), then render the
 *      outline only for PTH, and finally render the top and bottom
 *      of the board. NOTE: if we don't want extra eye-candy then
 *      we must maintain the current board export.
 *      Additional bits needed for improved eyecandy:
 *      + CalcOutline: calculates only the outline of a VRML_LAYER or
 *          a VERTICAL_HOLES
 *      + WriteVerticalIndices: writes the indices of only the vertical
 *          facets of a VRML_LAYER or a VRML_HOLES.
 *      + WriteVerticalVertices: writes only the outline vertices to
 *          form vertical walls; applies to VRML_LAYER and VRML_HOLES
 *
 * 2. How can we suppress fiducials such as those in the corners of the pic-programmer demo?
 *
 */

/*
 * KNOWN BUGS:
 * 1. silk outlines are sometimes mangled; this is somehow due to
 *    many overlapping segments. This does not happen in 3Dviewer
 *    so it is worth inspecting that code to see what is different.
 *
 *    These artefacts can be suppressed for exploratory purposes by
 *    removing the line width parameter from the length calculation in
 *    export_vrml_line()
 */

#include <fctsys.h>
#include <fctsys.h>
#include <kicad_string.h>
#include <kicad_string.h>
#include <wxPcbStruct.h>
#include <wxPcbStruct.h>
@@ -88,7 +57,7 @@
#define MIN_VRML_LINEWIDTH 0.12
#define MIN_VRML_LINEWIDTH 0.12


// offset for art layers, mm (silk, paste, etc)
// offset for art layers, mm (silk, paste, etc)
#define  ART_OFFSET 0.02
#define  ART_OFFSET 0.025


/* helper function:
/* helper function:
 * some characters cannot be used in names,
 * some characters cannot be used in names,
@@ -183,6 +152,7 @@ public:
    VRML_LAYER  bot_silk;
    VRML_LAYER  bot_silk;
    VRML_LAYER  top_tin;
    VRML_LAYER  top_tin;
    VRML_LAYER  bot_tin;
    VRML_LAYER  bot_tin;
    VRML_LAYER  plated_holes;


    double scale;           // board internal units to output scaling
    double scale;           // board internal units to output scaling
    double minLineWidth;    // minimum width of a VRML line segment
    double minLineWidth;    // minimum width of a VRML line segment
@@ -230,7 +200,17 @@ public:
    void SetOffset( double aXoff, double aYoff )
    void SetOffset( double aXoff, double aYoff )
    {
    {
        tx = aXoff;
        tx = aXoff;
        ty  = aYoff;
        ty = -aYoff;

        holes.SetVertexOffsets( aXoff, aYoff );
        board.SetVertexOffsets( aXoff, aYoff );
        top_copper.SetVertexOffsets( aXoff, aYoff );
        bot_copper.SetVertexOffsets( aXoff, aYoff );
        top_silk.SetVertexOffsets( aXoff, aYoff );
        bot_silk.SetVertexOffsets( aXoff, aYoff );
        top_tin.SetVertexOffsets( aXoff, aYoff );
        bot_tin.SetVertexOffsets( aXoff, aYoff );
        plated_holes.SetVertexOffsets( aXoff, aYoff );
    }
    }


    double GetLayerZ( LAYER_NUM aLayer )
    double GetLayerZ( LAYER_NUM aLayer )
@@ -278,6 +258,7 @@ public:
        bot_silk.SetArcParams( iMaxSeg, smin, smax );
        bot_silk.SetArcParams( iMaxSeg, smin, smax );
        top_tin.SetArcParams( iMaxSeg, smin, smax );
        top_tin.SetArcParams( iMaxSeg, smin, smax );
        bot_tin.SetArcParams( iMaxSeg, smin, smax );
        bot_tin.SetArcParams( iMaxSeg, smin, smax );
        plated_holes.SetArcParams( iMaxSeg, smin, smax );


        return true;
        return true;
    }
    }
@@ -455,6 +436,16 @@ static void write_layers( MODEL_VRML& aModel, std::ofstream& output_file, BOARD*
                        - Millimeter2iu( ART_OFFSET / 2.0 ) * aModel.scale,
                        - Millimeter2iu( ART_OFFSET / 2.0 ) * aModel.scale,
                        0, aModel.precision );
                        0, aModel.precision );


    // VRML_LAYER PTH;
    aModel.plated_holes.Tesselate( NULL, true );
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_TIN ),
                        &aModel.plated_holes, false, false,
                        aModel.GetLayerZ( LAST_COPPER_LAYER )
                        + Millimeter2iu( ART_OFFSET / 2.0 ) * aModel.scale,
                        aModel.GetLayerZ( FIRST_COPPER_LAYER )
                        - Millimeter2iu( ART_OFFSET / 2.0 ) * aModel.scale,
                        aModel.precision );

    // VRML_LAYER top_silk;
    // VRML_LAYER top_silk;
    aModel.top_silk.Tesselate( &aModel.holes );
    aModel.top_silk.Tesselate( &aModel.holes );
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_SILK ),
    write_triangle_bag( output_file, aModel.GetColor( VRML_COLOR_SILK ),
@@ -588,10 +579,10 @@ static void export_vrml_drawsegment( MODEL_VRML& aModel, DRAWSEGMENT* drawseg )
{
{
    LAYER_NUM layer = drawseg->GetLayer();
    LAYER_NUM layer = drawseg->GetLayer();
    double  w   = drawseg->GetWidth() * aModel.scale;
    double  w   = drawseg->GetWidth() * aModel.scale;
    double  x   = drawseg->GetStart().x * aModel.scale + aModel.tx;
    double  x   = drawseg->GetStart().x * aModel.scale;
    double  y   = drawseg->GetStart().y * aModel.scale + aModel.ty;
    double  y   = drawseg->GetStart().y * aModel.scale;
    double  xf  = drawseg->GetEnd().x * aModel.scale + aModel.tx;
    double  xf  = drawseg->GetEnd().x * aModel.scale;
    double  yf  = drawseg->GetEnd().y * aModel.scale + aModel.ty;
    double  yf  = drawseg->GetEnd().y * aModel.scale;


    // Items on the edge layer are handled elsewhere; just return
    // Items on the edge layer are handled elsewhere; just return
    if( layer == EDGE_N )
    if( layer == EDGE_N )
@@ -626,12 +617,10 @@ static void vrml_text_callback( int x0, int y0, int xf, int yf )
    LAYER_NUM s_text_layer = model_vrml->s_text_layer;
    LAYER_NUM s_text_layer = model_vrml->s_text_layer;
    int s_text_width = model_vrml->s_text_width;
    int s_text_width = model_vrml->s_text_width;
    double  scale = model_vrml->scale;
    double  scale = model_vrml->scale;
    double  tx  = model_vrml->tx;
    double  ty  = model_vrml->ty;


    export_vrml_line( *model_vrml, s_text_layer,
    export_vrml_line( *model_vrml, s_text_layer,
            x0 * scale + tx, y0 * scale + ty,
            x0 * scale, y0 * scale,
            xf * scale + tx, yf * scale + ty,
            xf * scale, yf * scale,
            s_text_width * scale );
            s_text_width * scale );
}
}


@@ -729,8 +718,6 @@ static void export_vrml_board( MODEL_VRML& aModel, BOARD* pcb )
    }
    }


    double  scale = aModel.scale;
    double  scale = aModel.scale;
    double  dx  = aModel.tx;
    double  dy  = aModel.ty;


    int i = 0;
    int i = 0;
    int seg;
    int seg;
@@ -756,8 +743,8 @@ static void export_vrml_board( MODEL_VRML& aModel, BOARD* pcb )
            if( bufferPcbOutlines[i].end_contour )
            if( bufferPcbOutlines[i].end_contour )
                break;
                break;


            aModel.board.AddVertex( seg, bufferPcbOutlines[i].x * scale + dx,
            aModel.board.AddVertex( seg, bufferPcbOutlines[i].x * scale,
                    -(bufferPcbOutlines[i].y * scale + dy) );
                    -(bufferPcbOutlines[i].y * scale ) );


            ++i;
            ++i;
        }
        }
@@ -788,8 +775,8 @@ static void export_vrml_board( MODEL_VRML& aModel, BOARD* pcb )
            if( allLayerHoles[i].end_contour )
            if( allLayerHoles[i].end_contour )
                break;
                break;


            aModel.holes.AddVertex( seg, allLayerHoles[i].x * scale + dx,
            aModel.holes.AddVertex( seg, allLayerHoles[i].x * scale,
                                    -(allLayerHoles[i].y * scale + dy) );
                                    -(allLayerHoles[i].y * scale ) );


            ++i;
            ++i;
        }
        }
@@ -849,8 +836,8 @@ static void export_vrml_via( MODEL_VRML& aModel, BOARD* pcb, const VIA* via )


    hole = via->GetDrillValue() * aModel.scale / 2.0;
    hole = via->GetDrillValue() * aModel.scale / 2.0;
    r   = via->GetWidth() * aModel.scale / 2.0;
    r   = via->GetWidth() * aModel.scale / 2.0;
    x   = via->GetStart().x * aModel.scale + aModel.tx;
    x   = via->GetStart().x * aModel.scale;
    y   = via->GetStart().y * aModel.scale + aModel.ty;
    y   = via->GetStart().y * aModel.scale;
    via->LayerPair( &top_layer, &bottom_layer );
    via->LayerPair( &top_layer, &bottom_layer );


    // do not render a buried via
    // do not render a buried via
@@ -873,10 +860,10 @@ static void export_vrml_tracks( MODEL_VRML& aModel, BOARD* pcb )
        else if( track->GetLayer() == FIRST_COPPER_LAYER
        else if( track->GetLayer() == FIRST_COPPER_LAYER
                 || track->GetLayer() == LAST_COPPER_LAYER )
                 || track->GetLayer() == LAST_COPPER_LAYER )
            export_vrml_line( aModel, track->GetLayer(),
            export_vrml_line( aModel, track->GetLayer(),
                    track->GetStart().x * aModel.scale + aModel.tx,
                    track->GetStart().x * aModel.scale,
                    track->GetStart().y * aModel.scale + aModel.ty,
                    track->GetStart().y * aModel.scale,
                    track->GetEnd().x * aModel.scale + aModel.tx,
                    track->GetEnd().x * aModel.scale,
                    track->GetEnd().y * aModel.scale + aModel.ty,
                    track->GetEnd().y * aModel.scale,
                    track->GetWidth() * aModel.scale );
                    track->GetWidth() * aModel.scale );
    }
    }
}
}
@@ -886,9 +873,6 @@ static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb )
{
{


    double scale = aModel.scale;
    double scale = aModel.scale;
    double dx = aModel.tx;
    double dy = aModel.ty;

    double x, y;
    double x, y;


    for( int ii = 0; ii < aPcb->GetAreaCount(); ii++ )
    for( int ii = 0; ii < aPcb->GetAreaCount(); ii++ )
@@ -920,8 +904,8 @@ static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb )


            while( i < nvert )
            while( i < nvert )
            {
            {
                x = poly.GetX(i) * scale + dx;
                x = poly.GetX(i) * scale;
                y = -(poly.GetY(i) * scale + dy);
                y = -(poly.GetY(i) * scale);


                if( poly.IsEndContour(i) )
                if( poly.IsEndContour(i) )
                    break;
                    break;
@@ -971,10 +955,10 @@ static void export_vrml_edge_module( MODEL_VRML& aModel, EDGE_MODULE* aOutline,
                                     double aOrientation )
                                     double aOrientation )
{
{
    LAYER_NUM layer = aOutline->GetLayer();
    LAYER_NUM layer = aOutline->GetLayer();
    double  x   = aOutline->GetStart().x * aModel.scale + aModel.tx;
    double  x   = aOutline->GetStart().x * aModel.scale;
    double  y   = aOutline->GetStart().y * aModel.scale + aModel.ty;
    double  y   = aOutline->GetStart().y * aModel.scale;
    double  xf  = aOutline->GetEnd().x * aModel.scale + aModel.tx;
    double  xf  = aOutline->GetEnd().x * aModel.scale;
    double  yf  = aOutline->GetEnd().y * aModel.scale + aModel.ty;
    double  yf  = aOutline->GetEnd().y * aModel.scale;
    double  w   = aOutline->GetWidth() * aModel.scale;
    double  w   = aOutline->GetWidth() * aModel.scale;


    switch( aOutline->GetShape() )
    switch( aOutline->GetShape() )
@@ -1015,8 +999,8 @@ static void export_vrml_edge_module( MODEL_VRML& aModel, EDGE_MODULE* aOutline,
                corner.x += aOutline->GetPosition().x;
                corner.x += aOutline->GetPosition().x;
                corner.y += aOutline->GetPosition().y;
                corner.y += aOutline->GetPosition().y;


                x = corner.x * aModel.scale + aModel.tx;
                x = corner.x * aModel.scale;
                y = - ( corner.y * aModel.scale + aModel.ty );
                y = - ( corner.y * aModel.scale );


                if( !vl->AddVertex( seg, x, y ) )
                if( !vl->AddVertex( seg, x, y ) )
                    throw( std::runtime_error( vl->GetError() ) );
                    throw( std::runtime_error( vl->GetError() ) );
@@ -1037,8 +1021,8 @@ static void export_vrml_padshape( MODEL_VRML& aModel, VRML_LAYER* aTinLayer, D_P
{
{
    // The (maybe offset) pad position
    // The (maybe offset) pad position
    wxPoint pad_pos = aPad->ShapePos();
    wxPoint pad_pos = aPad->ShapePos();
    double  pad_x   = pad_pos.x * aModel.scale + aModel.tx;
    double  pad_x   = pad_pos.x * aModel.scale;
    double  pad_y   = pad_pos.y * aModel.scale + aModel.ty;
    double  pad_y   = pad_pos.y * aModel.scale;
    wxSize  pad_delta = aPad->GetDelta();
    wxSize  pad_delta = aPad->GetDelta();


    double  pad_dx  = pad_delta.x * aModel.scale / 2.0;
    double  pad_dx  = pad_delta.x * aModel.scale / 2.0;
@@ -1121,22 +1105,36 @@ static void export_vrml_pad( MODEL_VRML& aModel, BOARD* pcb, D_PAD* aPad )
    double  hole_drill_w    = (double) aPad->GetDrillSize().x * aModel.scale / 2.0;
    double  hole_drill_w    = (double) aPad->GetDrillSize().x * aModel.scale / 2.0;
    double  hole_drill_h    = (double) aPad->GetDrillSize().y * aModel.scale / 2.0;
    double  hole_drill_h    = (double) aPad->GetDrillSize().y * aModel.scale / 2.0;
    double  hole_drill = std::min( hole_drill_w, hole_drill_h );
    double  hole_drill = std::min( hole_drill_w, hole_drill_h );
    double  hole_x  = aPad->GetPosition().x * aModel.scale + aModel.tx;
    double  hole_x  = aPad->GetPosition().x * aModel.scale;
    double  hole_y  = aPad->GetPosition().y * aModel.scale + aModel.ty;
    double  hole_y  = aPad->GetPosition().y * aModel.scale;


    // Export the hole on the edge layer
    // Export the hole on the edge layer
    if( hole_drill > 0 )
    if( hole_drill > 0 )
    {
    {
        bool pth = false;

        if( aPad->GetAttribute() != PAD_HOLE_NOT_PLATED )
            pth = true;

        if( aPad->GetDrillShape() == PAD_DRILL_OBLONG )
        if( aPad->GetDrillShape() == PAD_DRILL_OBLONG )
        {
        {
            // Oblong hole (slot)
            // Oblong hole (slot)
            aModel.holes.AddSlot( hole_x, -hole_y, hole_drill_w * 2.0, hole_drill_h * 2.0,
            aModel.holes.AddSlot( hole_x, -hole_y, hole_drill_w * 2.0, hole_drill_h * 2.0,
                    aPad->GetOrientation()/10.0, true );
                    aPad->GetOrientation()/10.0, true, pth );

            if( pth )
                aModel.plated_holes.AddSlot( hole_x, -hole_y,
                                             hole_drill_w * 2.0, hole_drill_h * 2.0,
                                             aPad->GetOrientation()/10.0, true, false );
        }
        }
        else
        else
        {
        {
            // Drill a round hole
            // Drill a round hole
            aModel.holes.AddCircle( hole_x, -hole_y, hole_drill, true );
            aModel.holes.AddCircle( hole_x, -hole_y, hole_drill, true, pth );

            if( pth )
                aModel.plated_holes.AddCircle( hole_x, -hole_y, hole_drill, true, false );

        }
        }
    }
    }


@@ -1390,7 +1388,7 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName,
        EDA_RECT bbbox = pcb->ComputeBoundingBox();
        EDA_RECT bbbox = pcb->ComputeBoundingBox();


        model3d.SetOffset( -model3d.scale * bbbox.Centre().x,
        model3d.SetOffset( -model3d.scale * bbbox.Centre().x,
                           -model3d.scale * bbbox.Centre().y );
                           model3d.scale * bbbox.Centre().y );


        output_file << "  children [\n";
        output_file << "  children [\n";


+284 −70

File changed.

Preview size limit exceeded, changes collapsed.

+40 −11
Original line number Original line Diff line number Diff line
@@ -70,6 +70,7 @@ struct VERTEX_3D
    double  y;
    double  y;
    int i;          // vertex index
    int i;          // vertex index
    int o;          // vertex order
    int o;          // vertex order
    bool pth;       // true for plate-through hole
};
};


struct TRIPLET_3D
struct TRIPLET_3D
@@ -93,12 +94,18 @@ private:
    double minSegLength;                    // min. segment length
    double minSegLength;                    // min. segment length
    double maxSegLength;                    // max. segment length
    double maxSegLength;                    // max. segment length


    // Vertex offsets to work around a suspected GLU tesselator bug
    double offsetX;
    double offsetY;

    bool    fix;                            // when true, no more vertices may be added by the user
    bool    fix;                            // when true, no more vertices may be added by the user
    int     idx;                            // vertex index (number of contained vertices)
    int     idx;                            // vertex index (number of contained vertices)
    int     ord;                            // vertex order (number of ordered vertices)
    int     ord;                            // vertex order (number of ordered vertices)
    unsigned int idxout;                    // outline index to first point in 3D outline
    unsigned int idxout;                    // outline index to first point in 3D outline
    std::vector<VERTEX_3D*> vertices;       // vertices of all contours
    std::vector<VERTEX_3D*> vertices;       // vertices of all contours
    std::vector<std::list<int>*> contours;  // lists of vertices for each contour
    std::vector<std::list<int>*> contours;  // lists of vertices for each contour
    std::vector<bool>pth;                   // indicates whether a 'contour' is a PTH or not
    std::vector<bool>solid;                 // indicates whether a 'contour' is a solid or a hole
    std::vector< double > areas;            // area of the contours (positive if winding is CCW)
    std::vector< double > areas;            // area of the contours (positive if winding is CCW)
    std::list<TRIPLET_3D> triplets;         // output facet triplet list (triplet of ORDER values)
    std::list<TRIPLET_3D> triplets;         // output facet triplet list (triplet of ORDER values)
    std::list<std::list<int>*> outline;     // indices for outline outputs (index by ORDER values)
    std::list<std::list<int>*> outline;     // indices for outline outputs (index by ORDER values)
@@ -136,6 +143,9 @@ private:
    // calculate number of sides on an arc (angle is in radians)
    // calculate number of sides on an arc (angle is in radians)
    int calcNSides( double aRadius, double aAngle );
    int calcNSides( double aRadius, double aAngle );


    // returns the number of solid or hole contours
    int checkNContours( bool holes );

public:
public:
    /// set to true when a fault is encountered during tesselation
    /// set to true when a fault is encountered during tesselation
    bool Fault;
    bool Fault;
@@ -191,9 +201,11 @@ public:
     * Function NewContour
     * Function NewContour
     * creates a new list of vertices and returns an index to the list
     * creates a new list of vertices and returns an index to the list
     *
     *
     * @param aPlatedHole is true if the new contour will represent a plated hole
     *
     * @return int: index to the list or -1 if the operation failed
     * @return int: index to the list or -1 if the operation failed
     */
     */
    int NewContour( void );
    int NewContour( bool aPlatedHole = false );


    /**
    /**
     * Function AddVertex
     * Function AddVertex
@@ -231,7 +243,8 @@ public:
     *
     *
     * @return bool: true if the new contour was successfully created
     * @return bool: true if the new contour was successfully created
     */
     */
    bool AppendCircle( double aXpos, double aYpos, double aRadius, int aContourID, bool aHoleFlag = false );
    bool AppendCircle( double aXpos, double aYpos, double aRadius,
                       int aContourID, bool aHoleFlag = false );


    /**
    /**
     * Function AddCircle
     * Function AddCircle
@@ -241,10 +254,12 @@ public:
     * @param aYpos is the Y coordinate of the hole center
     * @param aYpos is the Y coordinate of the hole center
     * @param aRadius is the radius of the hole
     * @param aRadius is the radius of the hole
     * @param aHoleFlag determines if the contour to be created is a cutout
     * @param aHoleFlag determines if the contour to be created is a cutout
     * @param aPlatedHole is true if this is a plated hole
     *
     *
     * @return bool: true if the new contour was successfully created
     * @return bool: true if the new contour was successfully created
     */
     */
    bool AddCircle( double aXpos, double aYpos, double aRadius, bool aHoleFlag = false );
    bool AddCircle( double aXpos, double aYpos, double aRadius,
                    bool aHoleFlag = false, bool aPlatedHole = false );


    /**
    /**
     * Function AddSlot
     * Function AddSlot
@@ -256,11 +271,12 @@ public:
     * @param aSlotWidth is the width of the slot along the minor axis
     * @param aSlotWidth is the width of the slot along the minor axis
     * @param aAngle (degrees) is the orientation of the slot
     * @param aAngle (degrees) is the orientation of the slot
     * @param aHoleFlag determines whether the slot is a hole or a solid
     * @param aHoleFlag determines whether the slot is a hole or a solid
     * @param aPlatedHole is true if this is a plated slot
     *
     *
     * @return bool: true if the slot was successfully created
     * @return bool: true if the slot was successfully created
     */
     */
    bool AddSlot( double aCenterX, double aCenterY, double aSlotLength, double aSlotWidth,
    bool AddSlot( double aCenterX, double aCenterY, double aSlotLength, double aSlotWidth,
            double aAngle, bool aHoleFlag = false );
                  double aAngle, bool aHoleFlag = false, bool aPlatedHole = false );


    /**
    /**
     * Function AppendArc
     * Function AppendArc
@@ -289,11 +305,14 @@ public:
     * @param aArcWidth is the width of the arc
     * @param aArcWidth is the width of the arc
     * @param aAngle is the included angle (degrees)
     * @param aAngle is the included angle (degrees)
     * @param aHoleFlag determines whether the arc is to be a hole or a solid
     * @param aHoleFlag determines whether the arc is to be a hole or a solid
     * @param aPlatedHole is true if this is a plated slotted arc
     *
     *
     * @return bool: true if the feature was successfully created
     * @return bool: true if the feature was successfully created
     */
     */
    bool AddArc( double aCenterX, double aCenterY, double aStartX, double aStartY,
    bool AddArc( double aCenterX, double aCenterY,
            double aArcWidth, double aAngle, bool aHoleFlag = false );
                 double aStartX, double aStartY,
                 double aArcWidth, double aAngle,
                 bool aHoleFlag = false, bool aPlatedHole = false );


    /**
    /**
     * Function Tesselate
     * Function Tesselate
@@ -302,10 +321,11 @@ public:
     *
     *
     * @param holes  is an optional pointer to cutouts to be imposed on the
     * @param holes  is an optional pointer to cutouts to be imposed on the
     *               surface.
     *               surface.
     * @param aHolesOnly is true if the outline contains only holes
     *
     *
     * @return bool: true if the operation succeeded
     * @return bool: true if the operation succeeded
     */
     */
    bool Tesselate( VRML_LAYER* holes = NULL );
    bool Tesselate( VRML_LAYER* holes = NULL, bool aHolesOnly = false );


    /**
    /**
     * Function WriteVertices
     * Function WriteVertices
@@ -351,19 +371,26 @@ public:
     * writes out the vertex sets required to render an extruded solid
     * writes out the vertex sets required to render an extruded solid
     *
     *
     * @param aOutFile is the file to write to
     * @param aOutFile is the file to write to
     * @param aIncludePlatedHoles is true if holes marked as plated should
     *        be rendered. Default is false since the user will usually
     *        render these holes in a different color
     *
     *
     * @return bool: true if the operation succeeded
     * @return bool: true if the operation succeeded
     */
     */
    bool Write3DIndices( std::ofstream& aOutFile );
    bool Write3DIndices( std::ofstream& aOutFile, bool aIncludePlatedHoles = false );


    /**
    /**
     * Function AddExtraVertex
     * Function AddExtraVertex
     * adds an extra vertex as required by the GLU tesselator
     * adds an extra vertex as required by the GLU tesselator.
     *
     * @param aXpos is the X coordinate of the newly created point
     * @param aYpos is the Y coordinate of the newly created point
     * @param aPlatedHole is true if this point is part of a plated hole
     *
     *
     * @return VERTEX_3D*: is the new vertex or NULL if a vertex
     * @return VERTEX_3D*: is the new vertex or NULL if a vertex
     * could not be created.
     * could not be created.
     */
     */
    VERTEX_3D* AddExtraVertex( double aXpos, double aYpos );
    VERTEX_3D* AddExtraVertex( double aXpos, double aYpos, bool aPlatedHole );


    /**
    /**
     * Function glStart
     * Function glStart
@@ -429,6 +456,8 @@ public:
     * Returns the error message related to the last failed operation
     * Returns the error message related to the last failed operation
     */
     */
    const std::string& GetError( void );
    const std::string& GetError( void );

    void SetVertexOffsets( double aXoffset, double aYoffset );
};
};


#endif    // VRML_LAYER_H
#endif    // VRML_LAYER_H