i have a script that orient a profil on surface intersections, but in this case it reverse some orientation, why? i don’t know, so i search, an i find the reverse orientation of this surface.
i try with a script that write the start and end of surface intersections:
my script can orient a lot of polyline on surfaces intersections, but how can i be sure that all are in the same orientation?
i have to search a better way…
Hello - if the input is parallel, or more or less parallel, more or less planar surfaces, then I can imagine it is possible to line them up, yes. But currently there is no command for this - well, except the ShowDir command which will lat you make adjustments to multiple surfaces at once, but it is not automatic.
No - you can set this, (in Rhino Reparameterize)but in general no.
I’ll see if I can cook something up - it seems to me that @Helvetosaur might have done this already in a script…?
Thank you!!! All surfaces are planar surface, but not parallel… I don’t know how I can compare u or v direction. To be sure, maybe I can rebuilt all surfaces with the same code…
Something like this should set the domain of all single-face breps (i.e. surfaces, not polysurfaces) to 0 to 1 in both the U and V directions:
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
srfIDs=rs.GetObjects("Select surfaces to normalize domain",8,preselect=True)
if srfIDs:
norm_interval=Rhino.Geometry.Interval(0,1)
breps=[rs.coercebrep(srfID) for srfID in srfIDs]
for i,brep in enumerate(breps):
if brep.Faces.Count==1:
face=brep.Faces[0]
face.SetDomain(0,norm_interval)
face.SetDomain(1,norm_interval)
norm_brep=face.DuplicateFace(True)
sc.doc.Objects.Replace(srfIDs[i],norm_brep)
sc.doc.Views.Redraw()
import rhinoscriptsyntax as rs
name=''
surfs=rs.GetObjects('select',8)
if surfs:
rs.EnableRedraw(False)
for surf in surfs:
if rs.IsSurfacePlanar(surf):
if rs.ObjectLayer(surf):layer=rs.ObjectLayer(surf)
if rs.ObjectName(surf):name=rs.ObjectName(surf)
cvs=rs.DuplicateEdgeCurves(surf)
rs.DeleteObject(surf)
surf=rs.AddPlanarSrf(cvs)
if layer:rs.ObjectLayer(surf,layer)
if name:rs.ObjectName(surf,name)
rs.DeleteObjects(cvs)
rs.EnableRedraw(True)
i built a new surface, that make all surfaces with the same u and v direction…