STL slices export and warp shader

52 views
Skip to first unread message

Loïc Fejoz

unread,
Jan 31, 2016, 9:13:41 AM1/31/16
to IceSL
Hi,

Was trying to play with (random) stone wall generation...

It seems that the STL slices generator does not apply the warp shader! :-(

As an example, see the stone.lua example in https://github.com/loic-fejoz/loic-fejoz-fabmoments/tree/master/castle

After testing on the soap models, it also does not apply other shaders...

Thanks.

Regards,
Loïc

sylefeb

unread,
Jan 31, 2016, 12:48:56 PM1/31/16
to IceSL
Hi Loic,

Yes this is a 'known' limitation - I was hoping to fix it before anybody notices ;-) It's on the TODO.

As a side note, these two features (slice shader and warp shaders) will surely evolve in the future ; so expect some changes.

Sylvain

Loïc Fejoz

unread,
Jan 31, 2016, 1:01:48 PM1/31/16
to IceSL
Too bad. ;-)

Imagine what my castle would look like if I could apply a global warp to make it look like more stone...
(It seems the shader I have copied would make it)

Maze Mietner

unread,
Feb 3, 2016, 9:14:28 AM2/3/16
to IceSL
Hi

Can you print it with the details the shader would add?

While I never used shaders in icesl I think it might be more practical to use a bump map to create the grooves between the bricks and then print them using a different color. If you'd be printing single stones it might work, but a full castle won't have too much details on the stones. Evaluating the normal vector you could even apply different bump maps per side. As far as I understood you can't load textures or bump maps at the moment, so maybe add it to the wish list. Or can you?

Looking at your current castle it looks like the random function is doing too much, resulting in too many narrow bricks and in too small interlock areas between bricks in different layers. And it looks like the towers are build with giant stones. Well, I like buildings with giant stones, and there are towers constructed with giant irregular stones (https://en.wikipedia.org/wiki/Nuraghe), as well as walls constructed with giant irregular stones on the Easter Island, Egypt and South America (https://www.youtube.com/watch?v=66x9VLwZaDQ shows a nice wall) and maybe on a few other places (http://www.bibliotecapleyades.net/arqueologia/worldwonders/geom2.htm). It's obvious that an advanced tools and computer programs would have been really helpful to calculate the optimal use the these random stones, going off-topic. Anyway, each stone is rather individual, so a generic shader won't do it. Maybe you could randomly add bumps/dents/edges within the function to generate the stones, it'll make it look much more real.

Maze

Loïc Fejoz

unread,
Feb 3, 2016, 2:33:51 PM2/3/16
to IceSL
Hi,

Indeed I have already ask Sylvain for texture map but I think our whishlist is growing faster than his todo list is decrease! ;-)

I can't tell what the shader will look like on the whole castle because my graphic card is really low level. But you can find in attachment what it looks like on a single wall from the G-Code...  I haven't try the printing yet.

Indeed the random function is really pour but that a first stress test for what is possible... Bigger stones on tower are on purpose. At least on European castles, towers are made more tightly than wall. So I wanted to make a difference, especially on the radius. But the truth is that it shall be more regular (square) than the wall. Yet I can't find again the image that inspired me where the stones of tower were clearly bigger than the one of the wall.
http://passion-medievale.com/www/wp-content/uploads/2010/08/blandy.jpg
https://upload.wikimedia.org/wikipedia/commons/4/4f/Facade_nord_de_face.jpg
It is probably off-topic indeed but just a case-study on what shall be done inside IceSL and what shall be done outside, ie generating inside IceSL or to IceSL... The shader must be in ...by now. ;-D

Generating bumps/dents/edges could be done by auto-generating STL inside IceSL but is it nice and/or practical? Should try...

Thanks for your comment.

regards,
Loïc

stone-wall.png

Maze Mietner

unread,
Feb 4, 2016, 9:07:24 AM2/4/16
to IceSL
Hi

I'm a little bit confused, according to the first posts the shader doesn't work...now you've sliced the wall in IceSL using that shader?!

It looks nice, and might actually print quite well.

Btw the slicer "Cura" can load images and convert them the height maps (z=f(brightness)) and export it as stl - quite handy to create mountains, nice 3D texts or front and back of coins/medals, and also walls (http://www.snakehillgames.com/extended-depth-map-features-goal-met/ has a suitable wall image). Would be handy in IceSL as well.

Maze



Maze

Loïc Fejoz

unread,
Feb 4, 2016, 9:32:28 AM2/4/16
to IceSL
Hi Maze,

The shader is working but is unused when exporting sliced-STL.
What you see is a screenshot of the GCode (path) rendering...

I haven't tried yet on the whole castle model because of low memory graphic card.

For heighmap to STL they are plenty of tools and then IceSL can use the STL result.
With the new IceSL API, I believe we could also provide a loader function.

I have play a little bit with a in-browser app to generate a 3D model from heightmap (and then send to octoprint or create STL). I use this app for my kids and possibly for new comers in our FabLab.
It has still to be enhance: http://loic-fejoz.github.io/fabinpocket/

Regards,
Loïc

Maze Mietner

unread,
Feb 4, 2016, 3:45:50 PM2/4/16
to IceSL
Hi

I see, and tried it myself - g-code generation works, however the shader code is effective only on the front and back - so I change the 76th line to

  vec2 d = vec2( fbm3(p*100.0, 0.4, 2.96) * DISPLACEMENT, fbm3(p*100.0, 0.4, 2.96) * DISPLACEMENT);

It might be more approriate to test the direction the wall is pointing and then do the the displacement only in this direction (if it's possible at all, I've never tried this).

Maze

Loïc Fejoz

unread,
Feb 5, 2016, 1:42:14 AM2/5/16
to IceSL
Hi,

Thanks I will try it later.

I don't think it is possible to test direction, but one could emit in a different brush for each direction, then test for the brush in the shader.

regards,
Loïc

Maze Mietner

unread,
Feb 5, 2016, 9:24:00 AM2/5/16
to IceSL
Hi

well, warp shader doesn't have any brush information, and it won't even scale up to five towers. Just add a feature request for the normal vector of the point.

Maze

sylefeb

unread,
Mar 7, 2016, 2:10:52 PM3/7/16
to IceSL
Hi Loic, Hi Maze,

I am currently considering some changes to the core engine, and it is likely the material/warp shaders will go away, but be replaced by some more powerful features.
It will take some time to do this, but I prefer not to patch the current material/warp shaders. Sorry for this; these features were put in place early on (because they are great!) but not very well integrated -- this will get better.

I did a lot of work on texturing in the past, and there is no way we don't get relief/solid textures in IceSL :-)

Best,
Sylvain
PS: these changes will also address memory issues.

Loïc Fejoz

unread,
Mar 7, 2016, 2:47:56 PM3/7/16
to IceSL
Hi Sylvain,

I sent my castle on Sculpteo for comparison on price, quality, etc. In doing so, I was wondering what format would be best.
The obvious answer would be OpenSCAD but you lose the parametric/programmable aspect.

So I do not know if you are aware of their Javascript API but It would be nice if features can converge...
http://www.sculpteo.com/en/developer/webapi/create/JS/

Still I think they do not provide directly a programmable displacement...

Regards,
Loïc

sylefeb

unread,
Mar 8, 2016, 2:07:32 AM3/8/16
to IceSL
Hi Loic,

Thanks for pointing this out -- I'll have a closer look at the API. I also noticed that Shapeways now accept a voxel file format that we should be able to export to, this would facilitate exchanges.

Best,
Sylvain


Reply all
Reply to author
Forward
0 new messages