use of org.hwyl.sexytopo.model.graph.Coord3D in project sexytopo by richsmith.
the class Space3DTransformerTest method testTransform1MDown.
@Test
public void testTransform1MDown() {
Leg up1MLeg = new Leg(1, 0, -90);
Coord3D result = transformer.transform(Coord3D.ORIGIN, up1MLeg);
Coord3D expected = new Coord3D(0, 0, -1);
assertEquals(expected, result);
}
use of org.hwyl.sexytopo.model.graph.Coord3D in project sexytopo by richsmith.
the class Space3DTransformer method update.
private void update(Space<Coord3D> space, Leg leg, Coord3D start) {
Coord3D end = transform(start, leg);
Line<Coord3D> line = new Line<>(start, end);
space.addLeg(leg, line);
if (leg.hasDestination()) {
update(space, leg.getDestination(), end);
}
}
use of org.hwyl.sexytopo.model.graph.Coord3D in project sexytopo by richsmith.
the class Space3DTransformerTest method testTransform3N3E3S3W.
@Test
public void testTransform3N3E3S3W() {
Leg n3 = new Leg(3, 0, 0);
Coord3D result = transformer.transform(Coord3D.ORIGIN, n3);
Leg e3 = new Leg(3, 90, 0);
result = transformer.transform(result, e3);
Leg s3 = new Leg(3, 180, 0);
result = transformer.transform(result, s3);
Leg w3 = new Leg(3, 270, 0);
result = transformer.transform(result, w3);
assertEquals(Coord3D.ORIGIN, result);
}
use of org.hwyl.sexytopo.model.graph.Coord3D in project sexytopo by richsmith.
the class Space3DTransformerTest method testTransform1MEast.
@Test
public void testTransform1MEast() {
Leg east1MLeg = new Leg(1, 90, 0);
Coord3D result = transformer.transform(Coord3D.ORIGIN, east1MLeg);
Coord3D expected = new Coord3D(1, 0, 0);
assertEquals(expected, result);
}
use of org.hwyl.sexytopo.model.graph.Coord3D in project sexytopo by richsmith.
the class Space3DTransformerTest method testTransform2MNorth.
@Test
public void testTransform2MNorth() {
Leg north2MLeg = new Leg(2, 0, 0);
Coord3D result = transformer.transform(Coord3D.ORIGIN, north2MLeg);
Coord3D expected = new Coord3D(0, 2, 0);
assertEquals(expected, result);
}
Aggregations