Skip to content

Commit

Permalink
Add serde serialization to fj::shade_3d.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Priestley authored and hannobraun committed May 20, 2022
1 parent 9f93a00 commit 3e4a107
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/fj/src/shape_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::{Shape, Shape2d};

/// A 3-dimensional shape
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
#[repr(C)]
pub enum Shape3d {
/// A group of two 3-dimensional shapes
Expand Down Expand Up @@ -29,6 +30,7 @@ impl From<Shape3d> for Shape {
///
/// Whether the shapes in the group touch or overlap is not currently checked.
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
#[repr(C)]
pub struct Group {
/// The first of the shapes
Expand Down Expand Up @@ -60,6 +62,7 @@ impl From<Group> for Shape3d {
/// See issue:
/// <https://github.com/hannobraun/Fornjot/issues/101>
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
#[repr(C)]
pub struct Transform {
/// The shape being transformed
Expand Down Expand Up @@ -89,6 +92,7 @@ impl From<Transform> for Shape3d {

/// A sweep of a 2-dimensional shape along straight path
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
#[repr(C)]
pub struct Sweep {
/// The 2-dimensional shape being swept
Expand Down

0 comments on commit 3e4a107

Please sign in to comment.