/* This file is part of the Neper software package. */
/* Copyright (C) 2003-2014, Romain Quey. */
/* See the COPYING file in the top-level directory. */

#include "net_tess3d_.h"

int
net_tess3d (struct TESS PTess, int poly,
            struct SEEDSET SeedSet, int TessId,
	    struct TESS *pTess, int verbosity)
{
  struct POLY DomPoly;
  struct POLY *Poly = NULL;
  struct TESL Tesl;

  neut_poly_set_zero (&DomPoly);
  net_tess_poly (PTess, poly, &DomPoly);

  neut_tesl_set_zero (&Tesl);

  net_polycomp (DomPoly, SeedSet, &Poly, verbosity);

  net_tesl (SeedSet, Poly, &Tesl);
  neut_tesl_tess (Tesl, PTess.Level + 1, TessId, pTess);

  neut_poly_array_free (&Poly, SeedSet.N);
  neut_tesl_free (&Tesl);
  neut_poly_free (&DomPoly);

  return 0;
}
