Selecting specific faces from list of breps

I am trying to select specific faces from these two towers, on the twisted side:

The script i have doesn’t seem to achieve this 100%:

Any Ideas?

selecting faces.gh (326.2 KB)

You can make this into a component

foreach (var obj in towers)
{
  var tower = obj as Brep;
  if (tower == null) continue;

  //get the twisted side faces
  for (int i = 0; i < tower.Faces.Count; i++)
  {
      var face = tower.Faces[i];
      var face_normal = face.NormalAt(0, 0);
      var angle = Vector3d.VectorAngle(face_normal, Vector3d.ZAxis);
      if (angle > Math.PI / 4)
      {
          twisted_faces.Add(face);
      }
  }
}

Keep in mind that this script assumes that the two towers are represented as Brep objects in the Rhino document. If the towers are represented in a different way, the script will need to be modified accordingly.

Another idea using a curve as a reference…
However from the look of it, it seems the towers are generated with another Grasshopper file, so maybe some tweaks could be done in that to make the breps orientation somehow more consistent.

selecting faces.gh (333.2 KB)

1 Like

You have modified the code in unfortunate ways that make it harder… From last October:

P.S. I added the gray group (below) to the old code. It isolates the surface fragments above and/or below the twisted (non-planar) surface.


controlling twist_2023Jan12a.gh (37.0 KB)

1 Like