Beispiel #1
0
        private Int16Triple GetIntersetedPointAtEdge(OctreeNode <NodeParms> node, int edgeIndex, Int16Triple normal, int d)
        {
            int      x = 0, y = 0, z = 0;
            BoxRange range = node.GetRange();

            switch (edgeIndex)
            {
            case 0: { x = range.XMin; y = range.YMax + 1; return(new Int16Triple(x, y, (d - normal.X * x - normal.Y * y) / normal.Z)); }

            case 2: { x = range.XMin; y = range.YMin; return(new Int16Triple(x, y, (d - normal.X * x - normal.Y * y) / normal.Z)); }

            case 4: { x = range.XMax + 1; y = range.YMax + 1; return(new Int16Triple(x, y, (d - normal.X * x - normal.Y * y) / normal.Z)); }

            case 6: { x = range.XMax + 1; y = range.YMin; return(new Int16Triple(x, y, (d - normal.X * x - normal.Y * y) / normal.Z)); }

            case 8: { y = range.YMax + 1; z = range.ZMax + 1; return(new Int16Triple((d - normal.Y * y - normal.Z * z) / normal.X, y, z)); }

            case 9: { y = range.YMax + 1; z = range.ZMin; return(new Int16Triple((d - normal.Y * y - normal.Z * z) / normal.X, y, z)); }

            case 10: { y = range.YMin; z = range.ZMin; return(new Int16Triple((d - normal.Y * y - normal.Z * z) / normal.X, y, z)); }

            case 11: { y = range.YMin; z = range.ZMax + 1; return(new Int16Triple((d - normal.Y * y - normal.Z * z) / normal.X, y, z)); }

            case 1: { x = range.XMin; z = range.ZMin; return(new Int16Triple(x, (d - normal.X * x - normal.Z * z) / normal.Y, z)); }

            case 3: { x = range.XMin; z = range.ZMax + 1; return(new Int16Triple(x, (d - normal.X * x - normal.Z * z) / normal.Y, z)); }

            case 5: { x = range.XMax + 1; z = range.ZMin; return(new Int16Triple(x, (d - normal.X * x - normal.Z * z) / normal.Y, z)); }

            case 7: { x = range.XMax + 1; z = range.ZMax + 1; return(new Int16Triple(x, (d - normal.X * x - normal.Z * z) / normal.Y, z)); }

            default: throw new Exception();
            }
        }
Beispiel #2
0
        private bool IsSingleCell(OctreeNode <NodeParms> node)
        {
            BoxRange loc = node.GetRange();

            return(loc.GetIsSinglePoint());
        }