Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Mar 8, 2022
1 parent f48b882 commit 6753689
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/kernel/shapes/difference_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ use crate::{
debug::DebugInfo,
kernel::{
shape::Shape,
topology::{edges::Cycle, faces::Face},
topology::{
edges::{Cycle, Edge},
faces::Face,
},
},
math::{Aabb, Scalar},
};
Expand Down Expand Up @@ -45,7 +48,14 @@ impl ToShape for fj::Difference2d {
for cycle in cycles {
let mut edges = Vec::new();
for edge in &cycle.edges {
let edge = shape.edges().add(edge.get().clone());
let curve = shape.curves().add(*edge.curve.get());

let vertices = edge.vertices.clone().map(|vertices| {
// TASK: We're adding duplicate vertices here.
vertices.map(|vertex| shape.vertices().add(*vertex.get()))
});

let edge = shape.edges().add(Edge { curve, vertices });
edges.push(edge);
}

Expand Down

0 comments on commit 6753689

Please sign in to comment.