EIF_add_extrusion


Add an extrusion in the Eagle data base

Synopsis


EIF_add_extrusion    (item, normal,numpnt, points,styles,extdir, extlen, frag,                                            solid, extype,hatch,reflex,extstyles,fill,malformed,id);

Input Parameters


int  item,numpnt,*styles,frag,solid, extype,hatch,reflex,         *extstyles,*fill,malformed;
double *normal,*points,*extdir,extlen;

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).

 

 

normal

The normal to the plane.

 

 

numpnt

The number of points of the face.

 

 

points

Array of the list of points of the extrusion. It expects points to point to an array of the correct length that has been allocated with EIF_liballoc.

 

 

styles
 

Array of line styles of the control face of the extrusion. It expects styles to point to an array of the correct length that has been allocated with EIF_liballoc  Every value is a combination of the pen, the dash and the thickness. You need to split these values to have the pen, the dash and the thickness with the routine EIF_splitpen

extdir

Direction of the extrusion.
 

extlen

The length of the extrusion.

 

frag

 

The layer of the item.

solid

The solid flag. If it is FALSE the extrusion is hollow.
 

reflex

Reflex flag. If TRUE the extrusion is concave.
 

exstyle

Array of line styles of the control face of the extrusion. It expects exstyles to point to an array of the correct length that has been allocated with EIF_liballoc.  Every value is a combination of the pen, the dash and the thickness. You need to split these values to have the pen, the dash and the thickness with the routine EIF_splitpen.

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 extrusion. Before using this routine, you should read the information from an ASCII file with the functions


EIF_card_ascii EIF_getextrusion_ascii

and you should allocate the array points , styles and esxtyles 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,num,item,*fstyles,estyles,pen,dash,thick,                                                reflex,hollow,hatch,hhe; double *fpnts,normal[3];


item = EIF_item_type(pointer);   if ((num=EIF_card_ascii(fp,&frag)) >0) {   if (pnts=(double *)EIF_liballoc(DOUBLE,num,3)==NULL) {                              printf("\nError allocating memory\n");   return(-1); } if (fstyles=(int *)EIF_liballoc(INT,num,1)==NULL)  {            printf("\nError allocating memory\n"); return(-1); } if (estyles=(int *)EIF_liballoc(INT,num,1)==NULL) {             printf("\nError allocating memory\n"); return(-1);           }           if(EIF_getextrusion_ascii(fp,normal,num,fpnts,                                                         fstyles,&hatch,&solid,                                                         &reflex,&extru,edir,                                                         estyles,&eleng)) {           fill[0] = fill[1] = 0;               EIF_add_extrusion(normal,num,fpnts,fstyles,edir,                                                         eleng,frag,solid,extru,hatch,                                                         reflex,extyles,fill,&id);            } }


. . .


EIF_libfree((char *)fstyles); EIF_libfree((char *)estyles); EIF_libfree((char *)pnts); }

Related Routines

EIF_liballoc , EIF_libfree, EIF_card_extrusion, EIF_get_extrusion, EIF_item_type