algorithmic modeling for Rhino
I've just tried this. Occasionally, points end up outside the surface - could this have something to do with trimming? Is there a workaround? I cannot figure out how to test if the point is contained within the surface using python.
Thanks
For BrepFaces you can test whether a UV point is on or off the trim domain. However when you convert a BrepFace to a Surface you lose the trimming information, so it's important to maintain the original BrepFace.
--
David Rutten
david@mcneel.com
EDIT: Got it working now, Thanks.
For anyone else reading this, I used rhinoscriptsyntax.IsPointOnSurface
--------
Whoa. I didn't even know there was a separate type called Brepface. How might I perform that test?
I'm trying to place a point on a surface that is beyond some distance from two other sets of points on the surface.
Here's what I'm working with so far:
def ThrowDart(ListA, DistA, ListB, DistB, Surf_id):
Done = False
Uspan = rs.SurfaceDomain(Surf_id,0)
Vspan = rs.SurfaceDomain(Surf_id,1)
while not Done:
UVCoords = [random.uniform(Uspan[0],Uspan[1]),random.uniform(Vspan[0],Vspan[1])]
Eval = rs.EvaluateSurface(Surf_id,UVCoords[0],UVCoords[1])
NewPt = Rhino.Geometry.Point3d(Eval)
# Some kind of surface-region containment test here?
# test for Distance from ListA and ListB points here
Thanks again for your help. It's been a few months since I've looked at any of this stuff, unfortunately, so I'm out of practice. My eventual goal is to make a GH component that will perform leaf veination type stuff.
Ok, python isn't my strong suit, but it looks like you're trying to use RhinoScript like methods in python. There may be a method for testing whether a UV point is on a brepface, I do not know what it is called if it exists.
I can show you how to do this in C# (see attached).
--
David Rutten
david@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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by