#2d #implemented #3d #2d-3d #run #points

网格划分

适用于 2D 和 3D (尚未实现)

1 个不稳定版本

0.0.1 2024 年 2 月 3 日

#114#2d-3d

自定义许可

2MB
296 代码行

GitHub Workflow Status

CLI 中可见的示例

cargo run --example simple_2d_triangulation

如何通过指定点数来可视化

cargo run --example 2d_plot 100

100points 1000points 10000points 100000points

或在您的项目中使用此库

创建 sample-project

cargo new sample-project
cd sample-project

编辑 Cargo.toml

delaunay_creator = "0.2.4"

编辑 src/main.rs

fn main() {
    let square = vec![
        meshing::Point2D { x: 0.0, y: 0.0 },
        meshing::Point2D { x: 1.0, y: 0.0 },
        meshing::Point2D { x: 0.0, y: 1.0 },
        meshing::Point2D { x: 1.0, y: 1.0 },
    ];
    let res = meshing::bowyer_watson(square);
    println!("{:?}", res);
}

运行

cargo run
[Triangle { a: Point2D { x: 0.0, y: 0.0 }, b: Point2D { x: 1.0, y: 0.0 }, c: Point2D { x: 1.0, y: 1.0 } }, Triangle { a: Point2D { x: 0.0, y: 1.0 }, b: Point2D { x: 0.0, y: 0.0 }, c: Point2D { x: 1.0, y: 1.0 } }]

无运行时依赖