Cylinder

Constructor

Cylinder(double radius, double height, unsigned int faces=100,
bool center=true)

  • radius: cylinder radius in mm.
  • height : height in mm.
  • faces: number of faces of the rendered cylinder

This constructor generates a cylinder with same base and top radius.

Cylinder(double radius1, double radius2, double height, 
unsigned int faces=100, bool center=true)

  • radius1 : radius of base in mm.
  • radius2 : radius of top in mm.
  • height : height in mm.
  • faces: number of faces of the rendered cylinder

This constructor generates a cylinder with different base and top radius (build a cone or a truncated cone).

Example of use

#include <components/Cylinder.h>
#include <core/IndentWriter.h>
 
Component myCylinder = Cylinder(20,50,100,true);
 
writer << myCylinder; //generates a 20x50 mm cylinder with 100 faces.

OpenSCAD generated code

cylinder(h=height,r1=radius1,r2=radius2,$fn=faces,center=true)

Source Files

Recent changes RSS feed Creative Commons License Donate Minima Template by Wikidesign Driven by DokuWiki