EIF_add_irreg


Add an irregular extrusion in the Eagle data base.

Synopsis


EIF_add_irreg        (item,frag,norm1,norm2, numpnt,points,styles, opp_pts,opp_sts,ext_styles,                                      reflex,solid,extype, hatch,fill,malformed,id);

Input Parameters


int  item,frag,numpnt,*styles, *opp_styles,ext_styles,reflex,         solid,*extype,hatch,*fill,malformed; double*norm1,*norm2,*points, *opp_pts;

Output Parameters


int*id;

Returns

An error flag.

Arguments

item

The type of item. It can be initialized with the function EIF_item_type (if reading a model file) or EIF_getitem_ascii (if reading an ASCII file)..

 

 

norm1

Normal to the plane of the control face.
 

norm2

Normal to the plane of the opposite face.
 

points

Memory block of the list of points in the control face. It expects points to point to an array of the correct length that has been allocated with EIF_liballoc
 

opp_pts

Memory block of the list of points in the opposite face. It expects opp_pts to point to an array of the correct length that has been allocated with EIF_liballoc

 

 

styles

Memory block of the line styles of the control face. It expects styles to point to an array of the correct length that has been allocated with. EIF_liballoc . Every value of this array is a combination of the pen, the dash and the thickness. It should be split with the routine EIF_splitpen to have the single pen, dash and thickness.

 

 

opp_styles

Memory block of the line styles of the control face. It expects opp_sts to point to an array of the correct length that has been allocated with. EIF_liballoc . Every value of this array is a combination of the pen, the dash and the thickness. It should be split with the routine EIF_splitpen to have the single pen, dash and thickness.

 

 

reflex
 

The reflex flag. If 1 the irregular extrusion is concave.
 

ext_styles

Memory block of the list of the extrusion line styles, only if the extrusion flag is 1. It expects ext_stys to point to an array of the correct length that has been allocated with EIF_liballoc . Every value of this array is a combination of the pen, the dash and the thickness. It should be split with the routine EIF_splitpen to have the single pen, dash and thickness.
 

solid

Flags if solid or hollow.

hatch

The cross-hatch pattern.
 

fill

The color fill + tile pattern.
 

extype

 

extrusion line-style type (const if < 0).

malformed

Malformed flag to mark Solids and Irregular Solids as “malformed” (twisted shell frames).
 

id

Item identifier : id = 0 means that an error occurred while adding the item to the Eagle data base.

Include Files


EIF_lib.h, EIF_std.h

Description

Put in the Eagle data base the information relative to an irregular extrusion. Before using this routine, you should read the information from an ASCII file with the functions


EIF_card_ascii EIF_getirreg_ascii

and you should allocate the array points, styles, opp_pts, opp_sts , and extr_sts with the function EIF_liballoc . It is then recommended to free the array with the function EIF_libfree

 

Malformed (Twisted Shell Frames)

To define a solid or an irregular solid as "malformed" just set the parameter malformed to TRUE or 1. LibEagle will use an internal value to mark these  solids and, when facetting them for OpenGL, Eagle will use the old triangulation

instead of the new GL based tesselation.

Example


#include <stdio.h> #include "EIF_lib.h" #include "EIF_std.h" FILE *fp; int frag,*styles1,*styles2,*estyles,pen,dash,thick,                                extrusion,reflex,hollow,hatch,hhe; double *fpnts1,*fpnts2, normal1[3] ,normal2[3];


item = EIF_item_type(pointer);          if ( ( num = EIF_card_ascii(fp, &frag)) > 0) {                        printf("\n Error allocating memory\n");          return(-1);          }          if (styles1 = (int *)EIF_liballoc(INT,num,1) == NULL) {                        printf("\n Error allocating memory\n");         return(-1);         }         if (styles2 = (int *)EIF_liballoc(INT,num,1) == NULL) {                         printf("\n Error allocating memory\n");         return(-1);         }         if (estyles = (int *)EIF_liballoc(INT,num,1) == NULL) {                         printf("\n Error allocating memory\n");         return(-1);         }         if (fpnts1=(double *)EIF_liballoc(DOUBLE,num,3) ==NULL) {                         printf("\n Error allocating memory\n");         return(-1);         }        if (fpnts2=(double *)EIF_liballoc(DOUBLE,num,3) ==NULL) {                         printf("\n Error allocating memory\n");        return(-1);        } if(EIF_getirreg_ascii(fp,norm1,norm2,num,fpnts1,styles1,                                                                fpnts2,styles2,&extype,&reflex,                                                                &solid,&hatch, estyles)) if(( EIF_add_irreg(item,frag,norm1,norm2,num,pnts1,                                                                styles1,pnts2,styles2,reflex,solid,                                                                extype,hatch,fill &id)) ...


EIF_libfree((char *)styles1); EIF_libfree((char *)styles2); EIF_libfree((char *)estyles); EIF_libfree((char *)fpnts1); EIF_libfree((char *)fpnts2);

Related Routines

EIF_liballoc , EIF_libfree, EIF_card_ascii, EIF_getirreg_ascii