mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-06 08:17:47 +02:00
Fixed docs spelling. Standardized formatting.
This commit is contained in:
@@ -688,7 +688,7 @@ module supershape(step=0.5,m1=4,m2=undef,n1,n2=undef,n3=undef,a=1,b=undef, r=und
|
||||
// - "length", length: Change the turtle move distance to `length`
|
||||
// - "scale", factor: Multiply turtle move distance by `factor`
|
||||
// - "addlength", length: Add `length` to the turtle move distance
|
||||
// - "repeat", count, comands: Repeats a list of commands `count` times.
|
||||
// - "repeat", count, commands: Repeats a list of commands `count` times.
|
||||
// - "arcleft", radius, [angle]: Draw an arc from the current position toward the left at the specified radius and angle
|
||||
// - "arcright", radius, [angle]: Draw an arc from the current position toward the right at the specified radius and angle
|
||||
//
|
||||
@@ -854,17 +854,26 @@ function _turtle_command(command, parm, parm2, state, index) =
|
||||
command=="scale" ? list_set(state, step, parm*state[step]) :
|
||||
command=="addlength" ? list_set(state, step, state[step]+normalize(state[step])*parm) :
|
||||
command=="arcleft" || command=="arcright" ?
|
||||
let( myangle = default(parm2,state[angle]),
|
||||
let(
|
||||
myangle = default(parm2,state[angle]),
|
||||
lrsign = command=="arcleft" ? 1 : -1,
|
||||
radius = parm,
|
||||
center = lastpt + lrsign*radius*line_normal([0,0],state[step]),
|
||||
arcpath = myangle == 0 ? [] :
|
||||
arc(segs(radius), points = [lastpt, rot(cp=center, p=lastpt, a=lrsign*myangle/2),
|
||||
rot(cp=center, p=lastpt, a=lrsign*myangle)])
|
||||
arcpath = myangle == 0 ? [] : arc(
|
||||
segs(radius),
|
||||
points = [
|
||||
lastpt,
|
||||
rot(cp=center, p=lastpt, a=lrsign*myangle/2),
|
||||
rot(cp=center, p=lastpt, a=lrsign*myangle)
|
||||
]
|
||||
)
|
||||
list_set(state, [path,step],
|
||||
[ concat(state[path],slice(arcpath,1,-1)),
|
||||
rot(lrsign * myangle,p=state[step],planar=true) ]) :
|
||||
)
|
||||
list_set(
|
||||
state, [path,step], [
|
||||
concat(state[path], slice(arcpath,1,-1)),
|
||||
rot(lrsign * myangle,p=state[step],planar=true)
|
||||
]
|
||||
) :
|
||||
assert(false,str("Unknown turtle command \"",command,"\" at index",index))
|
||||
[];
|
||||
|
||||
|
Reference in New Issue
Block a user