Example #1
0
        public void TryJoinToMidPoint()
        {
            part.AddSection(Vector3.Zero, Vector3.UnitX);
            part.AddSection(Vector3.UnitX, Vector3.UnitY);

            SlicePart other = new SlicePart();

            other.AddSection(Vector3.UnitX, Vector3.UnitX * 3);

            Assert.IsFalse(part.Join(other));
        }
Example #2
0
        public void TryJoinWithClosed()
        {
            part.AddSection(Vector3.Zero, Vector3.UnitX);
            part.AddSection(Vector3.UnitX, Vector3.UnitY);
            part.AddSection(Vector3.UnitY, Vector3.Zero);

            SlicePart other = new SlicePart();

            other.AddSection(Vector3.Zero, Vector3.UnitX * 2);

            Assert.IsFalse(part.Join(other));
        }
Example #3
0
        public void JoinToStartNotClose()
        {
            part.AddSection(Vector3.Zero, Vector3.UnitX);
            part.AddSection(Vector3.UnitX, Vector3.UnitY);

            SlicePart other = new SlicePart();

            other.AddSection(Vector3.UnitY * 2, Vector3.Zero);

            Assert.IsTrue(part.Join(other));

            Assert.AreEqual(4, part.Points.Count);
            Assert.AreEqual(Vector3.UnitY * 2, part.Points[0]);
            Assert.AreEqual(Vector3.Zero, part.Points[1]);
            Assert.AreEqual(Vector3.UnitX, part.Points[2]);
            Assert.AreEqual(Vector3.UnitY, part.Points[3]);
            Assert.IsFalse(part.Closed);
        }
Example #4
0
        public void JoinAndClose()
        {
            part.AddSection(Vector3.Zero, Vector3.UnitX, Vector3.UnitY);
            part.AddSection(Vector3.UnitX, Vector3.UnitY, Vector3.UnitZ);

            SlicePart other = new SlicePart();

            other.AddSection(Vector3.UnitY, Vector3.Zero, Vector3.One);

            Assert.IsTrue(part.Join(other));

            Assert.AreEqual(3, part.Points.Count);
            Assert.AreEqual(Vector3.Zero, part.Points[0]);
            Assert.AreEqual(Vector3.UnitX, part.Points[1]);
            Assert.AreEqual(Vector3.UnitY, part.Points[2]);
            Assert.AreEqual(3, part.Normals.Count);
            Assert.AreEqual(Vector3.UnitY, part.Normals[0]);
            Assert.AreEqual(Vector3.UnitZ, part.Normals[1]);
            Assert.AreEqual(Vector3.One, part.Normals[2]);
            Assert.IsTrue(part.Closed);
        }
Example #5
0
 public void AddFirstSection()
 {
     Assert.IsTrue(part.AddSection(Vector3.Zero, Vector3.UnitX, Vector3.UnitY));
     Assert.AreEqual(2, part.Points.Count);
     Assert.AreEqual(2, part.Normals.Count);
     Assert.AreEqual(Vector3.Zero, part.Points[0]);
     Assert.AreEqual(Vector3.UnitX, part.Points[1]);
     Assert.AreEqual(Vector3.UnitY, part.Normals[0]);
     Assert.AreEqual(Vector3.UnitY, part.Normals[1]);
     Assert.IsFalse(part.Closed);
 }