Hi everyone,
I am trying to figure use of NetworkSurface in Rhino using RhinoPython. Before moving to non-straight edge geometries, I am working on creating just a single rectangular surface. Please give your feedback on the issue.
While creating the surface, I am facing a trouble that the normal direction of the surface created does not remain consistent. I am also implementig a flag to flip the normal using the FlipNormal function if necessary but I would really like the normal direction to be consistent for a given NetworkSurface function call for a given order of curves/lines created.
See the code below. This if you run once will have normal in one direction. But delete that surface and say run again then it might end up having a flipped normal.
import rhinoscriptsyntax as rs
def srfCreate(P1=None,P2=None,P3=None,P4=None):
Line1 = rs.AddLine(P1,P2)
Line2 = rs.AddLine(P2,P3)
Line3 = rs.AddLine(P3,P4)
Line4 = rs.AddLine(P4,P1)
curves = {Line1,Line2,Line3,Line4}
Rectangle_obj = rs.AddNetworkSrf(curves,edge_tolerance=1e-5, interior_tolerance=1e-4,angle_tolerance=0)
if name == âmainâ:
P1=(0,0,0)
P2=(0,1,0)
P3=(1,1,0)
P4=(1,0,0)
normal_flag=âFALSEâ
srf1=srfCreate(P1,P2,P3,P4)
if(normal_flag):
rs.FlipSurface(srf1, normal_flag)