Dashed lines with a "y-axis" problem

Hello,

I drew dashed lines with the chopto SOP and line MAT but it seems like the dashed line doesn’t apply to an y-axis of square and sawtooth-shaped lines. I am wondering if there’s a way to solve this issue. FYI, please press the number 1 key to switch between different line shapes in the file. Thank you so much.

question.toe (10.0 KB)

Hey,

the issue is that with the square wave form you don’t get any points when the y value switches between its extremes:

An x/y waveform might look something like this:

cheers
Markus

Thank you @snaut this is exactly what I was looking for. But I am wondering how you created those tx and ty patterns from the pattern chop. Can you please show me that in a little bit more detail? I am a completely noob.

Wait a minute. If I am not mistaken, I think your code is working in an opposite way to mine because the “resample1” is heading to the “sopto1”. That’s why I was confused first :slight_smile: Did you draw a regular pulse wave (without dots) and activate the point display option in SOP?

Hey @uforange ,

sorry - I was lazy last night and didn’t give you a full solution :slight_smile:
The full solution is a bit more complex than for the other waveforms.

I hope the included component makes sense for what you are trying to do. Mainly I’m using the Speed CHOP with Timeslicing turned off to generate the necessary tx and ty values.
squareWithCHOPs.tox (710 Bytes)

There is another approach you could take that might be simpler. Instead of writing point colors to create the dashed line, make use of the edge length texture mode and apply a texture to the geometry for a similar effect.

edgeLengthTexture.tox (1022 Bytes)

Hope this helps
Best
Markus

No problem. It really helps. Thanks a lot @snaut

I was just able to implement it (not perfect) based on your first hint in your first answer. But it was a bit difficult to sync the length after the resample SOP. To be more specific, I set up the length as 1000 in the pattern CHOP but it seems like the resample SOP shortens the length to 200 (please see the sopto3). I manually did it (in the result2) but I have no idea why the length is not perfectly synced in the merge CHOP. Can you please take a look at my toe file to see how I can resolve this issue by any chance?
question2.toe (9.5 KB)

BTW, your second approach with the “constant1 MAT” is what I tried first but I was not able to control the line width in Mac, so I gave up using that way. But please correct me if I am wrong.

Also another approach :slight_smile:

Hey @uforange,

the resample uses Maximum Segment Length so the resulting number of points will be depending on the length and height of the geometry. For better control over number of samples you should use the squareWithCHOPs example i posted.

You are correct with loosing control over line width with the texture approach. You can get some control - but not as nicely - by enabling wireframe on the Common Page of the Constant MAT.

cheers
Markus

This really helps @snaut

Sorry for asking too many things, but I have one more quick question about your “squareWithCHOPs”.

  1. If I want to change the frequency of this pulse wave (the number of cycles), how do I do that?
  2. How do I create sawtooth wave(ramp) with your approach (in a combination of two speed CHOP)?

Thank you so much.

Hey @uforange ,

I had to make a little adjustment concerning the pattern CHOP which creates the ty - as initially setup it only supported full cycles - the attached file now has support for any cycle number. To change the frequency, just adjust the Number of Cycles of the pattern1 CHOP. the parameter is references in pattern5 which creates the ty channel basically doubling the number of cycles as that is required.

A sawtooth is very similar and even a bit simpler: Both, tx and ty, will be driven by a square wave. Where tx has a square wave that oscillates between 0 and 1 making the tx always count up, the square wave for ty has to go up and down - so here it oscillates between -1 and 1.

squareWithCHOPs.tox (1.3 KB)

Best
Markus

What is your setting for two pattern CHOPs? Thank you @alphamoonbase

Thank you. I will carefully take a look at it.