# Curves Primer

From world-building to object creation, curves are incredibly useful for quickly building out shapes with repetitive patterns (roads, fences, bridges, spider webs, etc...), and in GraphN, the **Curves** data type is there to give you everything you need to create stunning curve tools.

As with geometry, GraphN can create, then keep track and update the curves you feed it; but you cannot update an existing curve; The only way to do that is by creating a duplicate of the existing curve with the node **Output Curves**. More on that later in this page.

## Input & Output Curves nodes

Like geometry nodes, curves also come with **Input Curves** and **Output Curves** nodes. Input Curves have a **Resolution** integer parameter. The higher its value, the more accurately GraphN will recreate your input curves:

In the GIF above, we're selecting the node **Input Curves**, then adjusting its resolution parameter. The result speaks for itself: this parameter alone can be incredibly powerful depending on how you use it.

The Curves data type isn't there to handle one curve per output; it can handle as many curves as you give it, with no performance downtime:

To convert a GraphN curve into a Maya curve or Unreal Engine spline, you simply need the node **Output Curves**. What's more, you can also convert curves into actual geometry with the node **Curves to Mesh**. This node takes your curves as an input, and by default, it'll create tubes from all the curves.

You can control the density of these tubes, their radius, and other geometry parameters. The node even accepts a custom profile for your mesh.

## Curve Features

We've created a wide range of curve editing features to help you get the most out of them. For starters, you have the node **Slice Curves** which allows you to cut your curve from its start and end points, giving you a trimmed-down version with ease:

Another really useful node is the **Parallel Curves** node, which creates two curves parallel to your input curves. If you wanted to create lights along a road, this node would fit the job just right: you give it the width of your road, and it places the lights right along both sides of the road.

## Curve Resampling

One common modification we often do on curves is modifying their point count and deforming them. As a first example, here's what the node **Smooth Curves** do to your curve:

## Curves from points

Another very practical way of creating curves is with points; the idea is simple: you have a vector array of points, like say multiple object positions, and with the node **Create Curves**, you can feed it those positions, and it'll create a curve.
But the node Create Curves is so much more powerful: you can give it two point sets, and it'll bind them to create a really great cable set like this:

For a more step-by-step approach:

- Create two planes in your DCC.
- Add them one by one into GraphN, so as to have two nodes with one plane each.
- Create two Scatter Points nodes, and give their Surface input each plane.
- Add a Create Curves node, and set its "Create From" dropdown to Sets.
- Pass the positions of each scatter points node to this Create Curves node.
- Connect the output of Create Curves to a Curves to Meshes node.
- Finally, create an Output Mesh node, and connect it to the Root node.

Add to those cables some more divisions and some gravity with the node **Curves Gravity**, and you've got yourself some great-looking hanging cables!

Such setups are possible thanks to the flexibility of the node **Create Curves**:

As you can see, there are multiple modes: You can simply pass it one vector array of positions, or one vector array of positions, and another of normal, or two vector array of positions. In the hanging cables example shown above, we're giving it the **Sets** option, which basically takes all the points we've scattered on the first and second plane, and merges them.

## Curve masking

Curves are often used as a mask to carve out paths in world-building. The idea is to have a set of scatter points that represent something like foliage on a terrain, and another set of points that represent the curves' vertices. With those two point sets, what you can do next is find all the foliage points that are close to the curve points, and remove them.

The node **Points Proximity** does exactly that: You give it two point sets A and B, and it'll find all the points in A that are close to the points in B:

You can also check the reverse checkbox on the node to make it find the farthest points instead of the closest points:

## Closing

One of our biggest priorities later this year is introducing more deformer nodes, which would allow you to really adjust the shape of your input curves to great lengths, making it possible to create all kinds of tools, from hair to cables to feathers, etc...

At their core, GraphN's curve nodes have been built to be as simple to work with as possible, and we'll keep publishing more and more sample projects to give you some ideas of all their potential.