Sign in

    zhaoyuanjuns/moonbit_extractor/geometry does not have a README file

    Barycentric

    pub(all) struct Barycentric {
    first : Double
    second : Double
    third : Double
    inside : Bool
    } derive(Eq, ToJson,
    Debug
    )

    BoundingBox

    pub(all) struct BoundingBox {
    minimum_x : Double
    maximum_x : Double
    minimum_y : Double
    maximum_y : Double
    } derive(Eq, ToJson,
    Debug
    )

    BoundingBox::area

    fn BoundingBox::area(self : BoundingBox) -> Double

    BoundingBox::contains

    fn BoundingBox::contains(self : BoundingBox, point : Point) -> Bool

    BoundingBox::height

    fn BoundingBox::height(self : BoundingBox) -> Double

    BoundingBox::width

    fn BoundingBox::width(self : BoundingBox) -> Double

    LineIntersection

    pub(all) struct LineIntersection {
    intersects : Bool
    point : Point
    first_fraction : Double
    second_fraction : Double
    } derive(Eq, ToJson,
    Debug
    )

    MeshStatistics

    pub(all) struct MeshStatistics {
    vertices : Int
    triangles : Int
    area : Double
    minimum_area : Double
    maximum_area : Double
    boundary_length : Double
    } derive(Eq, ToJson,
    Debug
    )

    NearestBoundaryPoint

    pub(all) struct NearestBoundaryPoint {
    point : Point
    distance : Double
    segment : Int
    } derive(Eq, ToJson,
    Debug
    )

    Point

    pub(all) struct Point {
    x : Double
    y : Double
    } derive(Eq, ToJson,
    Debug
    )

    Polygon helpers used by ternary phase-envelope exporters.

    Point::distance

    fn Point::distance(self : Point, other : Point) -> Double

    Triangle

    pub(all) struct Triangle {
    first : Point
    second : Point
    third : Point
    area : Double
    } derive(Eq, ToJson,
    Debug
    )

    Polygon triangulation, barycentric coordinates, and interpolation helpers.

    Triangle::centroid

    fn Triangle::centroid(self : Triangle) -> Point

    Triangle::contains

    fn Triangle::contains(self : Triangle, point : Point, tolerance : Double) -> Bool

    Triangle::perimeter

    fn Triangle::perimeter(self : Triangle) -> Double

    barycentric_coordinates

    fn barycentric_coordinates(triangle : Triangle, point : Point, tolerance : Double) -> Barycentric

    clip_polygon_half_plane

    fn clip_polygon_half_plane(polygon : ArrayView[Point], line_start : Point, line_end : Point, keep_left? : Bool) -> Array[Point] raise
    ExtractionError

    contains

    fn contains(polygon : ArrayView[Point], point : Point) -> Bool

    interpolate_triangle

    fn interpolate_triangle(triangle : Triangle, first_value : Double, second_value : Double, third_value : Double, point : Point, tolerance : Double) -> Double raise
    ExtractionError

    is_convex

    fn is_convex(points : ArrayView[Point]) -> Bool

    line_intersection

    fn line_intersection(first_start : Point, first_end : Point, second_start : Point, second_end : Point, tolerance? : Double) -> LineIntersection raise
    ExtractionError

    locate_triangle

    fn locate_triangle(triangles : ArrayView[Triangle], point : Point, tolerance : Double) -> Int

    mesh_area_error

    mesh_maximum_aspect_ratio

    fn mesh_maximum_aspect_ratio(triangles : ArrayView[Triangle]) -> Double

    mesh_quality_label

    fn mesh_quality_label(triangles : ArrayView[Triangle]) -> String

    mesh_statistics

    fn mesh_statistics(polygon : ArrayView[Point], triangles : ArrayView[Triangle]) -> MeshStatistics

    nearest_boundary_point

    point_in_polygon

    fn point_in_polygon(point : Point, polygon : ArrayView[Point]) -> Bool

    polygon_compact

    fn polygon_compact(points : ArrayView[Point], tolerance~ : Double) -> Array[Point] raise
    ExtractionError

    polygon_grid

    fn polygon_grid(bounds : BoundingBox, columns : Int, rows : Int) -> Array[Point] raise
    ExtractionError

    polygon_overlap_ratio

    fn polygon_overlap_ratio(polygon : ArrayView[Point], box : BoundingBox) -> Double raise
    ExtractionError

    polygon_perimeter

    rotate_point

    fn rotate_point(point : Point, angle_sine~ : Double, angle_cosine~ : Double, origin? : Point) -> Point raise
    ExtractionError

    rotate_polygon

    fn rotate_polygon(points : ArrayView[Point], angle_sine~ : Double, angle_cosine~ : Double, origin? : Point) -> Array[Point] raise
    ExtractionError

    scale_polygon

    fn scale_polygon(points : ArrayView[Point], scale_x~ : Double, scale_y~ : Double, origin? : Point) -> Array[Point] raise
    ExtractionError

    signed_turns

    fn signed_turns(points : ArrayView[Point]) -> Array[Double]

    translate_polygon

    fn translate_polygon(points : ArrayView[Point], delta_x~ : Double, delta_y~ : Double) -> Array[Point] raise
    ExtractionError

    triangle_area

    fn triangle_area(first : Point, second : Point, third : Point) -> Double

    triangle_aspect_ratio

    fn triangle_aspect_ratio(triangle : Triangle) -> Double

    triangle_csv

    fn triangle_csv(triangles : ArrayView[Triangle]) -> String

    triangle_mesh_area

    fn triangle_mesh_area(triangles : ArrayView[Triangle]) -> Double

    triangulated_interpolation

    fn triangulated_interpolation(triangles : ArrayView[Triangle], values : ArrayView[(Double, Double, Double)], point : Point, tolerance : Double) -> Double raise
    ExtractionError