Author Topic: Multi Centered Arch Generator (for facades, gates, windows and buildings)  (Read 2223 times)

The node is available on my Artstation page here
Hi all
This is my first time posting on the "Showcase" part of the forum as I am usually the one pestering people with questions  ;D and I am not by any means a master of the software. I do concept art so I generally use the substances from substance source.
I am also not sure what is the best way to showcase a substance file here on the forum so I am all ears on this issue.
Nevertheless during the lockdown I had some spare time to play with substance designer.
Specifically I kept hearing that the pixel processor is a really powerful node and I wondered what I could do with it and how much could I push it. 
I really love those substances that reproduce building facades. I have seen some amazing work.
One thing I noticed though is that there is not really any easy way to create the main types of arches the 1 centered circular arch), especially when you have to show the voussoirs, or you want a texture (like a wood pattern) to follow its shape.
Therefore I decided to brush my high school trigonometry and give a read to a great book called "Practical geometry for builders and architects".

Math is FUN! :D
The result of this exploration of the pixel processor was my "Arch Generator" node.
This is a node that can generate all the main types and sub-types of arches and that can map an image input along their length and width. It was a fascinating challenge to tackle and the result, while not 100% perfect, still does what is supposed to do in most of the cases.

For the most difficult cases (the true elliptical and parabolic arches) I had a LOT of help from the math geniuses at MathStackExchange and Inigo Quilez which involved getting around a nasty quartic equation which I would not wish it upon even my worst enemy. So a huge thank you guys!

My arch generator can simulate the following types of arches:

Flat Arches
- Tapered
- Parallel

1 Centered Arches
- Semicircular Arches (Roman Arches)
- Segmental Arches
- Horseshoe Arches

2 Centered Arches
- Pointed Lancet Arches
- Pointed Equilateral Arches
- Pointed Drop Arches
- Pointed Segmental Arches

3 centered Arches
- Basket-Handle Arches
- Pseudo 3 centered Arches
This arch is the one which is used in most of the cases to approximate a true elliptic arch in real buildings.

4 Centered Arches
- 4 centered Arches (Tudor Arches)
- Pseudo 4 centered Arches

5 Centered Arches
An alternative to the very popular 3 centered arch. It is a bit close to a true ellipse then the 3 centered arch, but is more complex to build so is less used.
Here the tricky part was that the example in the book "Practical geometry for builders and architects" is actually wrong (I wish I knew it before trying to find what my mistake was for 2 weeks). So I had to find a correct method and it turns out there are not many available on the internet. I am stubborn though, so I found one that works perfectly.

Elliptical Arches
- Elliptical Arches with rays perpendicular to the ellipse
- Elliptical Arches with rays passing through the center
This arch was the most complex one to tackle. There is a reason after all for why builders and architect almost always adopt an approximation like the 3 centered or 5 centered arches. I confess I almost gave up on this one a couple of times. But
luckily for me Inigo Quilez was so kind to help me VERY patiently on how to obtain an approximation of the distance point-to-ellipse (it was like explaining math to a goat, with me being the goat).
It seems a simple thing but trying to solve this problem mathematically always comes down to a horrifying quartic equation (:() which in the best of cases has 1 real solution and 3 that lie on the complex plane. Inigo has a way to approximate the quartic to a cubic. I just had to translate its code to substance designer and then Bob is your uncle (but because of this approximation there are some localized spots of grainy noise in the result when the elliptic arch is getting really close to a circumference I think, nothing unsolvable later on in Substance).
More over, finding the arc length of an ellipse is possible only using the incomplete elliptic integrals of second kind. Something that at the best of my knowledge Substance Designer can not do. Therefore I could not find a way to divide the elliptic arch in equal length voussoirs. Afer a bit of research I discovered that in 2012 Aravind Narayan created an approximation for this calculation which I was actually able to read. I managed to implement it correctly but as expected it breaks down at the sides when the ellipse is really squashed, after all it is just an approximation.
To solve this, I added a parameter that can be used to fine tune the voussoirs size case by case. Of course if someone has a better solution in mind I am all ears.

Parabolic Arches
- Parabolic Arches with rays perpendicular to the parabola
- Parabolic Arches with rays passing through the center
Another difficult arch to create, although not nightmarish as the elliptic one.
For a second time I had to pester poor Inigo for help. I used his code for calculating the distance point-to-parabola, which again (if I remember correctly) approximates a quartic down to a cubic. If anything it was a bit shorter and easier to adapt.
On the other hand, finding the arc length of a parabola is, quite incredibly, very much possible. So dividing the arch in voussoirs of the same length was possible after some attempts.

Ogee Arches
- 3 centered Ogee Arches
- 4 centered Ogee Arches

Reverse Ogee Arches
- 3 centered Reverse Ogee Arches
- 4 centered Reverse Ogee Arches

Multifoil Arches
- With external arch
- Without external arch

Pointed Multifoil Arches
- With external arch
- Without external arch

By default the node generates a basic brick pattern:

But it also works with custom textures.
Here I am plugin a custom height map of a couple ornamental patterns into the node and as you can see it gets remapped along the arches.

I am so curious to see what people will do with it.
My wish would be that if you do some nice facades and gates with the Arch Generator, please share an image here and the substance on substance source so that we can all use it in our concept art :D
Last Edit: December 09, 2020, 06:45:27 pm