Line styles

jersmi's picture

Once again this is an Illustrator reference -- wishing I could use the GL Line Structure and overlay graphic line "styles" like Illustrator brushes for strokes. First thought was dashed lines with rounded caps, then calligraphic, etc. I know stippling can approach the dashed line, but how could one have rounded caps? I was thinking about some kind of threshold / smoothstep CI filter, or blur / sharpen, but that seems like a hack job.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

usefuldesign.au's picture
Re: Line styles

For end-caps and round vertexes a GL-Point of the appropriate size at every end-point/vertex might do it (both line and points in over blending mode and monotone only :/)

NICircle patch also.

As for brushes, the calligraphy ones are just an image stretched so that sounds doable. I've been considering an almost identical question. I wanted to take a standard plant stem image (main straight stem with one small leaf stem coming off it at 120º) and be able to radially transform — so a square image becomes a curved segment of a donut shape. Then join the curved segments this way and that to make a creeper the draws all over the screen. Add some leaf images coming off the stems.

I'd like to do it in CIFilter but I don't know the transformation equations. I guess it's a variation on a kind of non-linear scaling/shearing, like when you grab a corner of a bounding-box in AI and hold down the Cmd-Opt keys to make it go into perspective scaling mode.

Then I thought: why not just pre-draw a few stretched versions (say ten stems of various amounts of curve and two leaves) and then just choose from the set of tiles. Each tile can go in a Kineme Structured Renderer patch and have a QCstructure of co-ords and rotations sent to the SR patch.

The only thing stopping me trying it out is the maths to calculate the co-ords so tiles join nicely is a bit 'non-trivial' for me. The tiles need to be drawn to match a clean mathematical method rather than drawing the tiles and hoping to find the maths to do it I think.

If anybody can suggest the CIFilter steps to realise a radial curving of a sq image I'd be interested to here it.

PreviewAttachmentSize
radial processing.JPG
radial processing.JPG16.87 KB

gtoledo3's picture
Re: Line styles

I go a little bit fuzzy on your explanation of how you want to do this/what the end visual result is supposed to be (no fault of the post, I'm groggy as heck right now), but maybe the Circular Wrap Distortion is the same as what you main by radial curving.

Conversely, you may want to try grid warping, or GLSL.

gtoledo3's picture
Re: Line styles

The only kind of smooth way I can think of that would avoid compositing stuff would be to draw with the GL Quad structure, and feed it an image structure, trying to set it up so the initial image and the last image in the queue get the correct round cap. I think that might be sort of crappy, performance wise, but you might actually be able to get it working so that you can use illustrator brushes (you can import those with the CoGe brushes plugin). I don't see why this wouldn't be technically possible.

The other thing, is that if you decide to use an RII/feedback based drawing and forget about structures, then you can maybe use a watcher or pulse or something to pop in one image on the initial mouse down, one when you are drawing, and then a different on mouse up.

usefuldesign.au's picture
Re: Line styles

Yes Circular Wrap Distortion is pretty much it. Hard to get shallow curves it really wants to crank so you need a small source image but that's okay for this kind of tiling exercise. A queue of these images feed into the Quad renderer or the Structured renderer (no queue more a split feed situation) could do it well and maybe even follow the mouse/guestures whatever not just auto-generate.

Also found perspective tile image filter in Core Image Funhouse which is prob okay for small 'bends'.

Just the maths now…

I was hoping to see some CIFilter code I can learn from, gt, ;-)

jersmi's picture
Re: Line styles

I'll put these ideas in the soup. Thanks, gents.