02-27-2021, 07:29 AM
Just coded a traffic signal for my Nashville build and really happy how it turned out.
![[Image: attachment.php?aid=1737]](https://www.icr2.net/forum/attachment.php?aid=1737)
Here's the .3D file for this, all the lines beginning with % are comments and not picked up by 3D23DO. I broke up the object into sections and combined them together with BSPF or BSPA as I went along.
To compile, I ran 3D23DO /s=6000 filename, the /s converts my feet into 500ths
I just realized that I reuse the tags "o1" and "o2" which originally referred to the stages of putting together the light pole, but I guess once it gets collected with BSPF/BSPA, I was able to use those same labels for other points. Didn't seem to affect the end result.
3D VERSION 3.0;
% USER DEFINED POINTS
% LIGHT POLE
%
% a d
% b c
%
% e h
% f g
% units = feet
a: [< -0.25, 0.25, 20>];
b: [< -0.25, -0.25, 20>];
c: [< 0.25, -0.25, 20>];
d: [< 0.25, 0.25, 20>];
e: [< -0.25, 0.25, 0>];
f: [< -0.25, -0.25, 0>];
g: [< 0.25, -0.25, 0>];
h: [< 0.25, 0.25, 0>];
% COLORS = 29,30
% POLYGONS
ls: POLY <29> {a,e,f,b};
rs: POLY <29> {c,g,h,d};
fr: POLY <30> {b,f,g,c};
bk: POLY <30> {d,h,e,a};
tp: POLY <22> {a,b,c,d};
% BSP TREE
nil: NIL;
o0: BSPF (a,b,c),nil,tp,nil;
o1: BSPF (a,e,f),nil,ls,o0;
o2: BSPF (d,h,e),nil,bk,o1;
o3: BSPF (c,g,h),nil,rs,o2;
pole: BSPF (b,f,g),nil,fr,o3;
% ====================================
% LIGHT BRANCH
% k m
% i l n
% j
i: [<0.25, 0, 15>];
j: [<0.25, 0, 14.5>];
k: [<20, 0, 17.5>];
l: [<20, 0, 17>];
m: [<60, 0, 17.5>];
n: [<60, 0, 17.2>];
% POLYS
br1: POLY <30> {i,j,l,k};
br2: POLY <30> {k,l,n,m};
% BSP TREE
o4: BSPA (i,j,l),nil,br1,pole;
o5: BSPA (k,l,m),nil,br2,o4;
% ====================================
% LIGHTS AND SIGN
% o r
%
% p q
o1: [<20, 0, 19>];
p1: [<20, 0, 15>];
q1: [<22, 0, 15>];
r1: [<22, 0, 19>];
o4f: [<25, 0.1, 17.5>];
p4f: [<25, 0.1, 16>];
q4f: [<32, 0.1, 16>];
r4f: [<32, 0.1, 17.5>];
o2: [<35, 0, 19>];
p2: [<35, 0, 15>];
q2: [<37, 0, 15>];
r2: [<37, 0, 19>];
o3: [<50, 0, 19>];
p3: [<50, 0, 15>];
q3: [<52, 0, 15>];
r3: [<52, 0, 19>];
% POLYS
l1: POLY <30> {o1,p1,q1,r1};
l2: POLY <30> {o2,p2,q2,r2};
l3: POLY <30> {o3,p3,q3,r3};
s1f: POLY <104> {o4f,p4f,q4f,r4f};
% ==================================
% ATTACH LIGHTS/SIGN TO POLE/BRANCH (o5)
% BSP TREE
o6: BSPA (o1,p1,q1),nil,l1,o5;
o7: BSPA (o2,p2,q2),nil,l2,o6;
o8: BSPA (o3,p3,q3),nil,l3,o7;
o9: BSPA (r4f,q4f,p4f),nil,s1f,o8;
Here's the .3D file for this, all the lines beginning with % are comments and not picked up by 3D23DO. I broke up the object into sections and combined them together with BSPF or BSPA as I went along.
To compile, I ran 3D23DO /s=6000 filename, the /s converts my feet into 500ths
I just realized that I reuse the tags "o1" and "o2" which originally referred to the stages of putting together the light pole, but I guess once it gets collected with BSPF/BSPA, I was able to use those same labels for other points. Didn't seem to affect the end result.
3D VERSION 3.0;
% USER DEFINED POINTS
% LIGHT POLE
%
% a d
% b c
%
% e h
% f g
% units = feet
a: [< -0.25, 0.25, 20>];
b: [< -0.25, -0.25, 20>];
c: [< 0.25, -0.25, 20>];
d: [< 0.25, 0.25, 20>];
e: [< -0.25, 0.25, 0>];
f: [< -0.25, -0.25, 0>];
g: [< 0.25, -0.25, 0>];
h: [< 0.25, 0.25, 0>];
% COLORS = 29,30
% POLYGONS
ls: POLY <29> {a,e,f,b};
rs: POLY <29> {c,g,h,d};
fr: POLY <30> {b,f,g,c};
bk: POLY <30> {d,h,e,a};
tp: POLY <22> {a,b,c,d};
% BSP TREE
nil: NIL;
o0: BSPF (a,b,c),nil,tp,nil;
o1: BSPF (a,e,f),nil,ls,o0;
o2: BSPF (d,h,e),nil,bk,o1;
o3: BSPF (c,g,h),nil,rs,o2;
pole: BSPF (b,f,g),nil,fr,o3;
% ====================================
% LIGHT BRANCH
% k m
% i l n
% j
i: [<0.25, 0, 15>];
j: [<0.25, 0, 14.5>];
k: [<20, 0, 17.5>];
l: [<20, 0, 17>];
m: [<60, 0, 17.5>];
n: [<60, 0, 17.2>];
% POLYS
br1: POLY <30> {i,j,l,k};
br2: POLY <30> {k,l,n,m};
% BSP TREE
o4: BSPA (i,j,l),nil,br1,pole;
o5: BSPA (k,l,m),nil,br2,o4;
% ====================================
% LIGHTS AND SIGN
% o r
%
% p q
o1: [<20, 0, 19>];
p1: [<20, 0, 15>];
q1: [<22, 0, 15>];
r1: [<22, 0, 19>];
o4f: [<25, 0.1, 17.5>];
p4f: [<25, 0.1, 16>];
q4f: [<32, 0.1, 16>];
r4f: [<32, 0.1, 17.5>];
o2: [<35, 0, 19>];
p2: [<35, 0, 15>];
q2: [<37, 0, 15>];
r2: [<37, 0, 19>];
o3: [<50, 0, 19>];
p3: [<50, 0, 15>];
q3: [<52, 0, 15>];
r3: [<52, 0, 19>];
% POLYS
l1: POLY <30> {o1,p1,q1,r1};
l2: POLY <30> {o2,p2,q2,r2};
l3: POLY <30> {o3,p3,q3,r3};
s1f: POLY <104> {o4f,p4f,q4f,r4f};
% ==================================
% ATTACH LIGHTS/SIGN TO POLE/BRANCH (o5)
% BSP TREE
o6: BSPA (o1,p1,q1),nil,l1,o5;
o7: BSPA (o2,p2,q2),nil,l2,o6;
o8: BSPA (o3,p3,q3),nil,l3,o7;
o9: BSPA (r4f,q4f,p4f),nil,s1f,o8;