User's Guide > Core: 3D Geometry > Geometry Equations > Geometry of Solid Edges
Geometry of Solid Edges
 
Functions Introduced:
ProEdgeTypeGet()
ProEdgeDataGet()
ProEdgedataMemoryFree()
ProEdgedataFree()
Function ProEdgeTypeGet() provides the equation used to describe the edge. Function ProEdgeDataGet() returns the data structure associated with the specified edge.
Use function ProEdgedataMemoryFree() to free the top-level memory associated with the edge data structure. Function ProEdgedataFree() frees the underlying memory of the data structure.
Follow these steps to get the description of an edge:
1. Get the type of equation used to describe the edge using the function ProEdgeTypeGet(). The possible types for a solid edge are as follows:
PRO_ENT_LINE—A straight line
PRO_ENT_ARC—An arc
PRO_ENT_ELLIPSE—An ellipse
PRO_ENT_SPLINE—A nonuniform cubic spline
PRO_ENT_B_SPLINE—A nonuniform rational B-spline (NURBS)
2. Get the data structure for the geometry using the function ProEdgeDataGet(). For an edge, the type field is set to PRO_EDGE, and the relevant field from the union is p_curve_data. The type for that field, ProCurvedata, is itself a union that contains a field for each type of edge equation. For example, if the edge type is PRO_ENT_ARC, the relevant field in the ProCurvedata structure is the one called arc, of type ProArcdata. Each such structure contains fields for the coefficients and constants in the relevant equations (described in the Geometry Representations appendix section), and share the same names.
3. When you have read the information you need from the ProGeomitemdata structure, free the memory using ProGeomitemdataFree().
Example 2: Extracting the Diameter of an Arc Edge
The sample code in UgGeomArcDiaDisp.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_geometry shows how to extract the geometry equation of a solid edge.
這是否有幫助?