Jump to content

Create Curve Coordinates from a Line


Recommended Posts

Hi,

I wonder if it's possible to initialize a curve from a line and be able to modify the curve from the Curve node.

I'll explain what I'm doing right now. Of course, it doesn't work, but I'm sure it will help you to understand what is my goal.

Fist, I have a Null node called curve_setup. This node contains parameters that controls my line. So, the length of the line and the number of points on the line.

Next, I have an Attribute Wrangler node. This node creates the line using the parameters in the curve_setup.

At this point, I did some research on the Curve node and the documentation says that I can "use a space-separated list of coordinates in this field to specify points". Then, there's a list of different format to specify different points. There's one format that got my attention. It's the Pn format which "copy the coordinates of point number n in the input geometry".

curve_a.JPG.21fc6bc3d096e3f7cbd99bf14a019065.JPG

So, I said to myself : "Is there a way to copy the coordinates of all the points of my previously created line in the coordinates of my curve ?". Then I did more research. I learned that the Coordinates parameter is a string, so I have to use expression functions. That said, I learned that there is a expression function called pointlist  that returns a "space-separated list of point numbers".

curve_b.JPG.43498b783bf85d27be3e268667e898a0.JPG

Since this function returns something like this : "0 1 2 3 4 5 6 7 8 9", I though that I could format the string and add a "P" in front of every number in the list. Since Pn "copy the coordinates of point number n in the input geometry", It would create a curve based on the line I created earlier and since I can see those points from the Curve node, I would be able to modify those points using the Curve node handle.

Now, I just need to learn how to format the string within the Coordinates parameter of the Curve node.

Edited by anthonyblanchettepotvin
Forgot the last line.
Link to comment
Share on other sites

So, here's a quick update.

I managed to format the string within my Attribute Wrangle node. I created a detail attribute called coordinates that I can read from within the Coordinates parameter of the Curve node using an expression function called details which "returns the string value of a detail attribute". At this point, I can see my curve and I can change its length and number of points dynamically, which is awesome !

But, when I select the Curve node and try to edit the points, the only this I can do is insert a point. As soon as I insert a point, the new point appears in the Coordinates parameter and my expression function disappear to show its result. That said, I can't change the length and the number of points anymore.

Before :

curve_c.JPG.8f6cda52906f1b81d51c789233502856.JPG

After :

curve_d.JPG.472149199eeadede6454717dce150d7a.JPG

At this point, I really don't know what to do. If something could help me with this issue, it would be awesome !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...