Array along 2 curves

How can we do this in Rhino:
I have 1 object to array along 2 curves.
The black curves shall be the rails.
The red group is the object to array.
image

The picture is done with _ArrayCrv with the upper black curve.
The rotation of the red object is wanted.

But with _ArrayCrv the object misses the lower rail.
Is there a convenient solution for this task?

See attached 3dm.
Along Curves.3dm (41.5 KB)

Only way I know how to do this is Sweep2 3 times - once for the circle, once for the outer “R” profile and once for the inner. Then two PlanarSrf endcaps and join…

S2x3.3dm (391.0 KB)

It would be very nice if you could create one end planar surface and Sweep 1 or 2 the surface…

This sort of thing can also be scripted…

1 Like

Thanks Mitch, but that’s not it.
The geometry is an example only, no need to model something.
Also the object has to be transformed in it’s completeness.
It has to be arrayed along the 2 curves several (100’s) times and always touch the 2 curves.
It would be even better if a 3rd curve is in the game.

Ah, OK, sorry I completely misunderstood the question. ArrayAlongCrv with 2 (or 3) guide curves. Sounds like something Grasshopper can do though.

1 Like

Hi Charles - here’s a thought… I don’t know if it is quite there.

  1. Move the end and tangent point of the lower curve to a point on the circle ‘perp’

Make a sweep2 from the curves and parts of the circles (SubCrv works nicely)

Extract the center isocurve
image

Set CPlane > Surface to the end of that curve:
image

ArrayCrvOnSrf > Divide

Close maybe…

-Pascal

1 Like

Thanks Pascal
I don’t get the handling for ArrayCrvOnSrf.
In here no Divide option comes up.
Can explain please?
Along Curves 2.3dm (42.8 KB)

In the options of the tool you can array with a distance or with a number of objects.
I m not in front of my computer I can’t sent a screenshot sorry .
I hope it can help.

Sylvain

No, I can’t, this option are simply not there in here.

Hi Charles - here is how it looks here - this is V7 but 6 is the same.

You do not see that?

-Pascal

3 Likes

Thanks Pascal

I must have done something wrong.
The options are all there.
And it works exactly as expected.
Very good!

Array 2 Curves.3dm (104.8 KB)

I need to do the same thing. With our 5-Axis CNC we can “swarf” (where the bit pretty much Sweeps 2). This works great but if the two controlling curves are different lengths the program (bSolid for Biesse) follows the two curves in a funny way: In essence it assigned a 100% length value to each curve and follows the two curves at the same percentage at all times. This can result in the bit dragging and changing the angle of the surface we are working to create.

The solution is to provide “Direct X” lines which tells the bit where it should be, and over rides the dumb 100% length assignment bSolid imposes on the curves.

To do this in rhino I pretty much need to Array 2 as the original poster asked about. The solution provided (thank you @pascal) works in the instance provided because there is no twist. In my case the 2 rails are needed to define the twist.

I’ve attached a file and here are a couple screenshots of my results trying to replicate the solution already in this post. The curve get arrayed with a twist, but reorients (seemingly based on the world CPlane) before starting:

Hi Joseph - I am not grokking 100% here yet - what is the initial input - the one profile curve and the single rail?

image

If so, where is the twist information coming from?

Just in case my guess turns out to be right…

Array 2 CurvesMaybe.3dm (170.4 KB)

-Pascal

When I tried the ArrayCrvOnSrf it was the two you are showing and the surface that curve is on. I assumed the twist info was coming from the surface.

Ah, OK, I did guess wrong at what you need.

-Pascal

@pascal I see that you remade the surface but I would be looking for arrayed curves at a definable qty or distance. I may be being dumb, does your surface give me that?

Hi Joseph - no, I was just being dumb. However it seems like an array of planes along the curve + interssection with the surface may get you what you need correct?
ArrayCrvOnSrf is going to be problematic because the lengths of the two edges are different so it will not align cleanly at each end of the top line of your shape curve.
-Pascal

Yes, that would work well. Here is how I would brute force it:

  1. ArrayCrv with a point, using the shorter of two curves.
  2. Then drawing a curve from the points to the perpendicular point on the longer curve.

This will keep my bit perpendicular for the most amount of time. This process is doable but slow. I am realizing that I don’t actually want an “Array 2” because it would recreate the bSolid problem: skewing the bit, because it is dividing 2 different length lines into two sets of different lengths.

In the images the green lines are perp from the shorter line (right) and the points on the left line show were they would land if I got my way and there was an Array 2

Looks like I am headed into Grassopper.

Hi Joseph - I made a very hacky script - is this the correct result?

Array 2 CurvesMaybe.3dm (136.5 KB)

This is very clunky to use but I rtihnk it does it - note: The CPlane X is mapped to the surface normal currently, which is weird but works for now. Note the CPlane and curve orientation in the file I’ll attach It can all get friendlier if it basically does the right thing.

Array 2 CurvesTest.3dm (130.4 KB)
Orient2CrvAndSrf.py (2.6 KB)

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

-Pascal

Thank you for your work Pascal. Sadly that doesn’t work either. You did array the two curves and the solution is wonderful. In essence though it recreates the problem. It treats each line as a 100% length that is divided equally to itself. So if you enter 11 as the number of items you want arrayed you get 10 equal divisions of Line A and 10 equal divisions of Line B. Div Line A length does not equal Div Line B length. When the closed polycurve profile is forced between these it begins to skew the profile.

That is great, but what I need are lines that are perpendicular between each rail. A closed polycurve is not a requirement. Below is an image of your solution (in red) with green lines showing the perpendicular line between the two rails (so the skewing is evident).

Below is the more tedious solution. Grab one rail. ArrayCrv with a point. Draw a new polycurve connecting to each rail perpendicularly. You end up with a open poly curve (opening circled in red) but lines that bSolid can use to keep the bit perpendicular.

I working on a grasshopper definition that takes to curves and draws a set number of perpendicular curves between them now. In the mean time doing it the slow, click click click route works fine. I appreciate your help and when I have a good Gh def I will share it here.

That should be possible in a script or GH using ClosestPoint to the curves, in turn, for each segment.
Just in case it helps, here is a thing that attempts to make lines as perp as possible between pairs of curves.

LinesPerpToCrvs.py (2.1 KB)

-Pascal