Create a curve in the middle of two others (no parallel)

Hello all,

I have two rails and I want to create the central axe in the middle. The rails are not parallel and they don’t have the same length. Do you have any suggestion?

Thank you in advance !

Something like this maybe? I expect there are better ways :slight_smile:

Hope that helps,

Mark

1 Like

Thank you for your answer!
Unfortunately I get the error below in the surface.ByLoft node.
Unable to loft! LOFT_SDK_OURPUT_BODY_SELF_INTERSECTS–The output loft body self-intersects.

Also after you can get the middle line in Revit ?

Perhaps you can split your curves where they intersect and make a series of surfaces? :slight_smile:

Try to work around it this way:

3 Likes

In the node Curve.pointAtparameter, you connect both curves? thank you

Yes. The contents of the watch node were intended to indicate this, but admittedly it’s not clear. I was working in a sandbox context though so it was hard to demonstrate the use.

Thank you for your answer!

Apparently I get the error that cannot make a polycurve from an empty list.

The range in the code block should be 0..1..#resolution. This starts at zero, ends at 1, and has resolution values overall between the two. With a value of 100, that would be something like [0,0.0101, 0.0202, 0.0303, ..., 0.9797, 0.9898, 1].

Currently you have 0..1..resolution. That starts at 0, goes to 1, and steps by the resolution value. Since you have a value of 100, that starts at zero, adds 100, and is over 1 so that’s discarded and the net result is [0].

2 Likes

Yes right, now it works but it doesn’t seem to be in the middle of my axes (check grey line)

P.S. The lines don’t have the same length. It should be because of this?

Increase the resolution to say, 1000 and see if that fixes things. If not, post the geometry and desired geometry in a file which makes it clear what you’re after, and I’ll try to wrap my head around it later.

Hello, I tried with 1000 and it’s the same

Ok - can you post the geometry so I can review the issue?

Hello,

Thank you for your time so far!
Below you will find a test file with the axes and the script.

Dynamo.dyn (53.6 KB)
test_axes.dwg (60.2 KB)

Just had a look at this, and the issue is with how out of whack the geometry was. Curves aren’t planar, so lofting the polycurves to a surface is going to give some weird results when it works.

The point offset issue is because the curves are VERY different in length, and bend back on themselves causing the points to ‘cross the streams’ if you don’t trim them first, and so we need to build the range from ‘the equivalent start point’ to ‘the equivalent end point’ with the desired resolution. The attached graph does this as an example in the context of Dynamo for Civil 3d.

Note that this doesn’t use vectors as before so it’ll be a bit slower, but working with Civil 3D 2021it does 1000 samples from the start parameter to the end parameter without issue.

By the looks of it you may be trying to identify the mid point of a path along a mesh topography; if so I recommend flattening things to the XY plane first, and eventually projecting the curve onto the mesh; however the best option would be to define alignments in Civil 3d rather than fighting meshes.

Identify the spacing between the curves.dyn (52.0 KB)

1 Like