Grasshopper

algorithmic modeling for Rhino

Hi everybody,

I was wondering how to extract the faces and edges from a brep just like the brep component does in grasshopper and Brep.Edges and Brep.Faces return the frames of each of them.

Does anybody know how to get it?

Cheers

Views: 4505

Replies to This Discussion

You can iterate over the edge and faces, then call the appropriate duplication functions. Like so:

For i As Int32 = 0 To brp.Faces.Count - 1
    faces.Add(brp.Faces(i).DuplicateFace(False))
Next


--
David Rutten
david@mcneel.com
Seattle, WA
Now I see ... thanks, David!

Hi David,

I seem to be similarly confused. As an example, I have a planar surface with a trimmed hole in it. I want to extract out the edge curves for both the outside edge and the interior edge. 

I'm using this simple code

Private Sub RunScript(ByVal x As Surface, ByVal y As Object, ByRef A As Object)

Dim b As brep = x.tobrep
Dim edge_list As New list (Of curve )


For Each e As brepedge In b.Edges
edge_list.add(e.duplicatecurve)
Next

a = edge_list

End Sub

and I only get the outside 4 edges. I want to get the interior circle as well.

Your "Brep Wireframe" component correctly gives the 4 outside curves and the inside circle. What RhinoCommon command are you using to provide this functionality. I've tried "Brep.GetWireFrame", "Brep.Edges" and all I keep getting is the outside square.

This seems pretty simple but I can't find the right Brep function.

Let me know.

Thanks

Kermin

Surfaces do not support trims. You need to use the Brep type hint for the input.

Oh Ok. That makes sense now.

Thanks.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service