I've modified a script CVH provided, with the intention of generating an involute spiral.
I have variables set for the centre of the evolute, the radius, the number of segments the evolute is divided into, etc... And the script generates the points along the generating line at the bottom of the evolute.
Code: Select all
var originX = 0; // Centre of the evolute circle in x
var originY = 0; // Centre of the evolute circle in y
var radius = 50; // Radius of the evolute circle
var segments = 12; // Number of segments the evolute circle is divided into
var generators = 12; // Number of generator lines created
var i, xPos, yPos; // Iterator and X/Y positions
var nodes = []; // Collector for polyline nodes
var GeneratorRotation // The amount each generator line is rotated
// Populate array with nodes:
for (i=0;i<=generators;i++) {
xPos = originX + (i * (2 * PI * radius) / segments);
yPos = originY - radius;
nodes.push(new RVector(xPos, yPos));
}
// Adding a dedicated layer:
addLayer("QCAD Involute", "Dark Blue", "CONTINUOUS", RLineweight.Weight025);
setCurrentLayer("QCAD Involute");
// Add a polyline with addPolyline or add a spline with addSpline:
addSpline(nodes);
For my script, this will be
Code: Select all
rotate(entity, (360/segments), originX, originY)
Clearly knowing about 'entities' is important!
Can anyone fill in this particular blank for me?
Thanks in advance!
Derek