Convergence

How to calculate hipped/gabled roofs from outline coordinates?

Recommended Posts

For my new project I  ideally need to be able to create simple hipped, gabled, and pointed from any arbitrary shape given (by JSON). Pointed and dome roofs are easy enough since the shape just converges to one point upwards, but I can't figure out gabled and hipped roofs just yet.. See attachment for a visual.

Does anyone have any idea how to do this? The input would be an array of (clockwise) Vector2's describing the outline of the building.

 

hipped-roofs.jpg

 

Here's a PG to play with, obviously I didn't find any solution yet myself :)https://www.babylonjs-playground.com/#AT8MET

Share this post


Link to post
Share on other sites

Interesting problem. If the input must be the roof/gutter outline, then the first question would be how to (automatically) determine which edges are to be gabled and which are not. Similarly, if we look at your example outline, how would we determine that the "large rectangle" is indeed to be treated as one roof section. It might be better (if possible) to use separate overlapping rectangles to specify roof sections, rather than an arbitrary compound outline shape, although that might be just moving the problems elsewhere.

I'd be tempted to look at some of those 3D home design software packages (e.g. the source code for the open-source Sweet Home 3D http://www.sweethome3d.com/) to see how they handle it (if they even can).

Share this post


Link to post
Share on other sites
On 11/7/2017 at 4:42 PM, JohnK said:

Have done it for the shape given but it requires the individual calculation of roof points depending on building outline and a custom mesh.

https://www.babylonjs-playground.com/#AT8MET#1

As others have said more difficult to produce a function to deal with building shape.

Have any idea about building the roof for given different shapes (building shapes)?

Share this post


Link to post
Share on other sites

@thamali

Sub-divide your extruded "roof" mesh (or add additional vertices at mid-point or other positions) and translate the additional vertices along the positive y axis. You'll be able to create far more interesting shapes this way.

DB

Share this post


Link to post
Share on other sites

@dbawel Actually I don't know how to extrude points in order to build shapes. What I have is outer coordinates of house

I have drawn houses like below;

I need to create the  gable roof of these houses at run time. Please give me a guidance

 

1111.JPG

2222.JPG

Share this post


Link to post
Share on other sites

All I did was to look at the roof diagram that Convergence provided, calculate the vertices from the diagram, divide into triangular facets and create a custom mesh. So starting from roof 'footprint' sketch out your roof and do the same.

Share this post


Link to post
Share on other sites
2 hours ago, JohnK said:

All I did was to look at the roof diagram that Convergence provided, calculate the vertices from the diagram, divide into triangular facets and create a custom mesh. So starting from roof 'footprint' sketch out your roof and do the same.

If you can, please give me further explanation cuz I'm very new to this.

Share this post


Link to post
Share on other sites

@tham_kathy as it says in the docs

Quote

A footprint is a sequence of consecutive corners in counter clockwise order

and

Quote

Each roof plane can be described using the corner and apex labels. The planes should be draw so that they are described with either 3 or 4 labels. Each plane is set as an array using the labels in a counter clockwise order with corner labels coming first. Remember that the corner labels are already in counter clockwise order.

You have given the base data in clockwise order. Reversing the data pairs and relabeling the planes to match this new order gives https://www.babylonjs-playground.com/#RVPAJ4

To change an existing playground just edit and save, the playground number will just increase to the next available number, real easy.

Share this post


Link to post
Share on other sites
2 hours ago, tham_kathy said:

What about planes that have labels more than 4

Add an extra corner (even though it will not be a real corner) on the top edge and split into two planes.

Share this post


Link to post
Share on other sites

Please remember that the Gamelets are demonstrations of what is possible  with Babylon.js and how different idea can be achieved. They are starting points not a finished product. You need a line that extends one of the existing lines onto the roof edge to split the plane with five sides.

roofplus.thumb.jpg.b2b9183109e5003a698752776a4f5dc5.jpg

and then re-label. This PG gives the idea though the actual numbers for the new 'corner' are not totally accurate http://www.babylonjs-playground.com/#4GBWI5#108

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.