Class CurveUtils2
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
public static class CurveUtils2
Methods
CentroidVtx(IEnumerable<Vector2d>)
Declaration
public static Vector2d CentroidVtx(IEnumerable<Vector2d> vertices)
Parameters
Returns
Convert(Polygon2d)
Declaration
public static IParametricCurve2d Convert(Polygon2d poly)
Parameters
Returns
Filter<T>(List<T>, Func<T, Boolean>)
return list of objects for which keepF(obj) returns true
Declaration
public static List<T> Filter<T>(List<T> objects, Func<T, bool> keepF)
Parameters
Returns
Type Parameters
FilterDegenerate(List<GeneralPolygon2d>, Double)
Remove polygons and polygon-holes smaller than minArea
Declaration
public static List<GeneralPolygon2d> FilterDegenerate(List<GeneralPolygon2d> polygons, double minArea)
Parameters
Returns
FindNearestVertex(Vector2d, IEnumerable<Vector2d>)
Declaration
public static int FindNearestVertex(Vector2d pt, IEnumerable<Vector2d> vertices)
Parameters
Returns
Flatten(IParametricCurve2d)
Declaration
public static List<IParametricCurve2d> Flatten(IParametricCurve2d curve)
Parameters
Returns
Flatten(List<IParametricCurve2d>)
Declaration
public static List<IParametricCurve2d> Flatten(List<IParametricCurve2d> curves)
Parameters
Returns
GetMaxOriginDistances(IEnumerable<Vector2d>)
Declaration
public static Vector2d GetMaxOriginDistances(IEnumerable<Vector2d> vertices)
Parameters
Returns
LaplacianSmooth(IList<Vector2d>, Double, Int32, Boolean, Boolean)
Declaration
public static void LaplacianSmooth(IList<Vector2d> vertices, double alpha, int iterations, bool is_loop, bool in_place = false)
Parameters
LaplacianSmoothConstrained(GeneralPolygon2d, Double, Int32, Double, Boolean, Boolean)
Declaration
public static void LaplacianSmoothConstrained(GeneralPolygon2d solid, double alpha, int iterations, double max_dist, bool bAllowShrink, bool bAllowGrow)
Parameters
LaplacianSmoothConstrained(Polygon2d, Double, Int32, Double, Boolean, Boolean, Boolean)
Constrained laplacian smoothing of input polygon, alpha X iterations.
vertices are only allowed to move at most max_dist from constraint
if bAllowShrink == false, vertices are kept outside input polygon
if bAllowGrow == false, vertices are kept inside input polygon
max_dist is measured from vertex[i] to original_vertex[i], unless
you set bPerVertexDistances = false, then distance to original polygon
is used (which is much more expensive)
[TODO] this is pretty hacky...could be better in lots of ways...
Declaration
public static void LaplacianSmoothConstrained(Polygon2d poly, double alpha, int iterations, double max_dist, bool bAllowShrink, bool bAllowGrow, bool bPerVertexDistances = true)
Parameters
LeafCurvesIteration(IParametricCurve2d)
if the children of C are a tree, iterate through all the leaves
Declaration
public static IEnumerable<IParametricCurve2d> LeafCurvesIteration(IParametricCurve2d c)
Parameters
Returns
SampledDistance(IParametricCurve2d, Vector2d, Int32)
Declaration
public static double SampledDistance(IParametricCurve2d c, Vector2d point, int N = 100)
Parameters
Returns
Split<T>(List<T>, out List<T>, out List<T>, Func<T, Boolean>)
Split the input list into two new lists, based on predicate (set1 == true)
Declaration
public static void Split<T>(List<T> objects, out List<T> set1, out List<T> set2, Func<T, bool> splitF)
Parameters
Type Parameters
SplitToTargetLength(Polygon2d, Double)
Declaration
public static Polygon2d SplitToTargetLength(Polygon2d poly, double length)
Parameters
Returns