Do you mean to extract the outer faces from an existing tube? If so, then it's a feature recognition task: you start from a seed face (e.g., the one with the highest surface area) and then loop over its neighbors to grow the region. In your specific case, it looks like you should always iterate only smoothly connected neighbors.
Here is the idea on how you can start off in Analysis Situs:
const int seedFaceId = ... // Should be selected, e.g. by area in the simplest case.
// Get all adjacent faces. AAG should have been constructed beforehand.
const asiAlgo_Feature& neighbors = aag->GetNeighbors(seedFaceId);
for ( asiAlgo_Feature::Iterator nit(neighbors); nit.More(); nit.Next() )
const int nid = nit.Key();
asiAlgo_AAG::t_arc arc(seedFaceId, nid);
// Get the dihedral angle.
DA = aag->ATTR_ARC<asiAlgo_FeatureAttrAngle>(arc);
if ( DA.IsNull() )
if ( !asiAlgo_FeatureAngle::IsSmooth( DA->GetAngleType() ) )
// To continue iterating.
// TODO: continue recursively with `newSeeds`...