API Reference > OdDb Classes > OdDb3dSolid Class > OdDb3dSolid Methods > OdDb3dSolid::createPyramid Method
OdDb3dSolid::createPyramid Method
Syntax
C++
virtual OdResult createPyramid(double height, int sides, double radius, double topRadius = 0.0);
Parameters 
Description 
double height 
[in] Value of the pyramid's height.  
int sides 
[in] Quantity of sides for the pyramid.  
double radius 
[in] Radius for circle inscribed into the bottom polygon.  
double topRadius = 0.0 
[in] Radius for circle inscribed into the top polygon.
 

Returns eOk if successful or an appropriate error code in other case.

Creates a pyramid. World origin is centered about the base of the pyramid and the pyramid is positioned at half of the specified height above the world origin. 

 

The pyramid's base is located in the X-Y plane of the WCS. The pyramid's direction (from the base to the top) coincides with the positive direction of the Z axis. When radius and topRadius values are equal, a prism is created. 

The following constraints are applied:

  • |height| >= 1e-6;
  • |radius| >= 1e-6;
  • |topRadius| >= 1e-6;
  • 3 <= sides <= 64.
Copyright © 2002–2020. Open Design Alliance. All rights reserved.