Feature request: surface(image="profile.png")

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

Feature request: surface(image="profile.png")

clothbot
Hi Everyone,

Any chance the surface() module could be enhanced to take images (bmp, gif, jpg and/or png) as data sources?

It seems like a feature that a whole lot of people could find useful, myself included.

Thanks!

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: Feature request: surface(image="profile.png")

Brad Pitcher
You might want to give this a try!

<obligatoryPlug>
</obligatoryPlug>

-Brad

On Thu, Jul 28, 2011 at 9:10 AM, Andrew Plumb <[hidden email]> wrote:
Hi Everyone,

Any chance the surface() module could be enhanced to take images (bmp, gif, jpg and/or png) as data sources?

It seems like a feature that a whole lot of people could find useful, myself included.

Thanks!

Andrew.

--

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

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


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: surface(image="profile.png")

clothbot
Already have, along with a few others, hence the feature request for native support. :-)

On 2011-07-28, at 1:14 PM, Brad Pitcher wrote:

> You might want to give this a try!
>
> <obligatoryPlug>
> image2surface.py: http://www.thingiverse.com/thing:8758
> </obligatoryPlug>
>
> -Brad
>
> On Thu, Jul 28, 2011 at 9:10 AM, Andrew Plumb <[hidden email]> wrote:
> Hi Everyone,
>
> Any chance the surface() module could be enhanced to take images (bmp, gif, jpg and/or png) as data sources?
>
> It seems like a feature that a whole lot of people could find useful, myself included.
>
> Thanks!
>
> Andrew.
>
> --
>
> "The future is already here.  It's just not very evenly distributed" -- William Gibson
>
> Me: http://clothbot.com/wiki/
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad

--

"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: Feature request: surface(image="profile.png")

donbright
Here is a patch to do it. (Not tested much)

Hypothetical documentation: http://en.wikibooks.org/wiki/User:Dbright/Heightmap

Experimental patch: https://github.com/donbright/openscad/compare/surfaceimg

As the Thingiverse thing mentions, anything very large (100x100) makes
OpenSCAD slow to a crawl.

-DB

On Thu, Jul 28, 2011 at 12:32 PM, Andrew Plumb <[hidden email]> wrote:

> Already have, along with a few others, hence the feature request for native support. :-)
>
> On 2011-07-28, at 1:14 PM, Brad Pitcher wrote:
>
>> You might want to give this a try!
>>
>> <obligatoryPlug>
>> image2surface.py: http://www.thingiverse.com/thing:8758
>> </obligatoryPlug>
>>
>> -Brad
>>
>> On Thu, Jul 28, 2011 at 9:10 AM, Andrew Plumb <[hidden email]> wrote:
>> Hi Everyone,
>>
>> Any chance the surface() module could be enhanced to take images (bmp, gif, jpg and/or png) as data sources?
>>
>> It seems like a feature that a whole lot of people could find useful, myself included.
>>
>> Thanks!
>>
>> Andrew.
>>
>> --
>>
>> "The future is already here.  It's just not very evenly distributed" -- William Gibson
>>
>> Me: http://clothbot.com/wiki/
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>
> --
>
> "The future is already here.  It's just not very evenly distributed" -- William Gibson
>
> Me: http://clothbot.com/wiki/
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: surface(image="profile.png")

Christopher Olah
Heh. Wrote a patch going about this in a completely different
direction, making pixels accessible within openscad. This means making
a module to create a normal heightmap is possible, but it also
possible to, for example, create a cylindrical surface with radius
drawn from an image...

https://github.com/colah/openscad

Example usage:

img = image("~/test.png");
echo(pixel(img,1,1));

I'm having issues with QImage loading images though (it keeps being
null for valid paths in formats it should accept).

The patch also provides a frame work for Values that are QT objects,
opening up all sorts of possibilities.

I made it on my branch which is already different from normal
openscad, but if you look at the latest diff you should be able to
essentially copy the changes into the mainline version -- just some
straightforward changes to Value and 2 new functions.

On Thu, Jul 28, 2011 at 10:51 PM, Don Bright <[hidden email]> wrote:

> Here is a patch to do it. (Not tested much)
>
> Hypothetical documentation: http://en.wikibooks.org/wiki/User:Dbright/Heightmap
>
> Experimental patch: https://github.com/donbright/openscad/compare/surfaceimg
>
> As the Thingiverse thing mentions, anything very large (100x100) makes
> OpenSCAD slow to a crawl.
>
> -DB
>
> On Thu, Jul 28, 2011 at 12:32 PM, Andrew Plumb <[hidden email]> wrote:
>> Already have, along with a few others, hence the feature request for native support. :-)
>>
>> On 2011-07-28, at 1:14 PM, Brad Pitcher wrote:
>>
>>> You might want to give this a try!
>>>
>>> <obligatoryPlug>
>>> image2surface.py: http://www.thingiverse.com/thing:8758
>>> </obligatoryPlug>
>>>
>>> -Brad
>>>
>>> On Thu, Jul 28, 2011 at 9:10 AM, Andrew Plumb <[hidden email]> wrote:
>>> Hi Everyone,
>>>
>>> Any chance the surface() module could be enhanced to take images (bmp, gif, jpg and/or png) as data sources?
>>>
>>> It seems like a feature that a whole lot of people could find useful, myself included.
>>>
>>> Thanks!
>>>
>>> Andrew.
>>>
>>> --
>>>
>>> "The future is already here.  It's just not very evenly distributed" -- William Gibson
>>>
>>> Me: http://clothbot.com/wiki/
>>>
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> [hidden email]
>>> http://rocklinux.net/mailman/listinfo/openscad
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> [hidden email]
>>> http://rocklinux.net/mailman/listinfo/openscad
>>
>> --
>>
>> "The future is already here.  It's just not very evenly distributed" -- William Gibson
>>
>> Me: http://clothbot.com/wiki/
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>

Reply | Threaded
Open this post in threaded view
|

Re: Feature request: surface(image="profile.png")

Christopher Olah
github diff: https://github.com/colah/openscad/compare/c63342d7f9c5fe7c186d...master

On Thu, Jul 28, 2011 at 11:24 PM, Christopher Olah
<[hidden email]> wrote:

> Heh. Wrote a patch going about this in a completely different
> direction, making pixels accessible within openscad. This means making
> a module to create a normal heightmap is possible, but it also
> possible to, for example, create a cylindrical surface with radius
> drawn from an image...
>
> https://github.com/colah/openscad
>
> Example usage:
>
> img = image("~/test.png");
> echo(pixel(img,1,1));
>
> I'm having issues with QImage loading images though (it keeps being
> null for valid paths in formats it should accept).
>
> The patch also provides a frame work for Values that are QT objects,
> opening up all sorts of possibilities.
>
> I made it on my branch which is already different from normal
> openscad, but if you look at the latest diff you should be able to
> essentially copy the changes into the mainline version -- just some
> straightforward changes to Value and 2 new functions.
>
> On Thu, Jul 28, 2011 at 10:51 PM, Don Bright <[hidden email]> wrote:
>> Here is a patch to do it. (Not tested much)
>>
>> Hypothetical documentation: http://en.wikibooks.org/wiki/User:Dbright/Heightmap
>>
>> Experimental patch: https://github.com/donbright/openscad/compare/surfaceimg
>>
>> As the Thingiverse thing mentions, anything very large (100x100) makes
>> OpenSCAD slow to a crawl.
>>
>> -DB
>>
>> On Thu, Jul 28, 2011 at 12:32 PM, Andrew Plumb <[hidden email]> wrote:
>>> Already have, along with a few others, hence the feature request for native support. :-)
>>>
>>> On 2011-07-28, at 1:14 PM, Brad Pitcher wrote:
>>>
>>>> You might want to give this a try!
>>>>
>>>> <obligatoryPlug>
>>>> image2surface.py: http://www.thingiverse.com/thing:8758
>>>> </obligatoryPlug>
>>>>
>>>> -Brad
>>>>
>>>> On Thu, Jul 28, 2011 at 9:10 AM, Andrew Plumb <[hidden email]> wrote:
>>>> Hi Everyone,
>>>>
>>>> Any chance the surface() module could be enhanced to take images (bmp, gif, jpg and/or png) as data sources?
>>>>
>>>> It seems like a feature that a whole lot of people could find useful, myself included.
>>>>
>>>> Thanks!
>>>>
>>>> Andrew.
>>>>
>>>> --
>>>>
>>>> "The future is already here.  It's just not very evenly distributed" -- William Gibson
>>>>
>>>> Me: http://clothbot.com/wiki/
>>>>
>>>>
>>>> _______________________________________________
>>>> OpenSCAD mailing list
>>>> [hidden email]
>>>> http://rocklinux.net/mailman/listinfo/openscad
>>>>
>>>> _______________________________________________
>>>> OpenSCAD mailing list
>>>> [hidden email]
>>>> http://rocklinux.net/mailman/listinfo/openscad
>>>
>>> --
>>>
>>> "The future is already here.  It's just not very evenly distributed" -- William Gibson
>>>
>>> Me: http://clothbot.com/wiki/
>>>
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> [hidden email]
>>> http://rocklinux.net/mailman/listinfo/openscad
>>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>