Unrolling panels from both knowledge patterns.
The second set (generated from second knowledge pattern) is unrolled at (i+1) to space them correctly.
Here's a comprehensive overview:
STEP1, gets curves from a multi-section surface.
let d1(roofudfcurve)
let i (integer)
i=0
for i while i <= curvenumber /2
{
d1 = CreateOrModifyTemplate("roofdesign|roofudfcurve",CURVES ,`Relations\Knowledge Pattern.1\roofudfcurve` ,i)
d1.Line2 = CONTEXT\Line.2
d1.Line5 = CONTEXT\Line.6
d1.Line3 = CONTEXT\Line.5
d1.Line4 = CONTEXT\Line.7
d1.Line1 = CONTEXT\Line.3
d1.Surface1 = CONTEXT\Fill.3
d1.curvenumber = curvenumber - 1
d1.curveposition = (i*2)-1
EndModifyTemplate(d1)
d1.Name = "CRV" + ToString(i)
d1.Color = ToString(200)+","+ToString(100)+",255"
}
STEP2, Generates intermediary curves.
let d1(roofudfcurve)
let i (integer)
i=0
for i while i <= curvenumber /2
{
d1 = CreateOrModifyTemplate("roofdesign|roofudfcurve",CURVES2 ,`Relations\Knowledge Pattern.3\roofudfcurve` ,i)
d1.Line2 = CONTEXT\Line.2
d1.Line5 = CONTEXT\Line.6
d1.Line3 = CONTEXT\Line.5
d1.Line4 = CONTEXT\Line.7
d1.Line1 = CONTEXT\Line.3
d1.Surface1 = CONTEXT\Fill.3
d1.curvenumber = curvenumber - 1
d1.curveposition = (i*2)-2
EndModifyTemplate(d1)
d1.Name = "CRV" + ToString(i)
}
STEP3, Generates and unrolls first set of surfaces
let p1(roofudfsurf)
let i (integer)
let j (integer)
let cn (integer)
let sn (Integer)
let da (length)
let db (length)
let dc (length)
let la (length)
let lb (length)
let pa (length)
let pb (length)
let pc (length)
let angle (angle)
let cut (angle)
i = 1
da = D1
db = D2
dc = D3
la = L1
lb = L2
pa = P1
pb = P2
pc = P3
angle = L1A
cut = CUT1
cn = curvenumber
sn = surfnumber
for i while i <= cn/2
{
j=1
for j while j<=sn/2
{
p1=CreateOrModifyTemplate("roofdesign|roofudfsurf", SURF2 ,`Relations\Knowledge Pattern.4\roofudfsurf5` , (i-1)*sn+j) /*generates the panels*/
p1.CRV9= `Relations\Knowledge Pattern.3\roofudfcurve` ->GetItem(i)
p1.CRV10= `Relations\Knowledge Pattern.1\roofudfcurve` ->GetItem(i)
p1.surfposition = (j*2)-2
p1.surfnumber = sn
p1.Line.17=`Relations\Knowledge Pattern.5\roofudfunroll` ->GetItem(i)
p1.Plane.7=UNROLL\Plane.3 /*needed for unfold*/
p1.CONSTRUCTION\D1 = da
p1.CONSTRUCTION\D2 = db
p1.CONSTRUCTION\D3 =dc
p1.CONSTRUCTION\P1 = pa
p1.CONSTRUCTION\P2 = pb
p1.CONSTRUCTION\P3 = pc
p1.CONSTRUCTION\L1 = la
p1.CONSTRUCTION\L2 = lb
p1.Point.4 =Attractors\Point.11
p1.Point3 =Attractors\Point.10
p1.Point2 = Attractors\Point.9
p1.Point1 = Attractors\Point.8
EndModifyTemplate(p1)
p1.Name= "panel." + ToString(i) +"."+ToString(j)
}
}
STEP4, Generates and unrolls second set of surfaces.
let p1(roofudfsurf)
let i (integer)
let j (integer)
let cn (integer) /*number of curves*/
let sn (Integer) /* number of surfaces*/
i = 1
cn = curvenumber
sn = surfnumber
for i while i <= cn/2
{
j=1
for j while j<=sn/2
{
p1=CreateOrModifyTemplate("roofdesign|roofudfsurf", SURF ,`Relations\Knowledge Pattern.2\roofudfsurf` , (i-1)*sn+j) /*generates the panels*/
p1.CRV9= `Relations\Knowledge Pattern.1\roofudfcurve` ->GetItem(i)
p1.CRV10= `Relations\Knowledge Pattern.3\roofudfcurve` ->GetItem(i+1)
p1.surfposition = (j*2)-1
p1.surfnumber = sn
p1.Line.17=`Relations\Knowledge Pattern.5\roofudfunroll` ->GetItem(i+1)
p1.Plane.7=UNROLL\Plane.3 /*needed for unfold*/
p1.Point.4 =Attractors\Point.11
p1.Point3 =Attractors\Point.10
p1.Point2 = Attractors\Point.9
p1.Point1 = Attractors\Point.8
EndModifyTemplate(p1)
p1.Name= "panel." + ToString((i-1)*sn+j)
}
}
Here is Knowledge Pattern.5 that the previous scripts are referencing:
let d1(roofudfunroll)
let i (integer)
i=0
for i while i <= curvenumber
{
d1 = CreateOrModifyTemplate("roofdesign|roofudfunroll",UNROLLCURVES ,`Relations\Knowledge Pattern.5\roofudfunroll` ,i)
d1.Line.2 = UNROLL\Line.323
d1.Line.1 = UNROLL\Line.324
d1.curvenumber = curvenumber - 1
d1.curveposition = i - 1
EndModifyTemplate(d1)
d1.Name = "UNROLL" + ToString(i)
}
No comments:
Post a Comment