Page 1 of 1

Multiple strokes in randomized paths

Posted: Sun Mar 18, 2012 5:48 am
by Ryk
I am trying to make paths using multiple strokes with different stroke widths. This works on paths with predetermined parameters, but when doing so on random paths only the first stroke width is used.

Code: Select all

startshape Scene

shape Scene{
	randSquiggle []
	Squiggle [x 6]
}

path randSquiggle {
	MOVETO(0,0)	
	
	// one parameter randomized
	CURVETO(1..5,5,9,2)

	STROKE(0.2) []
	STROKE(0.02) [y 1 b 0.5]	
}


path Squiggle {
	MOVETO(0,0)	
	
	//no randomization
	CURVETO(7,5,9,2)

	STROKE(0.2) []
	STROKE(0.02) [y 1 b 0.5]	
}
The random curve on the left will use the first width on both strokes whereas the one on the left uses both widths as specified. Is there a solution to this?

Thanks!

Re: Multiple strokes in randomized paths

Posted: Sun Mar 18, 2012 9:11 am
by MtnViewJohn
It's one of those situations where an uninitialized piece of memory happens to have the worst possible value in it. I fixed the initializer, but I don't think there is a work-around for v2beta2. v3beta3 is coming out soon. I just have one more bug to fix.

Re: Multiple strokes in randomized paths

Posted: Sun Mar 18, 2012 11:02 am
by Ryk
Nice!

Thanks for the work you are putting into the program! I've had a great time using it.

Re: Multiple strokes in randomized paths

Posted: Fri Mar 23, 2012 2:56 am
by Ryk
Found another issue. When using multiple STROKEs, they might not respect differing z values:

Code: Select all

startshape Squiggle

path Squiggle {
	MOVETO(0,0)
	LINETO(1,1)
	
	//red line at z 5
	STROKE() [b 1 sat 1 h 0 z 5]


	//blue line at z 0
	STROKE() [r 90 x 1 b 1 sat 1 h 180 z 0]

}

Re: Multiple strokes in randomized paths

Posted: Fri Mar 23, 2012 7:51 am
by MtnViewJohn
That is by design. All the components of a path z-order together. It should issue a warning though. And this should be documented.