geop_core_topology/
body.rs1use std::fmt;
2
3use super::ids::{ShellId, SolidId};
4
5#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
12pub enum Body {
13 Solid(SolidId),
14 Sheet(ShellId),
15}
16
17impl fmt::Display for Body {
18 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19 match self {
20 Body::Solid(id) => write!(f, "{id}"),
21 Body::Sheet(id) => write!(f, "sheet {id}"),
22 }
23 }
24}
25
26impl From<SolidId> for Body {
27 fn from(id: SolidId) -> Self {
28 Body::Solid(id)
29 }
30}