How would one create a line perpendicular to a tangent point on a curve?

to explain with simple geometry…if I had a regular arc and put a point at the midpoint of the arc(or really any point on the curve), how would I create a line of a given length perpendicular to the arc from that point? Would the logic would translate if applied to a nurbscurve? I am really simply trying to create offset geometry (like a 3d curve that is offset a given distance when in a top view)…if that makes any sense.

Have you tried the Curve.NormalAtParameter?

2014-12-16_095348

I added the Vector.Reverse because Dynamo tends to create the normal at the concave side of the curve.

Same thing applies for NURBS curves:

2014-12-16_095450

1 Like

If you just want to create an offset, why don’t you simply use Curve.Offset?

Hey Andreas, thanks for the reply. I am not using Curve.Offset because the curve is not planer.

Thanks Dimitar, I replicated your code to make sure I understood it…I think my logic is flawed as to how to achieve my goal. I am trying to have a non-planer curve with lines perpendicular to the curve, but maintaining a parallel orientation to the base plane if that makes sense. I’m trying to create a free form ramp maintaining a consistent slope.

Then from the sound of it you might use a system similar to this:

Capture

I think that the “Curve.HorizontalFrameAtParameter” was acquired recently.

 

2 Likes

Thanks again Dimitar…again very helpful. I am using bits of your suggestions to get me going in the right direction. If I get something functional, I am going to post it in hopes of getting critiqued on how I could/should have done it. My latest issue is I need to evaluate points and see if they are coincident. If they aren’t, I want to process them differently than if they are. I thought I could simply compare one point to another but I am getting what seem to be odd results…points that seem the coincident are not evaluating as such. Anyone?

2014-12-17_1526

May have answered my own question. Even though the values look the same to 14 decimal places, I guess they aren’t. I used a Math.Round on each of the Y values and used 14 as the number of digits. The resulting comparison evaluated to “true.”

Floating numbers tend to do that. Maybe you could try the “Geometry.AlmostEqualTo” node?

Thanks for the suggestion…works and greatly simplifies things!

Okay…I had hoped to have something more finished to post, but in order to move forward I think I need someone to look at what I have so far. I am placing model lines in a Revit model (could be lines, arcs, etc.). I take the lines into Dynamo with the goal of creating a ramp of consistent slope. My thought was I would place perpendicular lines along the model lines and then loft them at a z value determined by the slope and the distance from the start point. Then I would create a surface using the lines. The image shows I can create the surface if it is planer, but the problems start when I begin lofting the lines. If the end of one segment and the start of the next result in the lines crossing (see the box in the image), the result is lines on top of one another.

It will probably just confuse things because it is a disaster, but I am posting the dyn and rvt…my apologies in advance.Ramp02.dyn

RampProject.rvt

2014-12-17_1526

Finally managed to get something working…there was (and probably still is) some faulty logic, but it basically does what I want it to do…at least on the sample file I have created. I apologize for my previous post, I realize it was too broad and wasn’t targeted at a specific question…and I apologize again, because I am about to do the same thing… if anyone reviews the current “working” dyn file and sees ways it could be improved, I would greatly appreciate the criticism. There is a little redundancy in the file, as I was using the lofted points to see how they aligned with the translated lines. Hopefully someone will find this useful…but that’s probably stretching its value. None the less, a good first experience for me.

Ramp03.dyn

1 Like

Great work, Nelson!

I didn’t even know horizontal frame existed, that is great!

Hi Nelson

Did you eventually import your geometry to Revit?
I’m wondering if it would be possible to convert such a thing into a floor-family in Revit.

Never mind, I’ve come across the SlabShapeByPoints-node in the Clockwork-package.