Class Toolkit
- Namespace
- SearchAThing.Sci
- Assembly
- netcore-sci.dll
netcore-sci toolkit static methods
public static class Toolkit
- Inheritance
-
Toolkit
- Inherited Members
Fields
PostProcessCadScript
public static Func<string, string> PostProcessCadScript
Field Value
Properties
SciJsonSettings
public static JsonSerializerSettings SciJsonSettings { get; }
Property Value
- JsonSerializerSettings
Methods
Circle2D(double, double, Vector3D, Vector3D)
create circle 2D by given two points and radius
public static Vector3D[] Circle2D(double tol, double radius, Vector3D p1, Vector3D p2)
Parameters
tol
doublelength tolerance
radius
doublecircle radius
p1
Vector3Dcircle first point (z not considered)
p2
Vector3Dcircle second point (z not considered)
Returns
- Vector3D[]
circle centers
CirclesOuterTangent(double, double, double, double, double, double)
Finds tangent segments between two given circles.
returns empty, or 2 tuple (exterior tangents) or 4 tuple (two exterior tangents and two interior tangents)
ref: https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Tangents_between_two_circles
public static IEnumerable<(CircleTangentType type, Vector3D pa, Vector3D pb)> CirclesOuterTangent(double x1, double y1, double r1, double x2, double y2, double r2)
Parameters
Returns
Cube(Vector3D, double)
Creates dxf entities for a 6 faces of a cube; generated face order is front, back, left, right, bottom, top
public static IEnumerable<Face3D> Cube(Vector3D center, double L)
Parameters
Returns
- IEnumerable<Face3D>
Cuboid(Vector3D, Vector3D)
Creates dxf entities for 6 faces of a cuboid; generated face order is front, back, left, right, bottom, top
public static IEnumerable<Face3D> Cuboid(Vector3D center, Vector3D size)
Parameters
Returns
- IEnumerable<Face3D>
LinearSplineInterpolate(IEnumerable<double>, IEnumerable<double>)
(MathNet.Numerics bookmark function) "Create a linear spline interpolation from an unsorted set of (x,y) value pairs." then invoke Interpolate with x value to retrieve interpolated y value.
For more interpolator see https://numerics.mathdotnet.com/api/MathNet.Numerics.Interpolation/index.htm
public static IInterpolation LinearSplineInterpolate(IEnumerable<double> x, IEnumerable<double> y)
Parameters
x
IEnumerable<double>y
IEnumerable<double>
Returns
- IInterpolation
Remarks
Range(double, double, double, double, bool)
span a range of doubles from start to end ( optionally included ) stepping with given inc
public static IEnumerable<double> Range(double tol, double start, double end, double inc, bool includeEnd = false)
Parameters
tol
doublemeasure tolerance
start
doublestart pos
end
doubleend pos
inc
doubleincrement
includeEnd
boolif true end can included in result set
Returns
- IEnumerable<double>
enumeration of discrete range items
Segments(Face3D)
retrieve 3 or 4 segments from given face
public static IEnumerable<Line3D> Segments(this Face3D face)
Parameters
face
Face3D
Returns
Star(Vector3D, double)
Creates dxf entities for a 3 axis of given length centered in given center point.
public static IEnumerable<Line> Star(Vector3D center, double L)
Parameters
Returns
- IEnumerable<Line>
ToRegion(Face3D, double)
convert face3d to Plane3DRegion
public static Plane3DRegion ToRegion(this Face3D face, double tol)
Parameters
face
Face3Dtol
double
Returns
ToSciJson(object)
public static string ToSciJson(object o)
Parameters
o
object
Returns
Vertexes(Face3D)
retrieve 3 or 4 vertex from given face
public static IEnumerable<Vector3D> Vertexes(this Face3D face)
Parameters
face
Face3D
Returns
WalkEdges(double, Edge, Vector3D, Dictionary<Vector3D, List<Edge>>, WalkEdgeStopConditionDelegate?)
walk edges
public static IEnumerable<Edge> WalkEdges(double tol, Edge startEdge, Vector3D startVertex, Dictionary<Vector3D, List<Edge>> vertexToEdges, Toolkit.WalkEdgeStopConditionDelegate? stopCondition = null)
Parameters
tol
doublelength tolerance
startEdge
Edgestarting edge
startVertex
Vector3Dstarting vertex
vertexToEdges
Dictionary<Vector3D, List<Edge>>vertex to edges dictionary
stopCondition
Toolkit.WalkEdgeStopConditionDelegateby default stop when meet startvertex again
Returns
- IEnumerable<Edge>
walked edges