Bounding Box - Orient curves

Hey all, I’m new to this but I’m slowly figuring it out. I’m almost done with my script but I can’t get past one roadblock and I know its a simple fix I’m just not figuring it out.

I have several contour curves from a selected object which I have projected to a plane. I then evaluated the curves for their bounding box which I want to use to move the curves so that they don’t intersect. In the Dbrep item for the curves’ bounding boxes, I have 4 edges of the bounding boxes (because they’re 2D curves). So my tree looks like this:

{0,0,0,1} N=4
{0,0,0,2} N=4

And so on. So basically all I need is to get into that ‘N=4’ and select one of those 4 edges which is the X direction and use that as the distance vector to move the rest of the curves, but I cannot seem to get there.

Could you upload your script? Thanks!

Here is the current version which Is further along then the first post. It is close I think. The only thing now that remains is how to take the projected curves and distribute them evenly out so that they don’t intersect.

Contour (9.5 KB)

Update - I’m thinking the easiest way to do this is through ‘orient’. I’ll attach my thinking in a little diagram. Essentially, the projected curves will be all stacked up but are in a list, in order. All I need is to create a bounding box around the curves, and then move the minimum X dimension of each curve, to the maximum X dimension of the previous curve… I’d think I could simply orient from one point to the other, but it seems as though it orients all at once to the old bounding boxes, rather than progressively orienting and re-creating the box.

So in other words, is there any way to have multiple components run in order before running them on the next object in the list? or does it always run through the list before moving to the next component?

I can think of (and have tried) various other methods but so far none have quite worked… I think it gets down to that question about doing multiple things in one operation. Unless any of you have other ideas of course. I’m no expert haha

Contour Model_1.3dm (202.3 KB) Contour (16.0 KB)

Is this what you are after?

Contour (117.7 KB)

You might want to use plugins that offer nesting capability like opennest.

1 Like

Yes, exactly. Thanks!