mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-27 09:35:52 +00:00
Rename fj::Union
to fj::Group
This commit is contained in:
parent
1aa0981a73
commit
c9f7ee495e
@ -11,7 +11,7 @@ pub enum Shape3d {
|
||||
Transform(Box<Transform>),
|
||||
|
||||
/// The union of two 3-dimensional shapes
|
||||
Union(Box<Union>),
|
||||
Union(Box<Group>),
|
||||
}
|
||||
|
||||
impl From<Shape3d> for Shape {
|
||||
@ -114,7 +114,7 @@ impl From<Sweep> for Shape3d {
|
||||
/// <https://github.com/hannobraun/Fornjot/issues/42>
|
||||
#[derive(Clone, Debug)]
|
||||
#[repr(C)]
|
||||
pub struct Union {
|
||||
pub struct Group {
|
||||
/// The first of the shapes
|
||||
pub a: Shape3d,
|
||||
|
||||
@ -122,14 +122,14 @@ pub struct Union {
|
||||
pub b: Shape3d,
|
||||
}
|
||||
|
||||
impl From<Union> for Shape {
|
||||
fn from(shape: Union) -> Self {
|
||||
impl From<Group> for Shape {
|
||||
fn from(shape: Group) -> Self {
|
||||
Self::Shape3d(Shape3d::Union(Box::new(shape)))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Union> for Shape3d {
|
||||
fn from(shape: Union) -> Self {
|
||||
impl From<Group> for Shape3d {
|
||||
fn from(shape: Group) -> Self {
|
||||
Self::Union(Box::new(shape))
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ where
|
||||
}
|
||||
|
||||
pub trait Union {
|
||||
fn union<Other>(&self, other: &Other) -> crate::Union
|
||||
fn union<Other>(&self, other: &Other) -> crate::Group
|
||||
where
|
||||
Other: Clone + Into<crate::Shape3d>;
|
||||
}
|
||||
@ -80,13 +80,13 @@ impl<T> Union for T
|
||||
where
|
||||
T: Clone + Into<crate::Shape3d>,
|
||||
{
|
||||
fn union<Other>(&self, other: &Other) -> crate::Union
|
||||
fn union<Other>(&self, other: &Other) -> crate::Group
|
||||
where
|
||||
Other: Clone + Into<crate::Shape3d>,
|
||||
{
|
||||
let a = self.clone().into();
|
||||
let b = other.clone().into();
|
||||
|
||||
crate::Union { a, b }
|
||||
crate::Group { a, b }
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ use crate::{
|
||||
|
||||
use super::ToShape;
|
||||
|
||||
impl ToShape for fj::Union {
|
||||
impl ToShape for fj::Group {
|
||||
fn to_shape(&self, tolerance: Scalar, debug_info: &mut DebugInfo) -> Shape {
|
||||
let mut shape = Shape::new();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user