Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/misc/brepsamples/cylinder.cpp
3196 views
1
// compilation: just include all occ-headers and link against all occ-libs
2
3
#include "occheaders.h"
4
5
int main()
6
{
7
// make a cylinder:
8
gp_Pnt orig(0, 0, 0);
9
gp_Dir normal(0, 0, 1);
10
gp_Ax2 axis(orig, normal);
11
Standard_Real radius = 0.2;
12
Standard_Real height = 1.0;
13
TopoDS_Shape cylinder = BRepPrimAPI_MakeCylinder(axis, radius, height);
14
15
// write in brep file:
16
BRepTools::Write(cylinder, "cylinder.brep");
17
18
return 0;
19
}
20
21