Creating a Coloured Cross Hatch & Single Hatch Pattern on Walls

Hi Speckle Community!

I want to be able to colour walls in a revit model through the speckle viewer based on a certain property. This property could be many things and depending on the values would lead to the wall being hatched up left, up right, cross hatched or a solid colour. I have attached this photo to hopefully help explain.

I am currently using .applyFilter which I found here in the docs Introduction | Speckle Docs

I have got this working but this only completes one of the problems which is colour, I need to be able to apply a hatched texture too. I am struggling to find a solution in the docs, does anyone know of a way to do this?

I have a feeling I might need to upgrade my version of speckle viewer to 2.20^ (currently 2.5.5) to start playing with the new filter extension functions but this will require a bit of a re-write and would be great if that wasn’t the case.

Any help would be greatly appreciated

Thanks in advance!

Hi @Jamie_Bliss

Unfortunately, the docs page you are linking to is severely obsolete. You can find all up-to-date viewer documentation here.

Also, unfortunately, the viewer API does not currently allow you to add hatched texture (or otherwise) to objects. It is possible via a custom extension, but it will probably involve writing a shader.

Hatches have been in discussions for a while now, and there is a good chance we will introduce them one way or another at some point.

Cheers

Hi @alex thank you for fast response!

Ahh that’s unfortunate. Glad to hear they are in discussions, hopefully they will be introduced soon🤞

I have a limited knowledge of shaders but have enough knowledge that they are tricky so on the chance that I find myself with enough time to give it a go where would I start? Do I need to familiarise myself with 3JS?

Hi @Jamie_Bliss

Three.js knowledge would help since the viewer is built on top of three.js. However, there are plenty of other resource like the classic LearnWebGL since shaders are engine/framework agnostic.

Cheers

1 Like