Table of Contents

Class AptDerivative

Namespace
Hi.Milling.Apts
Assembly
HiCbtr.dll

Apt derivative.

public class AptDerivative : IExpandToBox3d, IGetZrContour, IGenStl
Inheritance
AptDerivative
Implements
Inherited Members
Extension Methods

Constructors

AptDerivative(GeneralApt)

Ctor.

public AptDerivative(GeneralApt apt)

Parameters

apt GeneralApt

apt

Remarks

The APT agrees with itself within SelfAgreementTolerance_mm(double) (or this throws), and the profile is snapped to the exact points the other parameters fix; the authored D and Rz are read by no geometry here. A sharp corner (Rc = 0) is one point on both lines: Mr = Nr = Rr, Mz = Nz = Rr tan(Alpha), so with Alpha 0 the bottom-cone zone of GetRadius(double) is empty. A round corner is placed where the round touches the bottom line, SnappedRz_mm = Rr tan(Alpha) + Rc/cos(Alpha), and M and N are its tangent points with the bottom line and the flank, M = (Rz* - Rc cos(Alpha), Rr + Rc sin(Alpha)), N = (Rz* - Rc sin(Beta), Rr + Rc cos(Beta)); the round arc, the flank and GetRadius(double) read SnappedRz_mm, so an APT that agreed within the tolerance is built as if it agreed exactly. The native apt_derivative_t in hi-key, which builds the stick convex the step-by-step subtraction removes, applies the same rule value for value — the snap and the refusals — so the stick convex and this profile are one shape; HiMech.Tests/TestData/AptCorpus/apt-corpus.csv pins both over the project corpus.

Exceptions

ArgumentOutOfRangeException

apt refuses its geometry (RefusesGeometry): the message is its SelfAgreementNote.

Properties

Apt

Gets the general APT.

public GeneralApt Apt { get; }

Property Value

GeneralApt

CosAlpha

Gets the cosine of Alpha angle.

public double CosAlpha { get; }

Property Value

double

CosBeta

Gets the cosine of Beta angle.

public double CosBeta { get; }

Property Value

double

DefaultPolarResolution2d

Gets or sets the default polar resolution for 2D operations.

public static IPolarResolution2d DefaultPolarResolution2d { get; set; }

Property Value

IPolarResolution2d

Mr

Gets the radial coordinate of point M.

public double Mr { get; }

Property Value

double

Mz

Gets the Z-coordinate of point M.

public double Mz { get; }

Property Value

double

Nr

Gets the radial coordinate of point N.

public double Nr { get; }

Property Value

double

Nz

Gets the Z-coordinate of point N.

public double Nz { get; }

Property Value

double

SinAlpha

Gets the sine of Alpha angle.

public double SinAlpha { get; }

Property Value

double

SinBeta

Gets the sine of Beta angle.

public double SinBeta { get; }

Property Value

double

SnappedRz_mm

The height of the round centre (with no round: of the corner) the geometry reads: where the round touches the bottom line, Rr tan(Alpha) + Rc/cos(Alpha). Within SelfAgreementTolerance_mm(double) of the authored Rz_mm, which is not read again; the round arc of the profile and the sphere zone of GetRadius(double) are drawn about this value.

public double SnappedRz_mm { get; }

Property Value

double

TanAlpha

Gets the tangent of Alpha angle.

public double TanAlpha { get; }

Property Value

double

TanBeta

Gets the tangent of Beta angle.

public double TanBeta { get; }

Property Value

double

Methods

ExpandToBox3d(ref box3d_t)

Expands the destination box. This function is usually used to compute the bounding box of elements. box3d_t is a value type, so the destination is passed by reference (the C++ expand_to_box3d(box3&) shape); an implementation writes dst = dst.Expanded(...) or forwards ref dst to its parts.

public void ExpandToBox3d(ref box3d_t dst)

Parameters

dst box3d_t

Destination box, expanded in place

GenStl(IPolarResolution2d)

Generates an STL representation of the tool geometry.

public Stl GenStl(IPolarResolution2d resolution)

Parameters

resolution IPolarResolution2d

The polar resolution to use for generation.

Returns

Stl

The generated STL object.

GetNormal(double, double)

Get Normal Vector by height and angle.

public vec3d_t GetNormal(double z, double rad)

Parameters

z double

height

rad double

x-axis is begin; z-axis is principle

Returns

vec3d_t

GetRadius(double)

Get Radius by z.

public double GetRadius(double z)

Parameters

z double

z

Returns

double

radius at z

GetZrContour(double)

Gets Z-R contour data as a list of PairZr objects. The Z values should generally be ordered from smallest to largest.

public IList<PairZr> GetZrContour(double latitudeAngleResolution_rad)

Parameters

latitudeAngleResolution_rad double

Resolution of latitude angle in radians

Returns

IList<PairZr>

Z-R contour data as a list of PairZr objects