Search Results for

    Show / Hide Table of Contents

    Class CurveUtils2

    Inheritance
    Object
    CurveUtils2
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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
    Type Name Description
    IEnumerable<Vector2d> vertices
    Returns
    Type Description
    Vector2d

    Convert(Polygon2d)

    Declaration
    public static IParametricCurve2d Convert(Polygon2d poly)
    Parameters
    Type Name Description
    Polygon2d poly
    Returns
    Type Description
    IParametricCurve2d

    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
    Type Name Description
    List<T> objects
    Func<T, Boolean> keepF
    Returns
    Type Description
    List<T>
    Type Parameters
    Name Description
    T

    FilterDegenerate(List<GeneralPolygon2d>, Double)

    Remove polygons and polygon-holes smaller than minArea

    Declaration
    public static List<GeneralPolygon2d> FilterDegenerate(List<GeneralPolygon2d> polygons, double minArea)
    Parameters
    Type Name Description
    List<GeneralPolygon2d> polygons
    Double minArea
    Returns
    Type Description
    List<GeneralPolygon2d>

    FindNearestVertex(Vector2d, IEnumerable<Vector2d>)

    Declaration
    public static int FindNearestVertex(Vector2d pt, IEnumerable<Vector2d> vertices)
    Parameters
    Type Name Description
    Vector2d pt
    IEnumerable<Vector2d> vertices
    Returns
    Type Description
    Int32

    Flatten(IParametricCurve2d)

    Declaration
    public static List<IParametricCurve2d> Flatten(IParametricCurve2d curve)
    Parameters
    Type Name Description
    IParametricCurve2d curve
    Returns
    Type Description
    List<IParametricCurve2d>

    Flatten(List<IParametricCurve2d>)

    Declaration
    public static List<IParametricCurve2d> Flatten(List<IParametricCurve2d> curves)
    Parameters
    Type Name Description
    List<IParametricCurve2d> curves
    Returns
    Type Description
    List<IParametricCurve2d>

    GetMaxOriginDistances(IEnumerable<Vector2d>)

    Declaration
    public static Vector2d GetMaxOriginDistances(IEnumerable<Vector2d> vertices)
    Parameters
    Type Name Description
    IEnumerable<Vector2d> vertices
    Returns
    Type Description
    Vector2d

    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
    Type Name Description
    IList<Vector2d> vertices
    Double alpha
    Int32 iterations
    Boolean is_loop
    Boolean in_place

    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
    Type Name Description
    GeneralPolygon2d solid
    Double alpha
    Int32 iterations
    Double max_dist
    Boolean bAllowShrink
    Boolean bAllowGrow

    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
    Type Name Description
    Polygon2d poly
    Double alpha
    Int32 iterations
    Double max_dist
    Boolean bAllowShrink
    Boolean bAllowGrow
    Boolean bPerVertexDistances

    LeafCurvesIteration(IParametricCurve2d)

    if the children of C are a tree, iterate through all the leaves

    Declaration
    public static IEnumerable<IParametricCurve2d> LeafCurvesIteration(IParametricCurve2d c)
    Parameters
    Type Name Description
    IParametricCurve2d c
    Returns
    Type Description
    IEnumerable<IParametricCurve2d>

    SampledDistance(IParametricCurve2d, Vector2d, Int32)

    Declaration
    public static double SampledDistance(IParametricCurve2d c, Vector2d point, int N = 100)
    Parameters
    Type Name Description
    IParametricCurve2d c
    Vector2d point
    Int32 N
    Returns
    Type Description
    Double

    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 Name Description
    List<T> objects
    List<T> set1
    List<T> set2
    Func<T, Boolean> splitF
    Type Parameters
    Name Description
    T

    SplitToTargetLength(Polygon2d, Double)

    Declaration
    public static Polygon2d SplitToTargetLength(Polygon2d poly, double length)
    Parameters
    Type Name Description
    Polygon2d poly
    Double length
    Returns
    Type Description
    Polygon2d
    In This Article
    Back to top ViRGIS VR GIS