How to align Loft curves

I made this Closed Brep


using Loft surfaces, but only after doing some rather strange and unusual things to get the outside surface to work. The problem I had to work around was how to arrange the curves that create the outer Loft surface. So I made a simple test file to demo the problem:

What I needed was a set of vertical contour curves made from the input Loft surface. So I used BBX to create them - New Curves. This image shows those curves:

Those look perfect - except they don’t work as Loft control curves because they are out of order. When Lofted they produce this - Bad1:

Obviously the problem has to do with the order of the Loft input curves.

I did a fair number of online searches but found nothing that applied to this situation. Most had to do with curve alignment and/or curve direction which doesn’t seem to be an issue here. I finally hit on one approach that helped quite a bit - but not quite enough:


This is Bad2.

I expected the BBX component to generate the vertical contour curves in a nice order, but it doesn’t seem to do this. Maybe a re-ordering process exists in some obscure GH object or GH add-on that I don’t have, but if so which one?

could you please post the portion of gh file where the sorting problem arises?
the screenshot is ok, but it does not contain data to check .____.

for instance, looking at the screenshot without GH file, this part would produce 30x overlapped circular planar surfaces radius 1 centered on XY :upside_down_face: which I believe is not the case in your gh file :slight_smile:


I guess your section-circle is created on XZ or YZ plane (can’t say, omitted in your screenshot) and that the circle is big enough to contain your whole geometry

this means that when you are sectioning your geometry, for each circular surface you are getting 2 section curves instead of one (the right one but also the left one)

as stuff out of BBX is branched by section circle, this means that you have first curve on one side, second curve on the opposite, third on one side, fourth on the opposite and so on… if you hover your mouse on the Flattened C Output of BBX you should be surprised to see that you are getting double the curves you expected :smiley: for 30 “sectioning circles” you get 60 curves

instead of using a circle, you can use a Rectangular Surface that covers just half of your geometry, like this:

in alternative, try (might work, who knows, I’m just photoshopping pixels :slight_smile: ) a List item here, on the UNflattened output of BBx:

1 Like

Is there a reason you can’t post code?

Sorry inno - I somehow neglected to post my GH file. Here it is:

LoftCurves.gh (78.6 KB)

To answer your question, the BBX produces 60 curves. And yes, the circle is on the YZ plane.

I see your point about the potential for duplicate curves. I’ll try your rectangle idea and see how that works.

Well, you were 100% correct. By using a rectangle as you suggested and changing the count for polar from 30 t0 60 the results are exactly what I need.

Truth is I think I’ve made this same mistake before - but just forgot about it. I won’t do that again. :grinning:

1 Like

You could avoid the whole problem by arraying a half circle over a full 360 degrees if you must use a geometrical intersection of BREPS:

I know you already have a working solution. It’s just that I had started doing this an might aswell post.

Your original code is not broken because of duplicate curves, BTW.

:+1: this thing also got me about a dozen times in the last years :slight_smile:

I would much rather contour with planes than intersect BREPs. This has the advantage of not having to know the semi circle or rectangle size of the intersecting shape. Naturally, this leads original problem of the unwanted intersection curves on the opposite side of the BREP. Here is a messy solution to that, but is flawed for its assumption there will only ever be 2 intersection curves.


LoftCurves volker2.gh (245.0 KB)

Working through this I discovered two things: one, is that Contours is bugged? It duplicates path numbers instead of inserting 0s. Second, is that Tree Branch does not work according to the regular input matching paradigm. Given a tree of paths, it will flatten them before outputting.

That’s precisely what I did - but using the Rectangle with internalized params is simpler on the GH Canvas.

Good to know I’m not the only one :grinning:

Many thanks for that - I didn’t know there was a way to make surface contour curves vertical. Now I do!

This is a much more reliable version using planes. It culls all curves that occur on the positive side of the intersection plane. I struggled for a while with the transformation information. I don’t know how to use it. In the end I converted to text and used Member Index. Any genious burgers out there can tell me how that would have been done correctly.


LoftCurves volker3.gh (318.2 KB)

trying to answer the initial question, not caring about how the curves where created:

(1) some of the curves are upwards, some are downwards.
Therefore some of the curves have to get Reversed / Flipped.

(2) And to make sure they are sorted nice and circular atan2 is a great help for the sorting.

LoftCurves_02_tp.gh (84.8 KB)

definition shows a vanilla gh solution
and a c# script - that I would prefer.

2 Likes

I do have to ask, why you don’t just create nurbs curves from the control points of your horizontal section profiles. If you loft throught the horizontal section and create curves with degree 3, you should get the same result:


LoftCurves volker4.gh (388.7 KB)

Oh wow, no. You really don’t.

Yeah, I noticed that too. That comes from the Brep | Brep intersection.

Those less familiar with the Expression editor would probably use the Point Polar component.

Oh wow indeed! I’ve been looking at your method for a while now - and I still don’t see how it works. I’ve used all those GH components before, and I thought I knew what they did. But apparently not. Hopefully I will real soon now.

Sigh!. I saw your C# code. Regrettably my coding experience has been with Fortran and IBM 360/370 machine language. But I do like your GH solution.

I gotta ask: Are you just trying to get an offsetted inner surface from the outer surface of your form, Birk?

No. I’ve got a method for generating a smooth inner surface that I’ve been using for a while. My ultimate goal is to turn the vertical control curves into wavy ones so the Loft ends up with bumps having both vertical and horizontal offsets.