示例#1
0
        public static void AssertTabsGoodFinalLocation <K, T>(List <TabGeneration.Tab <K, T> > tabs,
                                                              PlanarUnfolder.PlanarUnfolding <K, T> unfoldingObject)
            where K : IUnfoldableEdge
            where T : IUnfoldablePlanarFace <K>
        {
            var oldgeo = new List <Geometry>();

            // assert that the final geometry  intersect with the
            //the orginal surfaces(transformed through their transformation histories)
            for (int i = 0; i < tabs.Count; i++)
            {
                var tab        = tabs[i];
                var initialSrf = unfoldingObject.StartingUnfoldableFaces[tab.ID].SurfaceEntities;

                var transformedInitialSurfaceToFinal = PlanarUnfolder.DirectlyMapGeometryToUnfoldingByID
                                                       <K, T, Surface>
                                                           (unfoldingObject, initialSrf, tab.ID);

                Assert.IsTrue(transformedInitialSurfaceToFinal.Select(x => tab.TabSurf.DoesIntersect(x)).Any());
                oldgeo.AddRange(transformedInitialSurfaceToFinal);
                Console.WriteLine("This tab was in the right spot at the end of the unfold, \n" +
                                  "it intersects with the correct face");
            }

            foreach (IDisposable item in oldgeo)
            {
                item.Dispose();
            }
        }
 public Tab(T face, K edge, PlanarUnfolder.PlanarUnfolding <K, T> unfoldObject, double tabOffset = .3)
 {
     ID             = face.ID;
     UnfoldableFace = face;
     TabSurf        = generateTabGeo(edge, tabOffset);
     AlignedTabSurf = PlanarUnfolder.DirectlyMapGeometryToUnfoldingByID(unfoldObject, TabSurf, ID);
 }
示例#3
0
        public static void AssertLabelsGoodFinalLocationAndOrientation <K, T>(List <PlanarUnfolder.UnfoldableFaceLabel
                                                                                    <K, T> > labels, List <List <Curve> >
                                                                              translatedgeo, PlanarUnfolder.PlanarUnfolding <K, T> unfoldingObject)
            where K : IUnfoldableEdge
            where T : IUnfoldablePlanarFace <K>
        {
            var oldgeo = new List <Geometry>();

            // assert that the final geometry  intersect with the
            //the orginal surfaces(transformed through their transformation histories)
            for (int i = 0; i < labels.Count; i++)
            {
                var label  = labels[i];
                var curves = translatedgeo[i];

                var transformedInitialSurfaceToFinal = PlanarUnfolder.DirectlyMapGeometryToUnfoldingByID
                                                       <K, T, Surface>
                                                           (unfoldingObject, label.UnfoldableFace.SurfaceEntities, label.ID);

                Assert.IsTrue(curves.SelectMany(x => transformedInitialSurfaceToFinal.Select(x.DoesIntersect)).Any());
                oldgeo.AddRange(transformedInitialSurfaceToFinal);
                Console.WriteLine("This label was in the right spot at the end of the unfold");
            }

            foreach (IDisposable item in oldgeo)
            {
                item.Dispose();
            }
            foreach (var list in translatedgeo)
            {
                foreach (IDisposable item in list)
                {
                    item.Dispose();
                }
            }
        }