dyna3/app-proto/sketch-outline/src/assembly.rs

25 lines
544 B
Rust
Raw Normal View History

2024-09-13 00:40:34 -07:00
use nalgebra::DVector;
use rustc_hash::FxHashSet;
2024-09-22 02:21:45 -07:00
use slab::Slab;
2024-09-13 00:40:34 -07:00
use sycamore::reactive::Signal;
#[derive(Clone, PartialEq)]
pub struct Element {
pub id: String,
pub label: String,
pub color: [f32; 3],
pub rep: DVector<f64>,
pub constraints: FxHashSet<usize>
}
pub struct Constraint {
pub args: (usize, usize),
pub rep: f64
2024-09-13 00:40:34 -07:00
}
// a complete, view-independent description of an assembly
#[derive(Clone)]
2024-09-13 00:40:34 -07:00
pub struct Assembly {
pub elements: Signal<Slab<Element>>,
pub constraints: Signal<Slab<Constraint>>
2024-09-13 00:40:34 -07:00
}