-
Notifications
You must be signed in to change notification settings - Fork 2
/
of.path.pd
53 lines (53 loc) · 3.31 KB
/
of.path.pd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#N canvas 472 142 864 729 12;
#X obj 31 24 inlet;
#X obj 31 992 outlet;
#X text 689 639 RI;
#X obj 812 962 outlet;
#X obj 31 75 ofelia d -c12 path-\$0 \; local c = ofCanvas(this) \;
local args = c:getArgs() \; local outlet = ofOutlet(this) \; local
mode = args[1] \; local position \, orientation \, scale = ofVec3f()
\, ofVec3f() \, ofVec3f(1 \, 1 \, 1) \; local path\$0 = ofPath() \;
\; function M.new() \; ofWindow.addListener("setup" \, this) \; if
args[1] == nil then mode = 0 else mode = 1 end \; M.setup() \; end
\; \; function M.free() \; ofWindow.removeListener("setup" \, this)
end \; \; function M.setup() \; end \; \; function M.resw(float) resw=float
end \; function M.resh(float) resh=float end \; function M.width(float)
width=float end \; function M.height(float) height=float end \; function
M.append(s) path\$0:append(s) end \; function M.newsubpath() path\$0:newSubPath()
end \; function M.clear(string) path\$0:clear() end \; function M.close(string)
path\$0:close() end \; function M.stroke(float) path\$0:setStrokeWidth(float)
end \; function M.color(l) path\$0:setColor(ofColor(table.unpack(l)))
end \; function M.fillcolor(l) path\$0:setFillColor(ofColor(table.unpack(l)))
end \; function M.strokecolor(l) path\$0:setStrokeColor(ofColor(table.unpack(l)))
end \; function M.filled(float) path\$0:setFilled(float ~= 0) end \;
function M.mode(float) mode = float path\$0:setMode(mode) end \; function
M.tessellate() path\$0:tessellate() end \; function M.outline() path\$0:hasOutline()
end \; function M.polywinding(float) path\$0:setPolyWindingMode(float)
end \; function M.useshapecolor(float) path\$0:setUseShapeColor(float
~= 0) end \; function M.simplify(float) path\$0:simplify(float) end
\; function M.circleresolution(float) path\$0:setCircleResolution(float)
end \; function M.curveresolution(float) path\$0:setCircleResolution(float)
end \; function M.rectangle(l) path\$0:rectangle(table.unpack(l)) end
\; function M.rectrounded(l) path\$0:rectRounded(table.unpack(l)) end
\; function M.circle(l) path\$0:circle(table.unpack(l)) end \; function
M.triangle(l) path\$0:triangle(table.unpack(l)) end \; function M.ellipse(l)
path\$0:ellipse(table.unpack(l)) end \; function M.arc(l) path\$0:arc(table.unpack(l))
end \; function M.arcnegative(l) path\$0:arcNegative(table.unpack(l))
end \; function M.moveto(l) path\$0:moveTo(table.unpack(l)) end \;
function M.lineto(l) path\$0:lineTo(table.unpack(l)) end \; function
M.curveto(l) path\$0:lineTo(table.unpack(l)) end \; function M.bezierto(l)
path\$0:bezierTo(table.unpack(l)) end \; function M.quadbezierto(l)
path\$0:quadBezierTo(table.unpack(l)) end \; function M.position(l)
position:set (table.unpack(l)) path\$0:translate(position:vec3()) end
\; function M.orientation(l) orientation:set (table.unpack(l)) path\$0:rotateDeg(1
\, orientation:vec3()) end \; function M.scale(list) path\$0:scale(list[1]
\, list[2]) end \; function M.get() outlet:outletList(1 \, ofTable(path\$0:getMode()
\, path\$0:getWindingMode() \, path\$0:getFillColor() \, path\$0:getStrokeColor()
\, path\$0:getStrokeWidth() \, path\$0:getCurveResolution() \, path\$0:getCircleResolution()
\, path\$0:hasOutline() \, path\$0:isFilled() \, path\$0:getOutline()
\, path\$0:getTessellation())) end \; \; function M.bang() \; path\$0:draw()
\; return anything \; end \;;
#X f 115;
#X connect 0 0 4 0;
#X connect 4 0 1 0;
#X connect 4 1 3 0;