Grasshopper

algorithmic modeling for Rhino

Hi everyone,

I'm currently trying to split and delete a Brep with Python. Specifically I have one brep which intersects with another. What I want to do is simply delete the intersecting faces.

My code deletes the correct faces, but the remaining faces are rectangles rather than the trimmed surfaces. What do I need to do with the faces to get the brep surfaces? Here is my simple code and attached pictures:

import Rhino as rh

keepFaces = []
for f in Faces:
    x,y,z = rh.Geometry.Intersect.Intersection.BrepSurface(Rod,f,0)
    if len(str(y))==16:
        keepFaces.append(f)

Thanks for your help,

Florian

What I have:

What I want:

What I get:

Views: 1290

Replies to This Discussion

Keepfaces must be a list of surfaces instead of brepfaces. Surfaces in RhinoCommon do not support trims. I think you have to convert your brepfaces into actual breps before adding them to the list.

DuplicateFace will do the trick, as David said:

        keepFaces.append(f.DuplicateFace(False))

newBrep = Rhino.Geometry.Brep.JoinBreps(keepFaces, 0.01)

Thanks a lot to you two! The "DuplicateFace" method did the trick :)

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