anchor.diff:                      if unvisited.Remove i then
                           cnt <- cnt + 1
                           let t = triangles.[i]
  -                        if not (Fun.IsTiny t.Area) then
  -//                            let testSet =
  -//                                if front then frontFacing
  -//                                else backFacing
  -    //
  -    //                        let t01 = edgeTriangles.[3*i+0] |> Set.filter (fun n -> testSet.Contains n)
  -    //                        let t12 = edgeTriangles.[3*i+1] |> Set.filter (fun n -> testSet.Contains n)
  -    //                        let t20 = edgeTriangles.[3*i+2] |> Set.filter (fun n -> testSet.Contains n)
  -                        
  -                            let t0 = pointTriangles.[3*i+0] |> Set.remove i
  -                            let t1 = pointTriangles.[3*i+1] |> Set.remove i
  -                            let t2 = pointTriangles.[3*i+2] |> Set.remove i
  -
  -                            let valid (ei : int) (oi : int) =
  -                                let o = triangles.[oi]
  -                                let p0t = ei
  -                                let p1t = (ei + 1) % 3
  -                                let p2t = (ei + 2) % 3
  +
  +                        let t0 = pointTriangles.[3*i+0] |> Set.remove i
  +                        let t1 = pointTriangles.[3*i+1] |> Set.remove i
  +                        let t2 = pointTriangles.[3*i+2] |> Set.remove i
  +
  +                        let valid (ei : int) (oi : int) =
  +                            let o = triangles.[oi]
  +                            let p0t = ei
  +                            let p1t = (ei + 1) % 3
  +                            let p2t = (ei + 2) % 3
   
                                   
   
   
   
  -                                let valid, p0o, p1o, p2o =
  -                                    let s0 = Set.contains i pointTriangles.[3 * oi + 0]
  -                                    let s1 = Set.contains i pointTriangles.[3 * oi + 1]
  -                                    let s2 = Set.contains i pointTriangles.[3 * oi + 2]
  -
  -                                    match s0, s1, s2 with
  -                                        | true, true, false -> true,0, 1, 2
  -                                        | true, false, true -> true,0, 2, 1
  -                                        | false, true, true -> true,1, 2, 0
  -                                        | _ -> 
  -                                            Log.warn "broken"
  -                                            false, 0, 0, 0
  +                            let valid, p0o, p1o, p2o =
  +                                let s0 = Set.contains i pointTriangles.[3 * oi + 0]
  +                                let s1 = Set.contains i pointTriangles.[3 * oi + 1]
  +                                let s2 = Set.contains i pointTriangles.[3 * oi + 2]
  +
  +                                match s0, s1, s2 with
  +                                    | true, true, false -> true, 0, 1, 2
  +                                    | true, false, true -> true, 0, 2, 1
  +                                    | false, true, true -> true, 1, 2, 0
  +                                    | _ -> 
  +                                        Log.warn "broken"
  +                                        false, 0, 0, 0
   
   
                                   
  -                                if not valid then 
  +                            if not valid then 
  +                                false
  +                            else
  +                                let line = Vec.normalize (t.[p1t] - t.[p0t])
  +                                let n = Vec.cross (t.[p0t] - viewPos) line |> Vec.normalize
  +                                let plane = Plane3d(n, t.[p0t])
  +
  +                                let ht = plane.Height t.[p2t]
  +                                let ho = plane.Height o.[p2o]
  +
  +                                if ht * ho > 0.0 then
                                       false
                                   else
  -                                    let line = Vec.normalize (t.[p1t] - t.[p0t])
  -                                    let n = Vec.cross (t.[p0t] - viewPos) line |> Vec.normalize
  -                                    let plane = Plane3d(n, t.[p0t])
  -
  -                                    let ht = plane.Height t.[p2t]
  -                                    let ho = plane.Height o.[p2o]
  -
  -                                    if ht * ho > 0.0 then
  -                                        false
  -                                    else
  -                                        true
  +                                    true
   
   //
   //                                    let ne = Vec.normalize (t.[p1t] - t.[p0t])
  
positive.code:         let rec addContained (info : OctNodeInfo) (cell : GridCell) (values : array<V3d * 'a>) (n : byref<OctNode<'a>>) =
              match n with
                  | Empty ->
                      n <- Leaf (cell.Center, List values)
  
                  | Leaf content ->
                      if content.Count + values.Length <= info.pointsPerLeaf || cell.ChildVolume < info.minLeafVolume then
  
negative.code: //                                        rotO * rotT < 0.0
                              
  
                          let t01 = Set.intersect t0 t1 
                          let t12 = Set.intersect t1 t2 
                          let t20 = Set.intersect t2 t0 
  
                          let front = frontFacing.Contains i
  
                          if Set.count t01 > 1 then
                              if front then add t.Line10 |> ignore
                              else add t.Line01
                          else
                              match t01 |> Set.filter (fun n -> valid 0 n) |> Set.toList with
                                  | [l] ->  enqueue l
                                  | _ ->
                                      if front then add t.Line10 |> ignore
                                      else add t.Line01 |> ignore
  
   
           
  
                          if Set.count t12 > 1 then
                              if front then add t.Line21 |> ignore
                              else add t.Line12
                          else
                              match t12 |> Set.filter (fun n -> valid 1 n) |> Set.toList with
                                  | [l] ->  enqueue l
                                  | l ->
                                      if front then add t.Line21 |> ignore
                                      else add t.Line12 |> ignore
                          
                          if Set.count t20 > 1 then
                              if front then add t.Line02 |> ignore
                              else add t.Line20
                          else
                              match t20 |> Set.filter (fun n -> valid 2 n) |> Set.toList with
                                  | [l] ->  enqueue l
                                  | l ->
                                      if front then add t.Line02 |> ignore
                                      else add t.Line20 |> ignore
                                                         
      
                          if front then addCap t.Reversed |> ignore
                          else addCap t |> ignore
  
  
                  parts.Add (part |> Seq.toArray, lines |> Seq.toArray)
  