public void FindFacetsIntersectingZIndex_IgnoresFlatFacets_FindsEdgesAndPoints()
 {
     LoadSTL();
     // there are technically 6 facets at this z, but 2 of them are flat
     Assert.Equal(4, LinAlgUtils.FindFacetsIntersectingZIndex(_stl, 10).Count);
     // sould also find single points
     Assert.Equal(4, LinAlgUtils.FindFacetsIntersectingZIndex(_stl, 8).Count);
 }
예제 #2
0
        public Slice GetSliceAtZIndex(float z)
        {
            // cache this in the event you have to retrieve a single value more than once,
            // we don't want to have to do this math again
            if (!_slices.Keys.Contains(z))
            {
                var facets = LinAlgUtils.FindFacetsIntersectingZIndex(_stl, z);
                _slices[z] = new Slice
                {
                    Lines = facets.Select(f => LinAlgUtils.CreateLineFromFacetAtZIndex(f, z)).ToList()
                };
            }

            return(_slices[z]);
        }
 public void FindFacetsIntersectingZIndex_ReturnsAppropriateFacets()
 {
     LoadSTL();
     Assert.Equal(4, LinAlgUtils.FindFacetsIntersectingZIndex(_stl, 2).Count);
 }