Cylinder

References
[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 152)] [Serializable] public struct Cylinder : IEpsilonComparable<Cylinder>
Represents the values of a plane, a radius and two heights -on top and beneath- that define a right circular cylinder.

Constructors

Cylinder

#ExampleSince v5.0
public Cylinder(Circle baseCircle, double height)
Constructs a new cylinder with a finite height.
baseCircle (Circle)Base circle for cylinder.
height (double)Height of cylinder (zero for infinite cylinder).

Cylinder

#Since v5.0
public Cylinder(Circle baseCircle)
Constructs a new cylinder with infinite height.
baseCircle (Circle)Base circle for infinite cylinder.

Properties

Axis

#Since v5.0
public Vector3d Axis { get; }
Gets the axis direction of the cylinder.

BasePlane

#Since v6.0
public Plane BasePlane { get; set; }
Gets or sets the base plane of the cylinder.

Center

#Since v5.0
public Point3d Center { get; }
Gets the center point of the defining circle.

Height1

#Since v5.0
public double Height1 { get; set; }
Gets or sets the start height of the cylinder. The center of bottom cap is: BasePlane.Origin + Height1 * BasePlane.ZAxis.

Height2

#Since v5.0
public double Height2 { get; set; }
Gets or sets the end height of the cylinder. If the end height equals the start height, the cylinder is presumed to be infinite. The center of top cap is: BasePlane.Origin + Height2 * BasePlane.ZAxis.

IsFinite

#Since v5.0
public bool IsFinite { get; }
true if the cylinder is finite (Height0 != Height1) false if the cylinder is infinite.

IsValid

#Since v5.0
public bool IsValid { get; }
Gets a boolean value indicating whether this cylinder is valid.

A valid cylinder is represented by a valid circle and two valid heights.

Radius

#Since v6.0
public double Radius { get; set; }
Gets or sets the radius of the cylinder.

TotalHeight

#Since v5.0
public double TotalHeight { get; }
Gets the height of the cylinder. Infinite cylinders have a height of zero, not Double.PositiveInfinity.

Unset

#Since v5.0
public static Cylinder Unset { get; }
Gets an invalid Cylinder.

Methods

CircleAt

#Since v5.0
[ConstOperation] public Circle CircleAt(double linearParameter)
Compute the circle at the given elevation parameter.
linearParameter (double)Height parameter for circle section.

EpsilonEquals

#Since v5.4
[ConstOperation] public bool EpsilonEquals(Cylinder other, double epsilon)
Check that all values in other are within epsilon of the values in this
other (Cylinder)
epsilon (double)
EpsilonEquals

LineAt

#Since v5.0
[ConstOperation] public Line LineAt(double angularParameter)
Compute the line at the given angle parameter. This line will be degenerate if the cylinder is infinite.
angularParameter (double)Angle parameter for line section.

ToBrep

#ExampleSince v5.0
[ConstOperation] public Brep ToBrep(bool capBottom, bool capTop)
Constructs a Brep representation of this Cylinder. This is synonymous with calling NurbsSurface.CreateFromCylinder().
capBottom (bool)If true, the bottom of the cylinder will be capped.
capTop (bool)If true, the top of the cylinder will be capped.
A Brep representation of the cylinder or null.

ToNurbsSurface

#Since v5.0
[ConstOperation] public NurbsSurface ToNurbsSurface()
Constructs a Nurbs surface representation of this cylinder. This is synonymous with calling NurbsSurface.CreateFromCylinder().
A Nurbs surface representation of the cylinder or null.

ToRevSurface

#Since v5.0
[ConstOperation] public RevSurface ToRevSurface()
Constructs a RevSurface representation of this Cylinder. This is synonymous with calling RevSurface.CreateFromCylinder().
A RevSurface representation of the cylinder or null.

Transform

#Since v8.15
public bool Transform(Transform xform)
Transforms this cylinder. Note that non-similarity preserving transformations cannot be applied to a cylinder.
xform (Transform)Transformation matrix to apply.
true on success, false on failure.