LibEagle Nurbs Extension LibOCC
A development API library has been created that extends the LibEagle functions to support NURBS entities.
The library extension adds the following functions:
a. The OCC_init function is implemented to initialises the library.
|
Sample |
|
|
|
void OCC_init( ) |
b. The OCC_libvers function implements display of information relating to the library version.
|
Sample |
|
|
|
void OCC_libvers ( ) |
c. The OCC_open_model function is implemented to extend the currently available EIF_open_model function allowing reading and creating of a new type model file according to the changed specification described in the Save section. There are no signature changes with respect to the currently available EIF function.
|
Sample |
|
|
|
void OCC_open_model(cname,length,read_write,firstit,error) char *cname; /* <i> Name of the file to be opened */ /* <o> Name of the file to be open with the extension */ int *length; /* <i> Lenght of the file name */ char *read_write; /* <i> Flag read/write */ Item *firstit; /* <o> Pointer to the first item */ int *error; /* <o> Error flag */ |
d. The OCC_importBREP function is implemented to facilitate loading in the Eagle model the BREP file format described in import section.
|
Sample |
|
|
|
void OCC_ImportBREP( fname, append, firstItem, error ) |
e. The OCC_importIGES function is implemented to facilitate loading in the Eagle model the IGES format described in the import section.
|
Sample |
|
|
|
void OCC_ImportIGES( fname, append, firstItem, error ) |
f. The OCC_addShape function is implemented to facilitate loading in the Eagle model an individual TopoDS_Shape entity.
|
Sample |
|
|
|
int OCC_addShape( ptr, frag, style, hatch, fill, id ) |
g. The OCC_getShape is implemented to retrieve a pointer to the TopoDS_Shape entity from the given OCC entity defined in the Eagle workspace.
|
Sample |
|
|
|
void OCC_getShape(item_ptr, ptr, pos ,rotmat, max, min, rotflag,
|
h. The OCC_addNurbsCurve is implemented to create a new Curve entity. This function returns a pointer to the created Curve entity. A NULL pointer indicates that the creation process returned an error.
|
Sample |
|
|
|
Item OCC_addNurbsCurve( degree,periodic numCpts, cPts, weights, int degree; /* <i> degree */ |
i. The OCC_addBezierCurve is implemented to create a new Curve entity. This function returns a pointer to the created Curve entity. A NULL pointer indicates that the creation process returned an error.
|
Sample |
|
|
|
Item OCC_addBezierCurve ( rational, numCpts, cPts, weights) |
j. The OCC_initProfile is implemented to initialise the creation of a new Profile entity. It is used in conjunction with the next OCC_addItemToProfile and OCC_terminateProfile.
|
Sample |
|
|
|
void OCC_initProfile( void ) |
k. The OCC_addItemToProfile is implemented is implemented to allow adding a new item to the current Profile entity. The new item should be any of the basic Eagle items, among Lines, Arcs, Circles, Curves and also another Profile entity. The new item must be geometrically compatible with the existing Profile, which means that its start point must be coincident according to a specified tolerance to the end point of the existing Profile. Also, the individual components of the Profile must be planar. This function returns TRUE on success or FALSE on failure.
|
Sample |
|
|
|
int OCC_addItemToProfile( itemPointer)
|
l. The OCC_terminateProfile is implemented to close the creation of a Profile entity. It is used in conjunction with previous OCC_initProfile and OCC_addItemToProfile. This function returns a pointer to the created Profile entity. A NULL pointer indicates that the creation process returned an error.
|
Sample |
|
|
|
Item OCC_terminateProfile( erase ) removed from the workspace */
|
m. The OCC_convert is implemented to converts one single entity from/to Eagle items to/from OCC-curves, according to the behaviour of the Convert command. This function returns TRUE on success or FALSE on failure.
|
Sample |
|
|
|
int OCC_convert( itemPointer) |
n. The OCC_extrusion is implemented to allow creating a Surface entity representing a extrusion of a curve between two points. This function returns a pointer to the created Shape entity. A NULL pointer indicates that the creation process returned an error.
|
Sample |
|
|
|
Item OCC_extrusion( pointer, p1 , p2 ) |
o. The OCC_revolution is implemented to allow creating a Surface entity representing the rotational sweep of a Curve around an axis by a given angle. This function returns a pointer to the created Shape entity. A NULL pointer indicates that the creation process returned an error.
|
Sample |
|
|
|
Item OCC_revolution( pointer, p1, p2 , angle) |
p. The OCC_sweep is implemented to allow creating a Surface entity representing the sweep of a Curve along a Spine. This function returns a pointer to the created Shape entity. A NULL pointer indicates that the creation process returned an error.
|
Sample |
|
|
|
Item OCC_sweep( curvePointer, spinePointer ) |
q. The OCC_pointInShape is implemented that allows checking if a point belongs to an entity. If the specified item is a Body then returned values can be:
1 if the point is inside the entity
0 if the point is on the entity
-1 if the point is outside the entity
If the specified item is a Curve or a Shell then returned values could be:
0 if the point is on the entity
-1 if the point is outside the entity
If the specified item is a Surface then returned values can be:
0 if the point is on the entity
1 if the point is in the same direction of the normal.
-1 if the point is in the opposite direction of the normal.
This function returns TRUE on success or FALSE on failure.
|
Sample |
|
|
|
int OCC_pointInShape( itemPointer, pt, result ) |
r. The OCC_CalcSurfaceNormal is implemented to allow calculating the normal of a Surface given a point on it. This function returns TRUE on success or FALSE on failure.
|
Sample |
|
|
|
int OCC_calcSurfaceNormal( itemPointer, pt, normal ) |
s. The OCC_revolveProfile is implemented to create a shell or a body by revolving a profile around an axis by a given angle. This function returns TRUE on success or FALSE on failure.
|
Sample |
|
|
|
Item OCC_ revolveProfile( itemPointer, p1, p2, angle, solid ) Item itemPointer; /* <i> Pointer to the Curve item */ double *p1; /* <i> First point defining the axis */ double *p2; /* <i> Second point defining the axis */ double angle; /* <i> Angle of revolution, in degrees */ int solid; /* <i> Flag to indicate if a solid or shell is to be created */ |
t. The OCC_sweepProfile is implemented to create a shell or a body by sweeping a Profile along a Spine. This function returns TRUE on success or FALSE on failure.
|
Sample |
|
|
|
Item OCC_ revolveProfile( itemPointer, p1, p2, angle, solid ) Item itemPointer; /* <i> Pointer to the Curve item */ double *p1; /* <i> First point defining the axis */ double *p2; /* <i> Second point defining the axis */ double angle; /* <i> Angle of revolution, in degrees */ int solid; /* <i> Flag to indicate if a solid or shell is to be created */ |
u. The OCC_extrudeProfile is implemented to create a shell or a body by sweeping a Profile along a Spine. This function returns TRUE on success or FALSE on failure.
|
Sample |
|
|
|
Item OCC_extrudeProfile( itemPointer, p1, p2, solid ) Item itemPointer; /* <i> Pointer to the profile item */ double *p1; /* <i> First point defining the extrusion vector */ double *p2; /* <i> Second point defining the extrusion vector */ int solid; /* <i> Flag to indicate if a solid or shell is to be created */ |
u. The OCC_skin is implemented to create a Shell entity representing the sweep of a Curve along a path. This function returns a pointer to the created Shape entity. A NULL pointer indicates that the creation process returned an error.
|
Sample |
|
|
|
Item OCC_skin( pStart,pEnd,pPath ) Item pStart; /* <i> Pointer to the first Curve item */ Item pEnd; /* <i> Pointer to the second Curve item */ Item pPath; /* <i> Pointer to a Curve item */ |