# (Animated) dashed line?

## Recommended Posts

Posted (edited)

Hi!

I was looking for ways to make a dashed line (between two objects).

This video didn't exist anymore.

Do you guys know any tutorial or do you have any suggestions?

Thank you.

Edited by DévinOdforce

##### Share on other sites

Create a line, resample it and delete every second segment?

##### Share on other sites
Posted (edited)
On 3/14/2019 at 5:12 PM, Skybar said:

Create a line, resample it and delete every second segment?

How would you do that? I can't make a Group Range for edges.

How would you delete points with leaving a gap? Or maybe I can do this directly in the Delete SOP?

Edited by DévinOdforce

##### Share on other sites

Hi,

using the carve node combined with a foreach is another option.

dotted_line.hipnc

• 1

##### Share on other sites
Posted (edited)

Let a sine wave run across your curves, set the dash length with frequency, animate by adding time and define the gap size by comparing the value with a custom threshold.

```float u = vertexprimindex(0, @vtxnum) / float(primvertexcount(0, @primnum));
float u_length = u * primintrinsic(0, 'measuredperimeter', @primnum);
float u_anim = (u_length + @Time * chf('speed'));

int waves = sin(u_anim * M_PI * chf('frequency')) < chf('gaps');
v@Cd = hsvtorgb( set(u, 1.0, 1.0) ) * waves;```

If you want your dashed line to be static just replace u_anim inside the sin() function by u_length.

Edited by konstantin magnus
Hit play!
• 1

##### Share on other sites
Posted (edited)

Great stuff! Reminds me i should pick up learning VEX again..

11 hours ago, konstantin magnus said:

Let a sine wave run across your curves

Is it possible to change this hip file or technique to be able to handle a (dashed) polywire afterwards?

Edited by DévinOdforce

##### Share on other sites

add sop, check 'delete geometry but keep points' to get back to just points, then on the polygons tab chose 'by group', add mode 'groups of N points'.

##### Share on other sites
Posted (edited)
On 18.3.2019 at 10:19 AM, DévinOdforce said:

Is it possible to change this hip file or technique to be able to handle a (dashed) polywire afterwards?

Yes, you could take the convertline SOP, promote the wave attribute to primitives and delete by this attribute.

@DévinOdforce: I attached an example.

dashed_curves_prims.hiplc

Edited by konstantin magnus
• 2

## Create an account

Register a new account