Jump to content
Sign in to follow this  
Krion

(Animated) dashed line?

Recommended Posts

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

Share this post


Link to post
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 this post


Link to post
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.

image.png.55308df2fd1936ebd3e0ef7050603926.png

dashed_curves.hiplc

Edited by konstantin magnus
Hit play!
  • Thanks 1

Share this post


Link to post
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 this post


Link to post
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'.

dashed_line.hip

Share this post


Link to post
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
  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×