mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-07 19:38:29 +00:00
Add ReverseCurveCoordinateSystems::Reversed
This is preparation for some other changes to make the trait more flexible.
This commit is contained in:
parent
53db1db8e9
commit
9db2e6a389
@ -34,7 +34,12 @@ impl Reverse for Cycle {
|
||||
}
|
||||
|
||||
impl ReverseCurveCoordinateSystems for Cycle {
|
||||
fn reverse_curve_coordinate_systems(&self, core: &mut Core) -> Self {
|
||||
type Reversed = Cycle;
|
||||
|
||||
fn reverse_curve_coordinate_systems(
|
||||
&self,
|
||||
core: &mut Core,
|
||||
) -> Self::Reversed {
|
||||
let edges = self
|
||||
.half_edges()
|
||||
.iter()
|
||||
|
@ -43,7 +43,12 @@ impl<const D: usize> Reverse for Polygon<D, IsInsertedYes> {
|
||||
}
|
||||
|
||||
impl ReverseCurveCoordinateSystems for Face {
|
||||
fn reverse_curve_coordinate_systems(&self, core: &mut Core) -> Self {
|
||||
type Reversed = Face;
|
||||
|
||||
fn reverse_curve_coordinate_systems(
|
||||
&self,
|
||||
core: &mut Core,
|
||||
) -> Self::Reversed {
|
||||
let region = self
|
||||
.region()
|
||||
.reverse_curve_coordinate_systems(core)
|
||||
|
@ -8,7 +8,12 @@ use crate::{
|
||||
use super::ReverseCurveCoordinateSystems;
|
||||
|
||||
impl ReverseCurveCoordinateSystems for Handle<HalfEdge> {
|
||||
fn reverse_curve_coordinate_systems(&self, core: &mut Core) -> Self {
|
||||
type Reversed = Handle<HalfEdge>;
|
||||
|
||||
fn reverse_curve_coordinate_systems(
|
||||
&self,
|
||||
core: &mut Core,
|
||||
) -> Self::Reversed {
|
||||
let mut half_edge_geom = *core.layers.geometry.of_half_edge(self);
|
||||
half_edge_geom.path = half_edge_geom.path.reverse();
|
||||
half_edge_geom.boundary = half_edge_geom.boundary.reverse();
|
||||
|
@ -16,9 +16,15 @@ pub trait Reverse {
|
||||
|
||||
/// Reverse the direction of the curve coordinate systems within an object
|
||||
pub trait ReverseCurveCoordinateSystems {
|
||||
/// The type of the reversed object
|
||||
type Reversed;
|
||||
|
||||
/// Reverse the direction of the curve coordinate systems within an object
|
||||
///
|
||||
/// This will not have any effect on object positions in global coordinates.
|
||||
#[must_use]
|
||||
fn reverse_curve_coordinate_systems(&self, core: &mut Core) -> Self;
|
||||
fn reverse_curve_coordinate_systems(
|
||||
&self,
|
||||
core: &mut Core,
|
||||
) -> Self::Reversed;
|
||||
}
|
||||
|
@ -22,7 +22,12 @@ impl Reverse for Region {
|
||||
}
|
||||
|
||||
impl ReverseCurveCoordinateSystems for Region {
|
||||
fn reverse_curve_coordinate_systems(&self, core: &mut Core) -> Self {
|
||||
type Reversed = Region;
|
||||
|
||||
fn reverse_curve_coordinate_systems(
|
||||
&self,
|
||||
core: &mut Core,
|
||||
) -> Self::Reversed {
|
||||
let exterior = self
|
||||
.exterior()
|
||||
.reverse_curve_coordinate_systems(core)
|
||||
|
Loading…
Reference in New Issue
Block a user