mirror of
https://github.com/Theaninova/Bampy.git
synced 2026-01-22 01:42:43 +00:00
feat: test stuff
This commit is contained in:
39
bampy/src/result.rs
Normal file
39
bampy/src/result.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tsify::Tsify;
|
||||
|
||||
#[derive(Tsify, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[tsify(from_wasm_abi)]
|
||||
pub struct SliceOptions {
|
||||
#[tsify(type = "Float32Array")]
|
||||
pub positions: Vec<f32>,
|
||||
pub layer_height: f64,
|
||||
pub nozzle_diameter: f64,
|
||||
pub max_angle: f64,
|
||||
pub min_surface_path_length: f64,
|
||||
}
|
||||
|
||||
#[derive(Tsify, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase", tag = "type")]
|
||||
#[tsify(into_wasm_abi)]
|
||||
pub enum Slice {
|
||||
Surface {
|
||||
#[tsify(type = "Float32Array")]
|
||||
position: Vec<f32>,
|
||||
},
|
||||
Ring {
|
||||
#[tsify(type = "Float32Array")]
|
||||
position: Vec<f32>,
|
||||
},
|
||||
Path {
|
||||
#[tsify(type = "Float32Array")]
|
||||
position: Vec<f32>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Tsify, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[tsify(into_wasm_abi)]
|
||||
pub struct SliceResult {
|
||||
pub slices: Vec<Slice>,
|
||||
}
|
||||
Reference in New Issue
Block a user