How to get the skin surface of the pipe fitting

hello

Active CAD practitioner
Hi, I want to get the skin surface of the pipe fitting, as shown below. Is there a solution in open cascade? I would appreciate a code reference1679012294251.png
 

Quaoar

Administrator
Staff member
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:

Code:
const int seedFaceId = ... // Should be selected, e.g. by area in the simplest case.

// Get all adjacent faces. AAG should have been constructed beforehand.
asiAlgo_Feature newSeeds;
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.
  Handle(asiAlgo_FeatureAttrAngle)
    DA = aag->ATTR_ARC<asiAlgo_FeatureAttrAngle>(arc);
  //
  if ( DA.IsNull() )
    continue;
    
  if ( !asiAlgo_FeatureAngle::IsSmooth( DA->GetAngleType() ) )
    continue;

  // To continue iterating.
  newSeeds.Add(nid);
 
  // TODO: continue recursively with `newSeeds`...
}
 
Top