Modify line keeping the same direction

rhino5

#1

OK, so I have a line between two points (red line pictured below) and want to modify it into the blue line, which has a short stump at the bottom in the exact same direction as the Red line (direction = between the points as seen in the XY plane).

I want to code this starting from the red line, or actually, from the two points which are given. I already have zillions of these (red) lines and BoundingBoxes drawn using this this code :

  ln.From = c_pt  '/ upper pt
  ln.To = e_pt    '/  lower pt
  BBoxAsBrep = ln.BoundingBox().ToBrep()

After these code lines I’d like to modify the red line into the shape of the blue line while staying inside the BoundingBox. The length of the short stump doesn’t matter (its a variable input to the GH component).

I need only one set of objects at the time, about fifty thousand times, so I presume that reusing the same line stumps will perform better than creating new lines fifty thousand times(?).

Simplest code to get to the red line?

// Rolf


(Luis Fraguada) #2

I am not sure I’m grasping the exact thing you want to do, but I’ve attached a definition anyways!
ghRIL.gh (13.0 KB)


#3

E[quote=“fraguada, post:2, topic:45374”]
I’ve attached a definition
[/quote]

  • Exactly so!

I need this construct to flutter around a mesh, from vertice to vertice, from the inside. I hope to be able to show the result one day. :slight_smile:

Many many thanks!

// Rolf