Exemplo n.º 1
0
Wpt_list 
SWEEP_DISK::get_fold_pts() const
{
   CEdgeStrip * strip = _boundary.cur_strip();
   if ( strip ) {
      return fold_points(strip->verts().pts(), sweep_vec(), true);
   }
   
   return Wpt_list();
}
Exemplo n.º 2
0
void
UVdata::split(CEdgeStrip& strip)
{
   ARRAY<Bvert_list> chains;
   strip.get_chains(chains);
   for (int i=0; i<chains.num(); i++)
      split_chain(chains[i]);
}
Exemplo n.º 3
0
inline void
add_to_strip(Bvert* v, CEdgeStrip& source, EdgeStrip& ret)
{
   assert(v);
   CBvert_list& verts = source.verts();
   CBedge_list& edges = source.edges();
   int k = verts.get_index(v);
   assert(verts.valid_index(k) && edges[k]->flag());
   while (verts.valid_index(k) && edges[k]->flag()) {
      edges[k]->clear_flag();
      ret.add(verts[k], edges[k]);
      if (source.has_break(k+1)) {
         k = verts.get_index(source.next_vert(k));
      } else {
         k++;
      }
   }
}
Exemplo n.º 4
0
bool
OVERSKETCH::compute_offsets(CPIXEL_list& pts, CEdgeStrip& sils)
{
   double yardstick = compute_yardstick(sils.edges(), debug);

   assert(sils.num_line_strips() == 1);
   Bvert_list chain;
   int k = 0;
   sils.get_chain(k, chain);
   int count = 0;
   vector<double> offsets;
   Wpt_list new_locs = chain.pts();
   for (Bvert_list::size_type i=0; i<chain.size(); i++) {
      offsets.push_back(compute_offset(chain[i], pts, yardstick));
      if (offsets.back() > 0) {
         count++;
      }
   }
   err_adv(debug, "found %d/%d offsets", count, chain.size());

   apply_offsets(chain, offsets);

   return true;
}
Exemplo n.º 5
0
bool
OVERSKETCH::find_matching_sil(CPIXEL_list& pts, CEdgeStrip& sils)
{
   err_adv(debug, "   checking %d edges", sils.num());
   _selected_sils.reset();
   for (int i=0; i<sils.num(); i++)
      if (do_match(pts, sils.edge(i)))
         _selected_sils.add(sils.vert(i), sils.edge(i));

   _mesh = dynamic_pointer_cast<LMESH>(_selected_sils.mesh());
   if (_mesh) {
      int n = _selected_sils.num_line_strips();
      _selected_sils = _selected_sils.get_unified();
      err_adv(debug, "   found %d edges, (%d pieces, was %d)",
              _selected_sils.num(), _selected_sils.num_line_strips(), n);
      activate();
      select_faces();
      check_primitive();
      return true;
   }
   _selected_sils.reset();
   err_adv(debug, "   failed");
   return false;
}