algorithmic modeling for Rhino
Hi All,
I found this script on the discourse forum but not been able to edit it to return the points inside the brep, don't know if its because i am trying to access the return the points from the wrong part of the code.
Any thought much appreciated.
def Threaded_PointTest(Brep,Cloud):
## Make Sure Test Polysurface is Closed##
if rs.IsPolysurfaceClosed(Brep)!=True: print "Test brep is Not Closed" return
## Get a Private Copy for Multi-Threading ##
brep=rs.coercebrep(Brep)
brep.EnsurePrivateCopy()
## Turn Object into a PointCloud ##
Cloud=rs.coercegeometry(Cloud)
## Holder for Points inside Surface ##
Result=[]
tol=scriptcontext.doc.ModelAbsoluteTolerance
def TestPoints(Pt):
try:
point=rs.coerce3dpoint(Pt.Location)
if brep.IsPointInside(point,tol,True)==True:
Result.append(point)
except:
pass
CloudPts=Cloud.GetEnumerator()
ghpythonlib.parallel.run(TestPoints,CloudPts)
Plane=rs.PlaneFitFromPoints(Result)
Plane=rs.coerceplane(Plane) r,Curves,points=Rhino.Geometry.Intersect.Intersection.BrepPlane(brep,Plane,tol) if r==True:
PlanarSrf=rs.AddPlanarSrf(Curves)
Original Post.
Tags:
Hi Matt,
there was an answer there, was it helpful?
Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by