Images as (grey-scale) surface() and Value::POLYSET support (WIP)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Images as (grey-scale) surface() and Value::POLYSET support (WIP)

clothbot
Hey Everyone,

This is still *very* much a work in progress (WIP) and I still have a great deal of (planned) refactoring to do, but I've managed to get surface(image) and some basic "geometry as variable" support implemented:



I used the ImageMagick libraries since they're already accessed for the test infrastructure and it's easy to take advantage of their subroutines for image preprocessing.  I use resize() (see http://www.imagemagick.org/Magick++/Image.html) for "scaling down" the image size as a dirty way to reduce the polygon count, but there are all sorts of other goodies that could prove useful.

I have a builtin_read() defined for reading an image into a Value::POLYSET (used by my modified surface()), but when I start tackling the refactoring (perhaps tonight) I also want to get it reading in STL and DXF.  Then I'm looking at extending polygon() and polyhedron() to render Value::POLYSET variables directly.  Coding up a builtin_write() could prove useful for dumping pre-rendering STL, DXF and other formats.

I'm really tempted to pull in Mandoline code (see https://github.com/revarbat/Mandoline) to speed projection() slicing and for faster pre-rendering 2D and 2.5D geometric boolean operations...

…also, example024.scad exercises a simple braille_ascii_font() I whipped up in https://github.com/clothbot/MCAD/tree/fonts

Andrew.

--

"The future is already here.  It's just not very evenly distributed" -- William Gibson

Me: http://clothbot.com/wiki/



Reply | Threaded
Open this post in threaded view
|

Re: Images as (grey-scale) surface() and Value::POLYSET support (WIP)

Marius Kintel
Nice :)

FYI: I'm in the middle of a full rewrite of the Value class, so it would be nice if you keep your changes to that one as clean as possible.

 ~/= Marius


Reply | Threaded
Open this post in threaded view
|

Re: Images as (grey-scale) surface() and Value::POLYSET support (WIP)

clothbot
On 2012-02-28, at 3:09 PM, Marius Kintel wrote:
Nice :)

FYI: I'm in the middle of a full rewrite of the Value class, so it would be nice if you keep your changes to that one as clean as possible.

Yup, I've kept the changes reasonably self-contained and localized:


Also of note, I added a Value::MATRIX type which makes it a lot easier to do matrix operations and inherit useful number crunching ops like Eigen::MatrixXd setIdentity() and inverse().

The src/expr.cc only required a few lines of code to return Value::VECTOR for Vector::MATRIX[i] and return Vector::MATRIX for Vector::POLYSET[i].

Andrew.

--

"The future is already here.  It's just not very evenly distributed" -- William Gibson

Me: http://clothbot.com/wiki/