The shape of a facade is generated via two curves. As the curves are drawn manually in rhino, the script should be able to pull them together to make the physical intersection in the place where they are closest to each other and their “z” component is the same.
Basically, I believe I have the strategy set up the wrong way. Any suggestion on how to model this shape is welcome.

For whatever it’s worth, I’ll offer a few observations on this that may help in coming up with a better strategy for creating these curves. It’s usually better to avoid trouble in the first place than cope with it after the fact.

Asking GH to pull curves together where they nearly intersect is more complex than it’s worth. I would advise defining the intersection points and then using them somehow to create the curves you want. Clearly they are arbitrary and intended to please the eye (art), so I won’t try to address that. Sorry.

Trivial stuff:

There is no need anywhere in this code to reparameterize curves. Doesn’t hurt but doesn’t help either so avoid it unless it’s necessary.

Working so far from the origin (X = 28K, Y = -62K) can be a pain, if for no other reason than just finding the geometry in Grasshopper is difficult unless you bake a curve, point or surface, CTRL-A in Rhino (‘select all’) and ‘Zoom extents’ to show the geometry.

Using negative values for ‘Start/End’ inputs to Extend Curve is dubious to me, even though it appears to work. There has to be a better way to get that bottom curve.

The only code I wrote is in the cyan group (below). It replaces your white group in trying to create the surface(s) between all four curves. It uses PFrames on your bottom curve (the shorter one) to create rectangular surfaces that will intersect all four curves. Using surfaces instead of planes is better because many of the planes will intersect the curves in two places instead of one. Four intersection points for each PFrame are sorted by their Z values and connected with a PLine(PolyLine), which are then lofted. It’s not perfect, especially where the two middle curves don’t actually intersect, but it’s not bad?

Keep at it, it’s an interesting concept and can surely be done “perfectly” with a better model, perhaps entirely in GH instead of relying on Rhino for the two intersecting curves.

@Andres Working far from origin can lead to all sorts of issues. Search the forum for this.
The other reason for the quote:
You can zoom on gh geometry: Select Grasshopper Objects - #5 by wim

That’s really not that far from Origin, and Rhino must be able to deal with that. Probably 2/3 of all commercial ships and 100% of liner cruisers are 2 to 50 times bigger.

(side note, the standard unit of length in ship design (outside US and some other ex-British colonies) is millimeter)

Here is a hand crafted version using your “intersecting” curves as guides to get:

four intersection points

four “peak/valley” points from each curve

the start/end points from each curve

It still show anomalous artifacts in the surface at the intersection points and I’m starting to wonder if the flaw is due to a faulty assumption about the geometry rather than a flaw in how the Loft sections (PolyLines) are created?

Almost as if the surface touching the top curve and the surface touching the bottom curve should meet at a curve through the intersection points, and only then would the intersecting curves be “applied” to cut away the area between them?

Ugh! A quick hack to try that fails so badly I won’t bother to show it. This may be even more of an art project than it first appeared.

It is also documented by McNeel : https://wiki.mcneel.com/rhino/farfromorigin
I know Revit solves this nicely by having two origins, An origin point (the world origin) and a project base point (the models origin that you can define). I believe the project base point is what calculations are based from. It is a nice way to have projects where you really need them (especially because surveyors like to have their things at real world lat/lon coordinates.

One last play for today. This doesn’t match the “spec” implied by the image in the OP as the blue and yellow surfaces have compound curvature. Even so, there might still be anomalous valleys at the intersection points, though much more subtle. Only the white surfaces are “flat” (lofted from two edges).

Some part of the ship is near the origin though, eh? So finding it isn’t a problem, as it is in this case when the geometry is ~ten times further away from the origin than its size overall.

No argue about that, I was merely talking about the magnitude. In huge passenger vessels you may have really curvy tent or swimming pool some 300 K mm X and some 30+K in Z. If you leave it alone in the model you may also find it hard.

Hi Joseph!
First of all, thanks very much for the help. This is not the first time you’re answering my question. Your feedback has been usefull many times already!
Now:

Working so far from the origin (X = 28K, Y = -62K) can be a pain, if for no other reason than just finding the geometry in Grasshopper is difficult unless you bake a curve, point or surface, CTRL-A in Rhino (‘select all’) and ‘Zoom extents’ to show the geometry.

Using negative values for ‘Start/End’ inputs to Extend Curve is dubious to me, even though it appears to work. There has to be a better way to get that bottom curve.

Definition that I posted is a modified and shortened version of a much bigger definition. This one only addresses one facade in the whole complex of other objects and buildings. It includes all sorts of Archicad links and objects. I have striped the definition of any excess and in this case needless components, but obviously some of them escaped my eye.
That’s why project is far from origin and includes Extend Curve method. Negative extend is actually proposed by David here.

I’m aware that the strategy I have proposed is dubious - that’s exactly why I was looking for some other suggestions. The solutions you proposed look great. With some slight changes in the input curves it should work like a charm. Thanks!

Could you explain why can’t you just draw the curves to intersect? I am really curious. It is weird.

The project is in the concept stage. Curves are used to generate various shapes of the facade depending on the positon of the entrances, colliding neighbouring objects, and paths passing near the objects. How these parameters change, we have to adapt the shape of the facade. Once control point of the one curve is moved, it does not intersect with the other one anymore.

Well, both curves could be made to go through a set of points, and these points could be moved instead of the curves’ control points, thus ensuring them intersecting.

This is what I would do anyways. Spend time trying to avoid situations like this instead of spending two-three times more trying to solve it.

Well, both curves could be made to go through a set of points, and these points could be moved instead of the curves’ control points, thus ensuring them intersecting.

If you still want your curves to be created in Rhino and not built in grasshopper using points in rhino and interpolate curves. Have a look at controlling you curves in using EditPointsOn rather than Control points this way you can keep the intersections set and deform around them.

Apparently @ivelin.peychev is not looking at the code I posted? Because that’s exactly what I did in the second model yesterday (301_2019Jul29c.gh). Having curves that intersect doesn’t solve a problem with “anomalous valleys” that appear at those intersection points.

Setting aside for the moment how the two intersecting curves are created, let’s assume they do intersect and focus on what happens after that. This model does that. ‘V1’ (cyan group) is what I posted yesterday, ‘V2’ (blue group) tries a different method using the same curves.
The purple group switches between the two results:

I’m not offended. However, I said the same thing in the first paragraph of my first post:

I’ve noticed a pattern in your forum replies of idle speculation instead of testing your theories before sharing them. I’m more impressed with code that works. Haven’t seen much from you?