Jump to content

(Animated) dashed line?


Recommended Posts

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
Link to comment
Share on other sites

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!
  • Like 2
  • Thanks 2
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 3
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...