I want to add a slider to adjust the length of the polyline connections

I am inputting coordinates to create a polyline curve. I want to use ghpython to adjust the length of the curve connections as a percentage. What code should I write for this?


otamesi_1.gh (15.1 KB)

Why Python instead of PLine :question:

Are you applying the same percentage to all polyline segments or setting them separately?

Changing the length of polyline segments requires moving all but the first point, so a loop is needed. This uses Anemone.


otamesi_2024Jan11a.gh (24.7 KB)

P.S. The same thing can be achieved using Scale, on the PLine or on the points, using the start point as ‘C’ (Center) input.


otamesi_2024Jan11b.gh (28.6 KB)

P.P.S. Here is what happens using a Graph Mapper to apply different percentage length values to each segment of the polyline. Can’t do this with Scale. :wink:


otamesi_2024Jan11c.gh (30.5 KB)

I guess I did not communicate it well.
I want to create a G-code simulation.
So I want to create a gh that uses a slider to connect the coordinate points from the top of the list with a polyline.

I don’t know what that means? An MD Slider? (two-dimensional)

I want to connect the coordinates in the list with a polyline curve from the top row.
You want to add a slider with the same number of rows as the list and have the curve connect to an arbitrary location.

For example, the list contains 10 rows of coordinates.
I want to connect the coordinates up to the 5th row with a polyline curve, so I want to use a slider with the same number of rows as the list to do that.


Is it possible to write the process from this list item in ghpython?

O I get what you are saying. First you are just trying to do a dot by dot connection essentially. And you want to simulate that with a slider. Thus “Growing” the polyline “Path”

1 Like

I see no “top row” when the whole set of points is skewed in top view, as the images I posted show.

The only thing I want is clarity, which I’m not getting. Oh well.

yes, That’s true

Thanks for taking the time to answer my questions. I appreciate it.
I’ll give it some more thought.

I’d like to be able to do something similar with one of my lifelong projects.

Hence,

1 Like

Ok Just a thought if I am understanding right.
Adjust the “Slider” to do your percentage.
Path.gh (9.2 KB)


Screenshot 2024-01-12 083634