1 个不稳定版本
0.0.1 | 2024 年 2 月 3 日 |
---|
#114 在 #2d-3d
2MB
296 代码行
CLI 中可见的示例
cargo run --example simple_2d_triangulation
如何通过指定点数来可视化
cargo run --example 2d_plot 100
或在您的项目中使用此库
创建 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 } }]