Orthogonally Connect Nearby Curves (Wish R6)

Very often when I construct curve networks for a surface I need to reconnect curves that slided apart. But it seem to exist no convenient command for connecting them (moving the ends orthogonally (or perpendicular from & to). A single command should exist for doing this in one shot.

My typical workflow for doing this manually (a thousand times a day) :

1. Draw a Curve (orthogonally) from the Curve to be moved towards the target Curve
2. Connect the two curves with a curve (from Perpendicular to Perpendicular)
3. Move the source curve using `SoftEditCrv` (checking the curve length first), entire length
4. Clean up the curve with `FitCrv` (usually 0.1 mm)

Fig. Typical workflow :

The command `SoftEditCrv` should have a default option to provide the length of the selected curve (now that takes an extra manual measurement + typing in the length (so it’s actually 5 steps in the above list).

Edit: As an extra option (not default though) the source curve could be cut at a point derived from the calculated intersection (from the arrow tip back to the source curve orthogonally to the right).

I plan to start learn doing some scripting, but not now because I’m still busy learning Rhino basics…

Anyone?

// Rolf

Hi Rolf - can you post a file with the input curves and the desired result?

thanks.

-Pascal

OK, I’ll make an example file.

Edit: An example model (pictured) (updated) :

Model, updated (with Ortho - Ortho (with surface intersect) :

Orthogonally Connect Curves.3dm (107.8 KB)

The modification would typically be moving or “bending” the source curve. In this case I “bent” them both using SoftEditCrv.

// Rolf

Hi Rolf - how are you getting the lines at “1” & “2” ?

-Pascal

1. Draw Line (End) freehand ortho to the left (long enough to pass over the target curve).

2. Then Line (from Perp to Perp) to find the “shortest path” between the two.

// Rolf

So if that line is more or less arbitrary, why not `Move` or `SetPt` the end control point of the curve and hit the target curve with ‘Perp’ osnap?

-Pascal

Because I (often) want to bend (even out) the source curve, not only “lean” it towards the target.

Or did I miss something with the `SetPt` command? (I often use that one to, but not for this)

Most often I want to move orthogonally (and then “connect” (2) with Perp). Can really the same thing be achieved with `SetPt`?

// Rolf

Hi Rolf - the problem I’m having, and it may be that I am just being dense again, but I do not yet see what the relationship between the input and the output is other than an arbitrary one. I don’t see what rules a command would follow, in other words.

-Pascal

The combination Orthogonal-Perpendicular is “deterministic”, and what I want. That pattern ends up in a predictable point, not arbitrary. So the “why” isn’t part of the example, only how.

So. the example only demonstrate `how` I moved the curve in that order/combination, not why.

// Rolf

I guess I do not understand your ‘ortho’

What is Line 1’ ortho with or to? I see line 2 is at right angles to 1 but how do you get 1?

Ortho in Front view only?

-Pascal

Ops, what happened there?..

Sorry, my bad. You’re right, only the first line (in the back) ir correctly drawn. I’ll repost so that no one else are mislead. Sorry.

// Rolf

OK, so the target point is the closest point on the target curve from an ortho line through the current curve end point… right?

-Pascal

Yes, in most cases yes (or more specifically, Ortho and then Perp/Perp between the helper line and the target line, as illustrated)

Often I also want to go Ortho - Ortho in order to hit the end point on the target curve. That makes two variants :

1. Source curve endpoint --> Ortho - Perp/Perp --> to target

2. Source curve endpoint --> Ortho - Ortho --> target

§2 is more difficult to hit though, so I tend to extrude the first Ortho curve down or up to the target curve, and then make a cut (in the target curve) to find the intersection point. BTW, why is the no such command, leaving a `Point` object behind where a curve intersects a surface?

Or is there another quicker way of finding the intersection for curve through surface?

// Rolf

Hi Rolf - `Intersect` should leave a point at the intersection of a curve and a surface.
I don’t see a graceful way of achieving what you want in Rhino as is… Back to the wish list…

-Pascal

Woa… that’s how smart I am - I didn’t even try that (although doing just that often with surface/surface intersections).

Thank you very much, my workflow advanced significantly already with that remark.

// Rolf

Addition for the wish list: Since it takes multiple commands in a sequence before ending up with the final connection, there should actually be at least a third variant, namely direct Perp-Perp between the two curves

(Of course such a Line command option already exist, but not in sequence with the other commands that should do the rest of the magic to connect at that point, plus cleaning up of any helpers, of course)

1. Source curve endpoint --> Perp/Perp --> to target
2. Source curve endpoint --> Ortho - Perp/Perp --> to target
3. Source curve endpoint --> Ortho - Ortho --> target (using surface for intersection)

// Rolf

Can you point me to some existing VBScripts that contains some of the concepts involved here?

Examples could include option parameters, prompting for new keyboard values / mouse clicks / selected objects (curves/surfaces) / positions / lock screen / confirm/cancel command etc, then I can take a look at hacking my own command that does what I want. Perhaps there are some tutorials for getting started with script? (I have some experience in VBA and VBScript in addition to compiled languages).

// Rolf

Hi Rolf,
You can start with these ones. I’m including a link to the Python one because that would seem to be the way forward to ensure cross-platform compatibility…