Hi All,
I m trying to figure out how to manage and delete the surfaces that are under a plane
So far i have managed to do with a constant height but comparing the Z value of the Area Centroid with a specific Z - value
However I dont know how to modify the script that it finds the corresponding Z value of the plane
To illustrate:
I have this plane which is actually an extruded polyline

The forward part has a Z = 1300 so with the script below all forward part that is below 1300 are removed
import rhinoscriptsyntax as rs
def extrude_crv(B):
# Select Curve
crv = rs.GetObject("Select Curve to Extrude")
rs.EnableRedraw(False)
# Extrude Curve
start_point = rs.CurveStartPoint(crv)
end_point = start_point + rs.coerce3dpoint((0,B,0))
path = rs.AddLine(start_point,end_point)
extruded_plane = rs.ExtrudeCurve(crv, path)
return extruded_plane
B=10000
x_min = 0
x_max = 100000
length = 1000
y_min = 0
breadth = 5000
z_min = 0
height = 15000
breps = []
extrude_plane = extrude_crv(B)
for x in range(x_min,x_max,1000):
rectangle = rs.AddRectangle( rs.WorldYZPlane(), breadth, height)
obj = rs.MoveObject(rectangle, (x, y_min, z_min) )
obj = rs.AddPlanarSrf(obj)
rs.DeleteObject(rectangle)
breps.append(obj)
for brep in breps:
if rs.IsSurface(brep):
splits = rs.SplitBrep ( brep, extrude_plane )
if splits:
for obj in splits:
if obj:
cog = rs.SurfaceAreaCentroid(obj)
if cog[0].Z < 1300:
rs.DeleteObject(obj)
rs.DeleteObject(brep)
Any ideas on how to approach this would be really helpful!
For convenience i also attach the rhinofile with the polyline
split_brep.3dm (27.3 KB)
