SilverScreen Solid Modeler

surface_area_prim

surface_area_prim

Previous topic Next topic  

surface_area_prim

Previous topic Next topic JavaScript is required for the print function  

 

SilverScreenAPI

 

BOOLEAN surface_area_prim(OBJECT_NODE *obj, PRIM_NODE *prim, double *area)

 

OBJECT_NODE *obj;   // A pointer to an OBJECT_NODE

PRIM_NODE   *prim;  // A pointer to a PRIM_NODE

double      *area;  // A pointer to a double-precision floating-point value

 

 




Synopsis

#include "silver.h"

#include "ssnodes.h"

 

The surface_area_prim function calculates the surface area of a closed primitive.

 

 

Parameters

obj is a pointer to the object that contains the primitive whose area is to be measured

prim is a pointer to the closed primitive whose area is to be measured

area is a pointer to the double that is to receive the calculated area

 

 

Return Value

surface_area_prim returns TRUE if all 3 parameters are valid, and if prim is a pointer to a closed primitive. It returns FALSE otherwise.

 

 

See Also

surface_area

 

 

Example

The following code allows the user to pick a polygon, then measures the surface area and displays it in a message

 

C / C++ Code

 

 #include "silver.h"

 #include "ssnodes.h"

 

 

 void main(void)

    {

    char        prim_path[512];

    OBJECT_NODE *obj;

    PRIM_NODE   *prim;

    double      area;

 

 

    if ( ! pick_primitive("Select a polygon", BITS_POLYGON, prim_path) )

       exit(-1);

 

    prim = get_prim(prim_path, &obj);

 

    if ( prim && surface_area_prim(obj, prim, &area) )

       {

       error_message("The surface area of the polygon is %g", area);

       }

    }    

 

: