Does such a function exist?
Does such a function exist?
A planar curve is described by an implicit equation of the form f ( x , y ) = 0; in R3, a plane is described by three non-collinear points. Any curve that is not collinear describes a plane, as does a line and a point not on that line and so, any planar curve that intersects two planar curves describes a plane in R3. That means you create a construction plane by selecting two desired intersection locations on the existing curves, select a third point in space to orient the plane, and create the new planar curve on that construction plane, while intersecting the former two.
No special function is necessary.
Planar curves in R3.3dm (37.6 KB)
Hi Lagom, thank you for your response.
Let me rephrase my question in terms of an example. Say you are working in one plane. You have two lines: one horizontal, and one inclined at 60 degrees. I am looking for a function that gives me a new line directly between the two lines. In this case, it would be a line inclined at 30 degrees. Would you still work these problems out by hand?
Maybe you can get something usefull for your purpose by creating a Tweencurve from the 2 lines…
TweenCurves is an interesting function that I had never heard of. However, when I tested it on two lines at right angles to one another, it output a curve inclined at 20 degrees, not 45 degrees as expected.
if the two lines (lines being special cases of curves) are on a plane, their points are elements of the same plane, no matter their respective angle, and so any additional line (or curve) and its points in between any point of these two lines will also be elements of that plane.
I think there may be a miscommunication of my question. I’m not really concerned about planes here. For all intents, we can assume Rhino is a fully 2D program. I am more interested in a function which outputs a new curve that somehow averages the distance between two curves.
This can be done in Grasshopper in a function like the one i’m attaching
averaged curve.gh (7.1 KB)
I see, it will only work if both lines are equal length. I assume yours are not.
Mine are not but you can think of another example where this would come in handy. Averaging between two arcs with the same center of radius. Here we could just use Offset, but its an example where the two input curves don’t have the same length.
Ok, it’s all happening on the same plane, so to speak. In this case, there can only be an approximation, see the generic case attached, because the parametric length of curve 1 needs to be mapped to the parametric length of curve 2 and, in case their lengths differ, the sampling density will inevitably result in information loss of the longer curve, particularly where curvature is very high.
Planar curves in R3.3dm (41.3 KB)
This is a related thread: https://discourse.mcneel.com/t/help-needed-with-finding-centre-line-through-2-curves Note that there are various ways to define the average curve, A definition I find useful is the locus of points which are equal distances from the side curves, with distance defined as the shortest distance between the point and the side curves. A discussion of a method to find that curve using Rhino is here Help needed with finding centre line through 2 curves - #73 by davidcockey and a simple Grasshopper version follows.
Edit - cut and paste of posts from thread referenced.
Method for mid-curve which is locus of points which are equal distances from the side curves. This definition is independent of curve parameterization, and of relative position of curve ends.
- Create set of circles which are tangent to both side curves. (Spacing of circles is not critical.)
- Find center point of each circle
- CurveThroughPt through center points. (Chord may give smoother result than Uniform.) Alternative would be InterpCrv.
Attached example was done manually in Rhino. Should be possible to “automate” using Grasshopper. DC_Mid01.3dm (118.5 KB)
David option.png1798x863 110 KB