Closed dom1817 closed 3 years ago
Ok. Can you provide a list? That would be the easiest for me, other than looking through the API again.
Dan Wilcox danomatika.com robotcowboy.com
On Oct 5, 2019, at 8:02 PM, dom1817 notifications@github.com wrote:
This structure seems to be quite common in openFrameworks: vector
→ vector → vector A use case with a similar structure that I was trying to use in Loaf is: vector
characters = font.getStringAsPoints(text) Then: vector outlines = characters[n].getOutline() Then: vector vertices = outlines[n] Now that vectors of vertices or points are now accessible, wrapping also the other containers would be a great addition to Loaf.
-- Define font font = of.TrueTypeFont() font:load("filename.ttf", 32)
-- Print each vertex of a character characters = font:getStringAsPoints("Hello") for i=0,characters:size() do outlines = characters[i] for n=0, outlines:size() do vertices = outlines[n] for m=0, vertices:size() do of.drawCircle(vertices[m],10) end end end — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
path = of.Path()
-- Make first polyline
path:lineTo(0,0)
[...]
path:close()
-- Make second polyline
path:moveTo(10,10)
[...]
path:close()
poly = path:getOutline()
poly[1]:draw()
poly[2]:draw()
Then I think that ofMesh and ofVboMesh will be a bit more complicated, as they have a lot of functions returning vectors (getIndices, getColors, getNormals, getTexCoords). I tried quickly and only getVertices seems to be wrapped correctly.
I tried quickly and only getVertices seems to be wrapped correctly.
Note: Those are explicitly ignored when making the bindings. I don't try to make the Lua bindings cover 100% of the OF API. For things which have a function with arguments and an alternative version with a vector, I started by ignoring the vector version.
Ok, all of these type vectors should now be wrapped, including those used by ofMesh. Can you try this test build?
http://docs.danomatika.com/releases/loaf/loaf-1.6.0-test1-macos.zip
I'm going to assume they work now. Please test and reopen if not.
This structure seems to be quite common in openFrameworks:
vector<ofPath>
→vector<ofPolyline>
→vector<ofVertex>
A use case with a similar structure that I was trying to use in Loaf is:
vector<ofPath> characters = font.getStringAsPoints(text)
Then:vector <ofPolyline> outlines = characters[n].getOutline()
Then:vector <ofVertex> vertices = outlines[n]
Now that vectors of vertices or points are now accessible, wrapping also the other containers would be a great addition to Loaf.