Class PairZrUtil
Utility class for working with PairZr objects
public static class PairZrUtil
- Inheritance
-
PairZrUtil
- Inherited Members
Methods
GetIntensiveZrs(IEnumerable<PairZr>, double)
public static IEnumerable<PairZr> GetIntensiveZrs(this IEnumerable<PairZr> src, double ZResolution)
Parameters
src
IEnumerable<PairZr>ZResolution
double
Returns
GetNormal2d(SortedList<double, PairZr>, double)
Gets a 2D normal vector to the surface at the specified Z position
public static Vec2d GetNormal2d(this SortedList<double, PairZr> zVsPairZr, double z)
Parameters
zVsPairZr
SortedList<double, PairZr>The sorted list of PairZr objects defining the surface
z
doubleThe Z position to get the normal vector for
Returns
- Vec2d
A 2D normal vector to the surface, or null if it cannot be calculated
GetNormal2dByFittedZ(SortedList<double, PairZr>, double, out double)
Gets a 2D normal vector to the surface at the specified Z position, adjusted to fit within the Z range
public static Vec2d GetNormal2dByFittedZ(this SortedList<double, PairZr> zVsPairZr, double z, out double fittedZ)
Parameters
zVsPairZr
SortedList<double, PairZr>The sorted list of PairZr objects defining the surface
z
doubleThe Z position to get the normal vector for
fittedZ
doubleOutput parameter that receives the adjusted Z value that fits within the range
Returns
- Vec2d
A 2D normal vector to the surface, or null if it cannot be calculated
GetRByZ(List<PairZr>, double)
Gets the R value at a specified Z position by interpolating between PairZr objects in a list
public static double GetRByZ(this List<PairZr> zVsPairZr, double z)
Parameters
Returns
- double
The interpolated R value at the specified Z position, or NaN if interpolation is not possible
GetRByZ(SortedList<double, PairZr>, double)
Gets the R value at a specified Z position by interpolating between PairZr objects in a sorted list
public static double GetRByZ(this SortedList<double, PairZr> zVsPairZr, double z)
Parameters
zVsPairZr
SortedList<double, PairZr>The sorted list of PairZr objects keyed by Z values
z
doubleThe Z position to get the R value for
Returns
- double
The interpolated R value at the specified Z position, or NaN if interpolation is not possible
GetSurfaceVerticalArrow2d(List<PairZr>, double)
Gets a 2D vector perpendicular to the surface at the specified Z position
public static Vec2d GetSurfaceVerticalArrow2d(this List<PairZr> zVsPairZr, double z)
Parameters
zVsPairZr
List<PairZr>The list of PairZr objects defining the surface
z
doubleThe Z position to get the vector for
Returns
- Vec2d
A 2D vector perpendicular to the surface, or null if it cannot be calculated
GetSurfaceVerticalArrow2dByFittedZ(List<PairZr>, double, out double)
Gets a 2D vector perpendicular to the surface at the specified Z position, adjusted to fit within the Z range
public static Vec2d GetSurfaceVerticalArrow2dByFittedZ(this List<PairZr> zVsPairZr, double z, out double fittedZ)
Parameters
zVsPairZr
List<PairZr>The list of PairZr objects defining the surface
z
doubleThe Z position to get the vector for
fittedZ
doubleOutput parameter that receives the adjusted Z value that fits within the range
Returns
- Vec2d
A 2D vector perpendicular to the surface, or null if it cannot be calculated
GetSurfaceVerticalArrow3dByFittedZ(List<PairZr>, double, double, out double)
Gets a 3D vector perpendicular to the surface at the specified Z position, adjusted to fit within the Z range
public static Vec3d GetSurfaceVerticalArrow3dByFittedZ(this List<PairZr> zVsPairZr, double z, double angle_rad, out double fittedZ)
Parameters
zVsPairZr
List<PairZr>The list of PairZr objects defining the surface
z
doubleThe Z position to get the vector for
angle_rad
doubleThe angle in radians to position the vector around the Z axis
fittedZ
doubleOutput parameter that receives the adjusted Z value that fits within the range
Returns
- Vec3d
A 3D vector perpendicular to the surface, or null if it cannot be calculated
GetVolume(IGetZrList)
Calculates the volume of an object that implements IGetZrList
public static double GetVolume(this IGetZrList src)
Parameters
src
IGetZrListThe object that implements IGetZrList
Returns
- double
The calculated volume, or 0 if the source is null
GetVolume(IEnumerable<PairZr>)
Get Volume. Assume the src
.Z is ascendent.
If Z descendent, the result may be negative.
public static double GetVolume(this IEnumerable<PairZr> src)
Parameters
src
IEnumerable<PairZr>
Returns
GetZrList(IGetStl)
Extracts a list of PairZr objects from an object that implements IGetStl
public static List<PairZr> GetZrList(this IGetStl geom)
Parameters
geom
IGetStlThe object that implements IGetStl
Returns
GetZrList(IEnumerable<Tri3d>)
Extracts a list of PairZr objects from a collection of triangles
public static List<PairZr> GetZrList(this IEnumerable<Tri3d> tris)
Parameters
tris
IEnumerable<Tri3d>The collection of triangles