This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = polygon([10, 90], [10, 10], mouse) | |
debug(fillet(path, 10)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sheetInfo = new Map([ | |
['見積書', { range: 'A1:I38' }], | |
['選定理由書', { range: 'A1:H40' }], | |
['発注書', { range: 'A1:I38' }], | |
['注文請書', { range: 'A1:I38' }], | |
['出張予定表', { range: 'A1:H51' }], | |
['旅費計算書', { range: 'A1:L23' }], | |
['納品書', { range: 'A1:I39' }], | |
['検収書', { range: 'A1:I38' }], | |
['検収書', { range: 'A1:I38' }], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bezier = { | |
command: 'C', | |
start: [10, 10], | |
args: [[90, 90], [10, 90]], | |
point: [60, 40] | |
} | |
const p = Path.fromSegment(bezier) | |
const nearest = CubicBezier.project(bezier, mouse).position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const r = unite([ | |
rect([20, 30], [80, 70]), | |
rect([40, 10], [60, 90]), | |
]) | |
function chamfer(path, distance) { | |
return spawnVertex(r, (seg, index, curve) => { | |
const next = Curve.nextSegment(curve, index) | |
const point = Segment.point(next, {offset: distance}) | |
return [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const controls = [ | |
[[10, 10], true], | |
[[50, 10], time < .1], | |
[[10, 50], time < .25], | |
[[50, 50], time > .5], | |
[[10, 90], time > .6], | |
[[50, 90], time > .8], | |
[[90, 50], time < .7], | |
[[90, 10], true], | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r = merge([ | |
circle([25, 50], 20), | |
line([50, 40], [50, 60]), | |
unarc(circle([75, 50], 20)) | |
]) | |
debug(r, '#eee', .5) | |
p = point(r, {curveIndex: 2, segmentIndex: 0, unit: -time}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c = subdiv(circle([50, 50], 40), 10) | |
w = spawn(c, (s, i) => { | |
dir = i % 2 === 0 ? 0 : 1 | |
t = sin((i / segmentCount(c) * 2 + time) * 360) | |
p0 = Segment.point(s, 0) | |
p1 = Segment.point(s, 1) | |
n0 = vec2.rotate(Segment.normal(s, 0), t * 73) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c = subdiv(circle([50, 50], 40), 10) | |
w = spawn(c, (s, i) => { | |
dir = i % 2 === 0 ? 0 : 1 | |
t = sin((i / segmentCount(c) * 2 + time) * 360) | |
p0 = Segment.point(s, 0) | |
p1 = Segment.point(s, 1) | |
n0 = vec2.rotate(Segment.normal(s, 0), t * 73) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c = transform( | |
subdiv(arc([50, 50], 20, 0, 720), 6), | |
mat2d.rotation(time * 120, [50, 50]) | |
) | |
w = spawn(c, (s, i) => { | |
t = sinwave(i / segmentCount(c) * 3 - time) | |
dir = i % 2 === 0 ? 1 : -1 | |
p0 = Segment.point(s, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r = ngon([50, 50], 40, 4) | |
r = subdivide(r, 6) | |
r = spawn(r, (seg, i) => | |
arcByPointsAngle( | |
seg.start, | |
seg.point, | |
scalar.sin(/*0*/time * 360/**/) | |
* 180 * (i % 2 ? 1 : -1) | |
) | |
) |
NewerOlder