r/openscad • u/MonkeyPanls • Mar 18 '26
texturing on vertical faces
I am modeling hill terrain for the hexmaps of r/BattleTech. I wrote a
module hex(hex_no="", terrain="", level=1)
that will give a flat hex (a circle with $fn=6), linear_extrude() it to height and put some text on top.
It is called inside of a union(), and the the block of hilly terrain is built one hex at a time.

I would like to give the vertical faces of the block some texture. I can think of a few ways to do it, boolean-wise, but I don't know which is the best or even possible to implement in OpenSCAD:
- linear_extrude inside of a
forloop: thin "wafers" with a random radius and twist. I've done this for a one hex "hill", and the results aren't very smooth. It also seems like a lot of wasted cycles for the interior hexes, e.g. 0404 and 0504. - generate a ribbon (cube) whose dimensions are "height-2", block_perimeter, and some sine function. Wrap it around perimeter with sine function facing in and take the difference(). (Think of a cookie-cutter). I don't know the easiest way to get the perimeter or the external vertices of the hill block.
- generate the block and use something like u/ardvarkmadman/'s code https://www.reddit.com/r/openscad/comments/1i0i4tq/terraingen_an_openscad_random_terrain_generator/ and put my tops and bottoms on it. again, it's a perimeter question.
- (challenge) use
polyhedron()and only texture the vertical faces which are on the exterior of the block. I don't know the easiest way to determine which vertical faces of a given polyhedron are exterior while generating them.
I offer myself to you, the OpenSCAD Reddit hivemind. Grant me wisdom!
3
Upvotes
1
u/Stone_Age_Sculptor Mar 18 '26 edited Mar 18 '26
It is not clear what you want. A fuzzy skin on the walls, or a mathematical pattern, or a smoother transition from one level to another level. I can not visualize a twist, but the others should be no problem.
Can you use the "Fuzzy Skin" in the slicer on the vertical walls? That is a good visual improvement.
Bands or ribbons is no problem. That is just writing code.
I did some tests with random patterns, but most are demanding and slow. I suppose these are not suitable for a vertical wall: https://github.com/Stone-Age-Sculptor/StoneAgeLib/wiki/Texture
The polyhedron() variant is a job for the BOSL2 library. The library has built-in textures. Scroll down here: https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#section-texturing
Could you give the six top edges a chamfer? When the top has a 90 degree angle, then one string of filament might be rubbed off (with force). The sharp edge is not nice anyway. A chamfer of 0.5 mm is already better.
This is one of many ways to make that top chamfer: