Grasshopper

algorithmic modeling for Rhino

Hi!

I wanna write a script witch returns the Borderlines of each face of a Brep.

Is there any command in the RhinoCommon SDK similar to the command "Duplicate Border" in Rhino?

Views: 2591

Replies to This Discussion

Hi Max,

 

do you want to find all the boundaries of all the faces in a Brep, or do you want to find all the naked edges for the entire Brep?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I need the boundary of each face.

 

I can get the faces by Brep.Faces as BrepFace-Objects but I can't find a command to get the Border of this faces.

 

There's no such function. But you can iterate over all the edges of the face. Then duplicate these edges as curves and join them. Note that a face can have any number (equal to or higher than one) of closed edge loops.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

 

Hi,

maybe this helps... not very elegant

 

private void RunScript(Brep brep_in, object y, ref object A)
  {
    List<Curve> my_curve_list = new List<Curve>();
    for(int i = 0;brep_in.Faces.Count > i;i++)
    {    my_curve_list.AddRange(Curve.JoinCurves(brep_in.Faces[i].DuplicateFace(true).DuplicateEdgeCurves()));
    }
    A = my_curve_list;

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service