Perhaps one of the ZScript experts can help me out.
I was writing a randomized gear script, but ran into a roadblock with writing a routine for generating random profiles.
The main thing is, I can’t figure out how to specify that these points are to have sharp corners rather than smooth curves. Plus I’m not entirely sure of the proper formatting to script a profile curve.
As a result, my gears are looking more like flowers. Which would be fine if I wanted a screen full of flowers.
Here’s a code snippet:
[varSet,Y1,rand(100)]
[varSet,Y2,rand(100)]
[varSet,Y3,rand(100)]
[varSet,Y4,rand(100)]
[varSet,Y5,rand(100)]
[varSet,Y6,rand(100)]
[varSet,Y7,rand(100)]
[varSet,Y8,rand(100)]
[varSet,Y9,rand(100)]
[varSet,Y10,rand(100)]
// Specify the points in the profile.
[IClick,TOOL:MODIFIERS:INITIALIZE:Outer Profile,0,Y1,0,Y1]
[IClick,TOOL:MODIFIERS:INITIALIZE:Outer Profile,25,Y2,25,Y2]
[IClick,TOOL:MODIFIERS:INITIALIZE:Outer Profile,50,Y3,50,Y3]
[IClick,TOOL:MODIFIERS:INITIALIZE:Outer Profile,75,Y4,75,Y4]
[IClick,TOOL:MODIFIERS:INITIALIZE:Outer Profile,100,Y5,100,Y5]
// Specify the points in the outer
// cross-section of the gear.
[IClick,TOOL:MODIFIERS:INITIALIZE:Outer Section,0,Y6,0,Y6]
[IClick,TOOL:MODIFIERS:INITIALIZE:Outer Section,25,Y7,25,Y7]
[IClick,TOOL:MODIFIERS:INITIALIZE:Outer Section,50,Y8,50,Y8]
[IClick,TOOL:MODIFIERS:INITIALIZE:Outer Section,75,Y9,75,Y9]
[IClick,TOOL:MODIFIERS:INITIALIZE:Outer Section,100,Y10,100,Y10]
Maybe someone out their would know a better way of scripting Profile Graphs? I couldn’t find anything about it in the Zscript commands reference.