How to offset bounding box geometry

Hi All,

I have created a dynamo script to create a 3D view for each tree that is placed in the model.
The script is working fine on the face of it. However, the 3D views that are created have to be manually offset by a tiny amount in order for the tree to be visible.

The tree’s are created using Planting category which means the whole element must be visible in the section box else none of it shows. I’m assuming that because the bounding box is being created perfectly to suit the trees that they’re not showing because it’s literally on the extent of it being visible vs not visible.

Hence, i’m hoping there’s a nice way to implement an offset (in all directions) by say 200mm - Ideally this would be a variable input though using number slider.

Would very much appreciate any help with this :slight_smile:

1 Like

@PCL_Jack ,hi

that should work!

2022-11-24_15h01_17
grafik

boundingbox.Scale!

3 Likes

hello, here is a possibility
1/you draw a line with x,y and z component of 200 (you can feed with a slider) from boundingbox.max
2/ you draw a line from boundingbox.min to boundingbox.max
3) you draw a line with x,y and z component of -200 (you can feed with the same slider * -1) from boundingbox.min
4/you transform these 3lines into polycurve
5/bounding box of the geometry made in 4

I’m not in front of the computer, I’ll do the return if you don’t understand the process
edit:

code block:

a=Line.ByStartPointEndPoint(
Pt_max_BB,
Point.ByCoordinates
(Delta+Pt_max_BB.X,
Delta+Pt_max_BB.Y,
Delta+Pt_max_BB.Z));
b=Line.ByStartPointEndPoint(
Pt_max_BB,Pt_min_BB);
c=Line.ByStartPointEndPoint(
Pt_min_BB,
Point.ByCoordinates
(-Delta+Pt_min_BB.X,
-Delta+Pt_min_BB.Y,
-Delta+Pt_min_BB.Z));
[a,b,c];

Package Springs BB by distance scale is more direct as mentioned by Mr. Draxl

Cordially
christian.stan

1 Like