

I made some changes to the framework, they are now smaller segments that have the same length. They are coincident with the curve control the shape of each branch. A simple geometry shape consists of two circles axles and a triangular roadway is the basic element of roadway. They are vertically interlocked with each other.




This week I mainly worked on writing UDF. The first iteration of UDF is to generate section rings through the tube structure of each branch. And the second iteration is to generate bubbles between rings. Because the bubbles are interlocked with each other, they are generated in pairs.
The udfs are as follow:
1. For the rings:
let d1 (tubeudfring)
let i (Integer)
i = 1
For i while i <= ringnumber-1
{
d1 = CreateOrModifyTemplate("tubedesign2|tubeudfring", rings,`Relations\Knowledge Pattern.3\tubeudfring` , i)
d1.ringratio = ringratio
d1.ringposition =i
d1.ringnumber = ringnumber - 1
d1.Curve.2 = `tube sections\Spline.1`
d1.Surface.2 = `tube\Multi-sections Surface.3`
EndModifyTemplate(d1)
d1.Name = "CRV" + ToString(i)
}
2. For the bubbles
let p1(tubeudfbubble)
let i (integer)
let j (integer)
let rn (integer) /*number of rings*/
let bn (Integer) /* number of bubbles*/
rn = ringnumber
bn = bubblenumber
i = 1
for i while i <= rn-2
{
j=1
for j while j<=bn
{
p1=CreateOrModifyTemplate("tubedesign2|tubeudfbubble", bubble ,`Relations\Knowledge Pattern.4\tubeudfbubble` , (i-1)*bn+j) /*generates the panels*/
p1.CRV1= `Relations\Knowledge Pattern.1\tubeudfring` ->GetItem(i) /*use curve list from previous knowledge template*/
p1.CRV2= `Relations\Knowledge Pattern.1\tubeudfring` ->GetItem(i+1) /*uses same list but the next curve with the plus 1 funtion*/
p1.CRV3=`Relations\Knowledge Pattern.1\tubeudfring` ->GetItem(i+2)
p1.bubbleposition = j-1
p1.bubblenumber = bn
p1.midratio = midratio
p1.bbmidratio = bbmidratio
p1.bbhtratio=bbhtratio
p1.scangle=scangle
p1.gapratio=gapratio
p1.sectionratio=sectionratio
EndModifyTemplate(p1)
p1.Name= "panel." + ToString((i-1)*bn+j)
/*p1.Color = ToString(round(j*(255/sn)))+","+ToString(round(i*(255/cn)))+",255"*/
}
}
No comments:
Post a Comment