mirror of
https://github.com/hannobraun/Fornjot
synced 2025-08-25 11:36:38 +00:00
Update coordination system of bottom surface
Previously, it had the same coordinate system as the top one, meaning an automated triangulization of both would come up with faces that have the same normal. But obviously, the normals need to be inverse. This change updates the bottom surface, preparing for the automated triangulatization.
This commit is contained in:
parent
dc904e3bc1
commit
b1f718a705
@ -40,6 +40,7 @@ impl Plane {
|
||||
Point::from([u, v])
|
||||
}
|
||||
|
||||
#[allow(unused)] // fell out of use, but will need again soon
|
||||
pub fn translate(self, offset: impl Into<Vector<3>>) -> Self {
|
||||
Self {
|
||||
origin: self.origin + offset,
|
||||
|
@ -12,12 +12,18 @@ pub fn model(shape: &mut Shape) {
|
||||
|
||||
let bottom = surfaces.insert(Plane {
|
||||
origin: Point::from([0., 0., -0.5]),
|
||||
coords: Bivector {
|
||||
a: Vector::from([1., 0., 0.]),
|
||||
b: Vector::from([0., -1., 0.]),
|
||||
},
|
||||
});
|
||||
let top = surfaces.insert(Plane {
|
||||
origin: Point::from([0., 0., 0.5]),
|
||||
coords: Bivector {
|
||||
a: Vector::from([1., 0., 0.]),
|
||||
b: Vector::from([0., 1., 0.]),
|
||||
},
|
||||
});
|
||||
let top = surfaces.insert(bottom.translate([0., 0., 1.]));
|
||||
|
||||
let sketch =
|
||||
Sketch::from([[-0.5, -0.5], [0.5, -0.5], [0.5, 0.5], [-0.5, 0.5]]);
|
||||
@ -39,16 +45,16 @@ pub fn model(shape: &mut Shape) {
|
||||
|
||||
shape
|
||||
.extend_with(&mut triangles)
|
||||
.add([a, e, h]) // left
|
||||
.add([a, h, d])
|
||||
.add([b, c, g]) // right
|
||||
.add([b, g, f])
|
||||
.add([a, b, f]) // front
|
||||
.add([a, f, e])
|
||||
.add([d, g, c]) // back
|
||||
.add([d, h, g])
|
||||
.add([a, d, b]) // bottom
|
||||
.add([b, d, c])
|
||||
.add([d, e, h]) // left
|
||||
.add([d, h, a])
|
||||
.add([c, b, g]) // right
|
||||
.add([c, g, f])
|
||||
.add([d, c, f]) // front
|
||||
.add([d, f, e])
|
||||
.add([a, g, b]) // back
|
||||
.add([a, h, g])
|
||||
.add([d, a, c]) // bottom
|
||||
.add([c, a, b])
|
||||
.add([e, f, g]) // top
|
||||
.add([e, g, h]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user