Extract multiple surfaces


Is it also possible to extract one surface side of multiple polysurfaces with different orientations? Eg. the surfaces closest to 0,0,0 or a specific point?

Extract surfaces.3dm (1.1 MB)

You can extract surfaces using RhinoScript or Python. Extracting a surface requires 1.) the Brep (polysurface) and 2.) The index of the face you want to extract. This can be determined by calculating the closes points to all Brep faces and then using the face that is closest to your test point.

Thanks! I will try to create a start and might get back to you…

Hmmm not working so far. I copied a bit from another script somewhere on this forum. I understand the part of duplicating the faces and I got it working for multiple polysurfaces, but the testing the index of faces with the 3d point won’t work…

It creates all faces…

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

def DuplicateMulti():
    msg="Select objects"
    objs=rs.GetObjects(msg,filter=16, preselect=True)
    for obj in objs:
            Brep = rs.coercebrep(obj)
            if not Brep: return
            mdlPts = []
            domain0 = Rhino.Geometry.Interval(0,1)
            domain1 = Rhino.Geometry.Interval(0,1)
            arrFaces = Brep.Faces
            for Face in arrFaces:
                mdlPts.append(Face.PointAt(0.5, 0.5))
                faceI = 0
                for i,pt in enumerate(mdlPts):
                        if pt[2] > point:
                                    faceI = i