[IoId("00000000-941c-408f-ab18-f79a802293da")] public readonly struct Tube : IEquatable<Tube>, IComparable<Tube>
A conical shape with an optional wall thickness. Tubes can represent cylinders, cones, trucated-cones, all with and without wall thicknesses.

Constructors

Tube

#
public Tube(Plane plane, double height, double radius1, double radius2, double wall = Infinity)
Create a new tube.
plane (Plane)Base plane.
height (double)Height of tube.
radius1 (double)Radius at base plane.
radius2 (double)Radius at height.
wall (double = Infinity)Wall thickness.

Properties

Area

#
public double Area { get; }
Gets the area of this tube.

Axis

#
public Line Axis { get; }
Gets the axis of this tube.

BoundingBox

#
public BoundingBox BoundingBox { get; }
Gets the bounding box of this tube.

BoundingSphere

#
public Sphere BoundingSphere { get; }
Gets the bounding sphere of this tube.

EffectiveWall

#
public double EffectiveWall { get; }
Gets the effective wall thickness. This is the minimal wall thickness which would still yield the same tube shape.

Height

#
public double Height { get; }
Gets the height of the tube above the base plane.

Interior

#
public Tube Interior { get; }
Gets the interior or gap inside this tube. If this tube IsSolid, the interior is empty.

IsConical

#
public bool IsConical { get; }
Gets whether this tube is conical, i.e. whether one of the radii equals zero.

IsCylindrical

#
public bool IsCylindrical { get; }
Gets whether this tube is cylindrical, i.e. whether the outside walls are perpendicular to the base plane.

IsShell

#
public bool IsShell { get; }
Gets whether this tube is a shell. I.e. whether the wall thickness equals zero.

IsSolid

#
public bool IsSolid { get; }
Gets whether this tube is solid. I.e. whether the wall thickness exceeds both of the radii.

IsTapered

#
public bool IsTapered { get; }
Gets whether this tube is tapered. This is the opposite of IsCylindrical.

PerpendicularWall

#
public double PerpendicularWall { get; }
Gets the true thickness of the wall, as measured perpendicularly between the inner and outer surfaces.

Plane

#
public Plane Plane { get; }
Gets the base plane of the tube.

Profile

#
public Polyline Profile { get; }
Gets the profile of this tube at angle zero.

Radius1

#
public double Radius1 { get; }
Gets the radius of the tube coincident with the base plane.

Radius1Inner

#
public double Radius1Inner { get; }
Gets the radius of the inner circle at the base plane. If the Wall thickness exceeds the Radius1 value the inner radius will be zero.

Radius2

#
public double Radius2 { get; }
Gets the radius of the tube at the maximum height above the plane.

Radius2Inner

#
public double Radius2Inner { get; }
Gets the radius of the inner circle at the height. If the Wall thickness exceeds the Radius2 value the inner radius will be zero.

SlantHeight

#
public double SlantHeight { get; }
Gets the distance between the lower and upper circular edges.

Volume

#
public double Volume { get; }
Gets the volume of this tube.

Wall

#
public double Wall { get; }
Gets the thickness of the wall. If the thickness is zero, the tube shape is assumed to be just the outer surface. If the thickness equals double.PositiveInfinity the tube is assumed to be completely solid. Negative wall thicknesses are not valid.

Methods

AnnulusAt

#
public double AnnulusAt(double along, out double r1, out double r2, out double e1, out double e2)
Gets the normalised parameter along the annulus at the given along parameter.
along (double)Along parameter in the [-2, +3] range.

[-2, -1) = inner surface from below.

[-1, 0) = bottom cap.

[0, +1] = outer surface.

(+1, +2] = top cap.

(+2, +3] = inner surface from above.

r1 (out double)Radius of annulus at the first boundary.
r2 (out double)Radius of annulus at the second boundary.
e1 (out double)Elevation of annulus at first boundary.
e2 (out double)Elevation of annulus at the second boundary.
Normalised parameter in the [0, 1] range.

AsShell

#
public Tube AsShell()
Create a thin-shell tube without any wall thickness.

AsSolid

#
public Tube AsSolid()
Create a solid tube with infinite wall thickness.

ClosestParameters

#
public bool ClosestParameters(Point3d point, out double around, out double along)
Gets the (around, along) parameters of the projection of the point onto the tube.
point (Point3d)Point to project.
around (out double)The around parameter in the [0, 2Pi] range.
along (out double)The along parameter in the [-2, +3] range.
True if point could be projected.

CompareTo

#
public int CompareTo(Tube other)
other (Tube)

CurvatureAt

#
public SurfaceCurvature CurvatureAt(double around, double along)
Gets the curvature at the given parameters.
around (double)Around parameter in the [0, 2Pi] range.
along (double)Along parameter in the [-2, +3] range.

[-2, -1) = inner surface from below.

[-1, 0) = bottom cap.

[0, +1] = outer surface.

(+1, +2] = top cap.

(+2, +3] = tinner surface from above.

Edge

#
public Circle Edge(bool lower, bool outer)
Gets one of the four edges of this tube.
lower (bool)If true, one of the two lower will be returned.
outer (bool)If true, the outside edge will be returned.

Equals

#
public override bool Equals(object obj)
obj (object)
ValueType.Equals

Equals

#
public bool Equals(Tube other)
other (Tube)

FurthestParameters

#
public bool FurthestParameters(Point3d point, out double around, out double along)
Gets the (around, along) parameters of the point on the tube furthest away from a point.
point (Point3d)Point to measure from.
around (out double)The around parameter in the [0, 2Pi] range.
along (out double)The along parameter, which is always either 0 or 1.
True if the furthest point could be found.

GetHashCode

#
public override int GetHashCode()

ModifyHeight

#
public Tube ModifyHeight(double height)
Modify the height of this tube without affecting the slope.
height (double)New height.
Tube with new height.

NormalAt

#
public Vector3d NormalAt(double around, double along)
Gets the point at the given parameters.
around (double)Around parameter in the [0, 2Pi] range.
along (double)Along parameter in the [-2, +3] range.

[-2, -1) = inner surface from below.

[-1, 0) = bottom cap.

[0, +1] = outer surface.

(+1, +2] = top cap.

(+2, +3] = tinner surface from above.

Offset

#
public bool Offset(double amount, bool solid, out Tube? result)
Offset this tube.
amount (double)Offset amount. Positive values result in outwards offsets.
solid (bool)If this tube is a shell, a solid will be created.
result (out Tube?)Offset result in the form of another tube. If the return value is true, but the result is null, it means the tube was offset into oblivion.
True on success, false on failure.

Offset

#
public bool Offset(double amount, bool solid, SurfaceOffsetStyle style, out Brep result)
amount (double)
solid (bool)
style (SurfaceOffsetStyle)
result (out Brep)

PointAt

#
public Point3d PointAt(double around, double along)
Gets the point at the given parameters.
around (double)Around parameter in the [0, 2Pi] range.
along (double)Along parameter in the [-2, +3] range.

[-2, -1) = inner surface from below.

[-1, 0) = bottom cap.

[0, +1] = outer surface.

(+1, +2] = top cap.

(+2, +3] = tinner surface from above.

TangentAt

#
public Plane TangentAt(double around, double along)
Gets the tangent plane at the given parameters.
around (double)Around parameter in the [0, 2Pi] range.
along (double)Along parameter in the [-2, +3] range.

[-2, -1) = inner surface from below.

[-1, 0) = bottom cap.

[0, +1] = outer surface.

(+1, +2] = top cap.

(+2, +3] = tinner surface from above.

ToBrep

#
public Brep ToBrep()
Convert this tube to a brep.

ToCanonicalForm

#
public Tube ToCanonicalForm()
Return the canonical form of this tube. Basically, if the height is negative it reorders the properties to make the height positive.

ToMesh

#
public Mesh ToMesh(int around = 30, int along = 1, int cap = 1)
Convert this tube to a mesh.
around (int = 30)Facecount around the tube.
along (int = 1)Facecount along the tube sides.
cap (int = 1)Facecount along the tube caps.

ToString

#
public override string ToString()

ToString

#
public string ToString(NumberFormat formatting)
formatting (NumberFormat)

ToWireframe

#
public Curve[] ToWireframe(bool aroundWires, bool alongWires)
aroundWires (bool)
alongWires (bool)

WithHeight

#
public Tube WithHeight(double height)
Modify the height of this tube.
height (double)New height.
Tube with new height.

WithPlane

#
public Tube WithPlane(Plane plane)
Modify the plane of this tube.
plane (Plane)New plane.
Tube with new plane.

WithRadii

#
public Tube WithRadii(double radius1, double radius2)
Modify the radii of this tube.
radius1 (double)
radius2 (double)

WithWall

#
public Tube WithWall(double thickness)
Modify the wall thickness of this tube.
thickness (double)New wall thickness. If a negative thickness is supplied the radii will be adjusted to accomodate that.
Modified tube.