Function for creating a planar curve between two other planar curves


#1

Does such a function exist?

Thank you.


#2

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)


#3

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?


(Willem Derks) #4

Hi Evan,

Maybe you can get something usefull for your purpose by creating a Tweencurve from the 2 lines…

http://docs.mcneel.com/rhino/5/help/en-us/commands/tweencurves.htm

-Willem


#5

Hi Willem,
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.


#6

Hej Evan,

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.


#7

Hi Lagom,

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.


(Miled Rizk) #8

Hi,
This can be done in Grasshopper in a function like the one i’m attaching
averaged curve.gh (7.1 KB)


(Willem Derks) #9

I see, it will only work if both lines are equal length. I assume yours are not.


#10

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.


#11

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)


(David Cockey) #12

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 and a simple Grasshopper version follows.

Edit - cut and paste of posts from thread referenced.

davidcockey

9d

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)

DC_Mid01
DC_Mid01.JPG874x677 46.9 KB

2 LikesReply

Akche001

9d

1

here you go! Experimental drawing_David_option.3dm (111.5 KB)
David_option.gh1 (10.6 KB)

[David%20option
David option.png1798x863 110 KB

](https://discourse-cdn-sjc1.com/mcneel/uploads/default/original/3X/7/c/7cacf3dbf3a55885ad7eda87792d68028d3917bf.png)