Dali implored fellow surrealists to appreciate this "soft and hairy" architecture of "terrifying and edible beauty". American architect, Louis Sullivan described it as "spirit symbolised in stone". And Catalan poet Joan Maragall characterised the exuberant flowering of the stone as "architectural poetry". Others, as we shall see, find it hideous..

Little wonder New Zealander Mark Burry is lost for words to describe how he felt at the consecration of Sagrada Familia in Barcelona by Pope Benedict XVI. "You pinch yourself," he says on the phone returned to Melbourne where he's based. You would. It's been 31 years since Sagrada Familia, the unfinished, polarising masterpiece of Catalan architect Antoni Gaudi, became his life's work.

The ceremony in early November raised the church to basilica - not as high as cathedral, but still something only the Pope can do. Burry caught up with the then clerk of works, now in his 80s, who he'd first met in 1979. "I said to him, 'I don't suppose in your wildest dreams you ever thought you would live to see this day', and his face sort of exploded into emotion." Burry realised that's how he was feeling too.

When I visited Barcelona in early June, a prominent British architect advised me to avoid Sagrada Familia at all costs. "It's absolute travesty," he said. But how could I? The building floats in the Barcelona skyline, as iconic to the city as the Eiffel Tower is to Paris, its eight completed bell towers like giant corn cobs encrusted with jewel-like Venetian mosaics, and immense sculptured finials of fruit erupting out of the stone as if in some fevered dream.

While Burry pinched himself, the Pope had no doubts about who was being celebrated: "We remember of course the man who was the soul and the artisan of this project, Antoni Gaudi, a creative architect and a practising Christian who kept the torch of his faith alight to the end of his life, a life lived in dignity and absolute austerity."

Gaudi was indeed a devout Christian, abstemious and a vegetarian. But he wasn't always. In his early years he was very much a man-about-town - a dandy architect - who would bark orders from his carriage window without getting out. Burry became fascinated with Gaudi, in part because of the way his architectural professors dismissed him, "because there was no school" or design style. "They just considered him to have been some kind of crazy individual with a sense of design priorities bordering on genius but with no followers," said Burry in a keynote address.

Gaudi worked on Sagrada Familia for 43 years from 1883 and focussed entirely on the project in the last 12 years of his life before he was tragically killed, run over by a tram, in 1926. Wearing his usual tattered attire, taxis drivers refused to take him to the hospital because they thought he was a beggar.

When he died three days later in a pauper's hospital the basilica was far from complete. Almost all of Gaudi's drawings and models to complete the project were destroyed during the 1930s' Spanish Civil War. Against the odds, work on the church continues and while there is still much to finish, the central nave and transept are now enclosed and the altar consecrated with holy water and chrism oil, enabling the church to be used for religious services. A congregation of 6500 people, including 100 bishops, 300 priests, King Juan Carlos I of Spain and Queen Sofia attended the inauguration, with some 50,000 following proceedings from outside the basilica.

"Not in his wildest dreams could he have imagined..." Actually Burry could - he's been imagining Gaudi's vision ever since he first fronted up, as a cocky 23 year old to the architects in charge of the ongoing construction. "I was pure Kiwi in my approach and I assumed you just rocked up and said 'Gidday'," Burry confessed in the 2009 documentary Liquid Stone.

Just graduated from Cambridge University, he'd gone to Barcelona to get material for a thesis - thinking Gaudi's masterful fusion of Moorish and Christian architecture might inform an assimilation of Pakeha and Maori architecture. "I was surprised to hear the Sagrada Familia was still being built. I had understood it had been abandoned and one thing led to another," Burry recalled in a radio interview.

Both men, Lluis Bonet Gari and Isidre Puig Boada, who had worked with Gaudi and were in their 90s, must have been taken aback by the young kiwi's dress sense. The son of All Black Hugh Burry tended to get around in footy shorts and rugby jersey and, for dress up, jeans, t-shirt and jandals.

Burry had asked two questions: What was the authority to continue with Gaudi's work?; And how did they convey instructions to the builders? Anyone familiar with Gaudi's architecture will understand the second question - his buildings are fantastical free forms, modelled on nature, organic, eccentric and of a plasticity that defies logic. They look impossible to build.

In answer to the first question the architect directors showed Burry dusty boxes of shattered plaster of Paris models for the church nave - smashed to pieces by anti-clerical anarchists who attacked the church in 1936, burning Gaudi's workshop. They asked whether Burry might like to help piecing together the Sagrada Familia jigsaw. He didn't know it at the time but he was about to become captivated by a project that would shape his career.

"As soon as you handle these models you know they are not abstract shapes that some clever sculptor has come up with," says Burry who now heads the Spatial Information Architecture Laboratory and the Design Research Institute at RMIT University, Melbourne.

"These are highly designed pieces. There is a design story there."

The problem was although everyone working on the problem knew Gaudi had a system, the grand master did it all intuitively and never wrote anything about his story. Burry became the key forensic investigator of Gaudi's modus operandi.

"For many years I was just in awe. Every time I made a new discovery I would be reminded of my own limitations. You definitely know you are working with material from somebody who is operating at a completely different level."

Burry began with what he knew - drawing bits of the model's warped curvilinear geometry using the conventional architectural projections of plan, section and elevation. He drew and drew - kilometres of fine lines with a Rotring pen.

"I realised on day four that approaching the problem as an architect was not going to get me anywhere," says Burry.

"I went home on the Wednesday of my week's probation very upset. I knew I understood the problem, but I hadn't the first idea about how I was going to tackle it."

The next morning he had a way forward. It was a memory from his childhood - sledging in mountains near Hamner Springs, a couple of hours north of his home in Christchurch.

"I realised I had seen this problem before - that the crests or ridges of mountains are where you get one surface intersecting with another. A mountain peak is lines of intersection between three or more surfaces."

Burry was now mapping Gaudi's terrain using the tools of the cartographer. Drawing Sagrada Familia's shapes was like drawing geographical contours in relief. If he could find points in space where three lines of intersection occurred - triple points - he could reverse engineer Sagrada Familia's geometries and how they combined.

Existing architectural software wasn't up to the task and still isn't for the way Gaudi worked. Burry needed something to mimic the trial and error plaster of Paris modelling Gaudi used to create structures of intersecting shapes - primarily the helicoid, hyperbolic paraboloid and hyperboloid.

He found the answer in aeronautical software - now available to architectural practices all over the world - which provides "parametric" modelling to sculpt and sew together shapes. Gaudi designed by imagining absent space - like a sculptor knowing the exact shapes to be carved off to create a sculpture.

During the consecration service, Burry was sitting in the gallery, 15 metres up where the transept crossing the central aisle meets the apse at the altar end of the church. Looking down into the nave afforded the perfect view for Burry and the design team to survey their handiwork. And watch the current director Jordi Bonet i Armengol, son of Lluis Bonet, hand the key to the building to the Pope during the ceremony.

The interior of Sagrada Familia, while similar in plan and features to Gothic cathedrals, transcends the Gothic in ways never seen before. Twisting, tree-like columns spread out from ellipsoid knots into branches supporting a forest-like canopy 45 metres high at the centre, its foliage punctuated by an array of hyperboloid openings showering light from above.

Hyperboloids - the shape of cooling towers at power stations - are just the beginning of the ruled-surface curvatures that make up Sagrada Familia's flowering ceiling vaulting, crackled with leafy gold and green mosaics.

Hyperbolic paraboloids - the saddle-like shape of Pringles chips or the web-like space between spread fingers - intersect the hyperboloids and combine with triangular planes in a geometrical composition of awesome complexity.

Gaudi, with intuitive mastery of the mathematics, would lop, truncate and bisect their forms at will, then sew them together as if he was creating a mountain range.

Despite working with a 1:10 scale model of the nave, Burry hadn't appreciated just how huge the interior would be, even filled with people - "much grander" than he'd expected and sounding, with the 650 strong choir in full voice, "very ethereal, appropriately".

Burry is not Catholic, but admits to being "spiritually inclined", interested in people congregating for the purposes of celebration.

"If people want to celebrate around things they don't fully comprehend, that seems worthwhile. I'm pleased to be involved in a building with that purpose."

The Pope told the congregation the building "stands as a visible sign of the invisible God". And that Gaudi "made stones, trees and human life part of the church so that all creation might come together in praise of God, but at the same time he brought the sacred images outside so as to place before people the mystery of God revealed in the birth, passion, death and resurrection of Jesus Christ".

When it's finished - possibly in 2026, 100 years after Gaudi's death - it will have eighteen bell towers, representing Jesus, the Virgin, the four evangelists and the twelve apostles. The three entrance facades - the nativity, passion and glory - are laden with religious sculptures; and the interior is intended as the bringing together of heaven and earth in the New Jerusalem.

The Pope's visit wasn't all celebration. Many had hoped the opening of a modern basilica in modern times would be an opportunity to signal the church as a modern institution. It wasn't to be. A flashmob of gay and lesbian couples greeted the Popemobile with a kiss-in and while there were plenty of Vatican flags of welcome there were also red banners reading: "The woman decides to be a mother" and "Condoms save, the pope damns".

At the start of his visit the Pope compared the "aggressive lay mentality, anticlericalism and secularisation" of modern Spain to that of the 1930s, when the church suffered a wave of violence and persecution as the country lurched from an unstable democracy to civil war. That drew counter arguments.

An editorial in Spain's left-leaning newspaper El Pais declared: "There are fewer people keen on this Catholic Church that on so many issues lives in the past, and prefers dogma to reality."

Commentator Juan G. Bedoya wrote: "The state spends €6 billion each year to finance Catholic activities (schools, religion classes, reconstruction of churches, bishops' salaries). Is that aggressive secularism or a threatening anti-clericalism?"

There was symmetry to the arguments. Under the socialist government of Prime Minister Jose Luis Zapatero, Spain has become more secular - legalising abortion and same-sex marriages, easing divorce laws and dropping religious education from the national curriculum.

During the anti-clerical period of the 30s, Sagrada Familia was seen as a way to counter the forces of atheism, scientism and disobedience - the excesses of democracy - that were besieging the church. It was during that period Gaudi's workshop was sacked but it was also a time when the church was aligned with the dictatorship of General Francisco Franco.

"The purpose of the building was to profile Joseph, the father of Christ, the patriarch," says Burry.

"One of the driving forces for it was to try and confront the social dysfunction that was beginning to appear through the rapid industrialisation of Barcelona as a city and the fracture of family life."

In 2010, at the consecration, the Pope was beating the same drum, defending the traditional family in a thinly veiled criticism of same-sex unions and abortion.

"The generous and indissoluble love of a man and a woman is the effective context and foundation of human life in its gestation, birth, growth and natural end."

After the Pope had burned incense and spread consecrated oil to the four corners of the altar, four nuns in black mopped up the remnants and four more dressed the slab with fresh linens. It was the only time women appeared in the ceremony.

Sagrada Familia's full name is the Expiatory Temple of the Holy Family which means it's a church intended to allow for the atonement of sins through sacrifice. Gaudi, with his extreme asceticism, was just the man for the job. The idea of sacrifice is expressed in the white marble pelican in the nativity facade - a bird that will peck at its breast in order to feed its young with its own blood during difficult times.

"Everyone has to suffer," Gaudi once told a disciple.

"The only ones who don't suffer are the dead. He who wants an end to suffering wants to die."

In this sense Gaudi intended Sagrada Familia as a place where faithful Catalans and others would converge to do penance for the sins of modernity.

In some ways that has happened - the building is funded entirely by public donations and the entry fee charged to some 2.5 million annually who queue for hours to visit.

While the faithful may visit to expiate sin and others may see Catholic propaganda in stone, many are drawn to building for something else. That's led critics to compare Sagrada Familia to a visit to Disneyland. El Pais columnist Manuel Vicent wrote in November: "The only saving grace, if any, of the Temple of the Sagrada Familia, was the fact that it was unfinished, the dream of a genius driven crazy by mystic reveries. Now it will be completed with the money of tourism, and when its walls are finally enclosed, there will be no one inside but Japanese tourists."

Burry is not impressed: "I don't understand what is Disneylandish about going to a giant church space. There are no rides or distractions there - there is some motivation to go there other than just the thrill."

Well, tourists can take a lift to the top of one of the bell towers of the Passion facade and then descend on foot the narrow helicoid staircase in another tower stopping occasionally to peer precariously over balconies to the city below - not exactly Pirates of the Caribbean but negotiating the sculptural sights, pagan-like sensuality and hive of construction activity along the way is quite a trip.

Much of the criticism of Sagrada Familia has centred on whether the building should ever have been completed.

Observer critic Deyan Sudjic wrote in 2002: "The trouble is that it looks more like a cathedral conceived by a set builder for a Batman film, than by Gaudi at his most creative."

He joined a parade of naysayers: Spanish surrealist Salvador Dali suggested the church should have been left under a glass dome; Australian art critic Robert Hughes said: "Almost everything that has been done in the '70s and '80s is rampant kitsch."

George Orwell described Sagrada Familia as "the most hideous building in the world" and thought the Anarchists showed bad taste in not blowing it up during the Civil War.

As we have seen there is also a long line of Gaudi fans. With the completion of the interior has the criticism died down? Burry says it's still trenchant.

On the Friday after the opening Catalonia's leading daily newspaper La Vanguardia invited famous architects to comment on the building. Some who criticised it in the past had changed their minds. Most were unmoved.

Architect Beth Gali wrote: "If the current Temple architects had understood Gaudi the work would be more refined. Now it seems robotics produced by a robot." Which is partially correct - the stonemasons at Sagrada Familia today use high-tech robot stone cutting equipment. And much of the modelling has been done direct from the computer to 3D wax printers to allow rapid prototyping of individual stones.

Enric Massip wote: "Es un espacio anabolizado, siliconado, carente de alma" - an artificially inflated space lacking in soul. And Robert Terradas could not see the spirit of Gaudi in the work.

But others point out that the building of cathedrals has always passed from generation to generation and in the process adapts to the times. Another said continuing the work was fine as long as it was clear that what was being done was not the work of Gaudi, but that of his successors.

"The funny thing is that none of us, not even the director, would claim the building as personal project," says Burry who is fluent in Catalan.

"We're all individually happy with our contribution but none of us would ever claim authorial credit for the building."

Burry, who collaborates in parametric design with leading architectural firms around the world, has no doubts the continuation of Sagrada Familia is true to Gaudi's vision. His evidence resides, as it did 31 years ago, in the models and a few remaining drawings Gaudi left behind. Plus a conviction that Gaudi had always expected the building would be finished by others who would bring their own skills and vision to the job.

The clearest example of an authorial presence other than Gaudi is seen in sculptor Josep Maria Subirachs' stark Passion facade with its angular Christ on the cross. Sculptures which seem alien to Gaudi's flowing naturalistic style of the Nativity facade and which have copped a lot of flak - especially Subirachs' decision to include the genitals on a sculpture of Christ.

"This sculptural mess is the logical consequence of the architectonic mess made by the false continuers of Gaudi," wrote Barcelona architect Oriol Bohigas in 1990.

Looking at Gaudi's one surviving drawing of the facade, it's clear he intended a stark skeletal quality. Burry sends a photo of one of the 18, nine metre stone columns about to be installed over the colonnade. Bone-like, organic and shaped like liquid stone it is pure Gaudi and then some. Each column follows the Gaudi codex unlocked by Burry and others over the last 30 years - comprising a hyperboloid with four hyperbolic paraboloids intersecting seamlessly top and bottom.

"Gaudi never built a column like that," says Burry. "We've used the geometries in a way he has used surfaces before, but I doubt even in a month of Sundays he would be able to make the column this way."

To make the different geometries come together Burry needed a mathematician for the simultaneous equations of the intersections and a parametric model to tinker with the final look. That fell to his partner Jane, with whom he's just written a book, The New Mathematics of Architecture.

"I'm not going to go round saying those are my columns," says Burry.

"Jane could claim one of the world's most complex pieces of parametrically associative geometry, but she is not going to do that either. What we have done is mapped out how we might get the effect of the column that's in Gaudi's drawing."

Still finding ways to build the impossible.

Chris Barton visited Barcelona last year as part of his Qantas Wolfson Press Fellowship at Cambridge where he researched architecture journalism.