Closed sebastien closed 5 years ago
The current preview logic simply replaces the bounding box with [[-10,-10],[10,10]] if the 2D shape's bbox is empty or infinite.
I can use similar logic in PNG export. It's kind of arbitrary.
It's good enough for now, then ideally we could pass the crop area as an -O
argument. I'm building a list of the examples, and want to render all of them:
I've never seen the examples all together like that. Cool.
This should probably go on the curv3d.org web site. Also, seeing them all together might motivate me to improve some of the examples, prune others.
You can also export animated GIFs (which are too bulky, and look bad, due to quantization down to 256 colours), or WEBM files (which don't work in all browsers). I also recommend using -Oaa=4 to get rid of aliasing.
ideally we could pass the crop area as an -O argument
You can also use
curv -o foo.png -x 'file "examples/circlattice.curv" >> set_bbox[[-5,-5,-5],[5,5,5]]'
to crop the shape.
Good to know for the set_bbox
, I'll add that to the compiler wrapper for Curved. I haven't used animations yet, even for the WebGL preview, it's on my list, though!
I'm making sure all of the components of Curved are standalone, so we'll be able to embed the list of examples, the documentation browser and code editor/playground all independently. It's coming together well, but getting the application layout right is tricky, I went through a few iterations already.
I'm trying to generate batch previews of curv's examples, but any example that has an infinite 2D texture fails.
Would it be possible to make the renderer crop the texture based on the given image size? The examples render fine in the GL preview, so I think the PNG output should also work.