I'm working on complex surface tesselation with triangular flat panels. This rhinoscript:
-plot a grid of points at U,V parameters of input surface
-draws 3 lines in order to create a triangular shape
-fillet lines with variable radius to rounded the edges of triangle shape
-extract endpoints and startpoints of fillet arcs
-draw lines from start points to endpoints in sequence
-join results curves
-add planar surface to realize flat panel with rounded corners
"hot" code:
-------------
For i =1 To Intuint-2 Step 2
For j =1 To intvint-2 Step 2
arrcurve5=array(arrpt(i,j),arrpt(i+2,j))
arrcurve6=array(arrpt(i+2,j),arrpt(i,j+2))
arrcurve7=array(arrpt(i,j+2),arrpt(i,j))
strcurve5=rhino.AddCurve(arrcurve5,1)
strcurve6=rhino.AddCurve(arrcurve6,1)
strcurve7=rhino.AddCurve(arrcurve7,1)
arrfillet1= rhino.addfilletcurve(strcurve5,strcurve6,1)
arrFillet = Rhino.CurveFilletPoints(strCurve5, strCurve6,1)
arrfillet2= rhino.addfilletcurve(strcurve6,strcurve7,1)
arrFillet = Rhino.CurveFilletPoints(strCurve6, strCurve7,1)
arrfillet3= rhino.addfilletcurve(strcurve7,strcurve5,1)
arrFillet = Rhino.CurveFilletPoints(strCurve7, strCurve5,1)
arrpt1 = Rhino.CurveendPoint(arrfillet3)
Rhino.AddPoint arrpt1
arrpt2 = Rhino.CurvestartPoint(arrfillet1)
Rhino.AddPoint arrpt2
arrpt3 = Rhino.CurvestartPoint(arrfillet3)
Rhino.AddPoint arrpt3
arrpt4 = Rhino.CurveendPoint(arrfillet2)
Rhino.AddPoint arrpt4
arrpt5 = Rhino.CurveendPoint(arrfillet1)
Rhino.AddPoint arrpt5
arrpt6 = Rhino.CurvestartPoint(arrfillet2)
Rhino.AddPoint arrpt6
strcurve10= Rhino.AddLine (arrpt1, arrpt2)
strcurve11= Rhino.AddLine (arrpt3, arrpt4)
strcurve12= Rhino.AddLine (arrpt5, arrpt6)
Rhino.JoinCurves array(strcurve10,strcurve11,strcurve12,arrfillet1, arrfillet2,arrfillet3)
Rhino.AddPlanarSrf array(strcurve10,strcurve11,strcurve12,arrfillet1, arrfillet2, arrfillet3)
--------------------------
0 commenti:
Post a Comment