# city shapes to rectangles

## Recommended Posts

Hi

I need some help from the guys with the big brains .

I have some complex Shapes from osm data inside houdini.

So i want create some buildings out of this shapes .But the complexity

of this polygons complicate the procedural modeling a lot.

So it would be so much easier , if i have just rectangles or kind of rectangular

Shape. So have someone an Idea how to achieve this ?

It dont have to be total accurate.

Read a lot about packing and packing Problem , but have to say that these Papers with 30 Pages of formulas

##### Share on other sites

well for a quick/dirty result try:

• a divide node set to remove unshared edges
• Hole that result
• facet that with remove inline points enabled
• divide that result with "avoid small angles" enabled

That probably gives you something slightly better to start from (if you haven't already)

After that there are multiple options, but none of them are super straightforward (hence the 30 page papers :P)

Personally I would probably go with some Attribute wrangle to find the corners that I want to use and then dissolve all the edges that are less useful,
then divide again and maybe repeat those steps a couple of times.

Tbh, I am also not super sure what I would do, but it does look like an interesting challenge

Edited by acey195

##### Share on other sites

very cool topic! Looks like some kind of "convex decomposition". Might be possible to approximate that with
recursive levels of voronoi fracture SOPs (in a for each).

##### Share on other sites

Here is a an example File from my Scene.

I converted the osm Files to a Obj with osm2World because i cant find a better script/tool to get all the stuff from a osm file(<relation v=multipolygon).

@acey195 this is excatly what i tried, but didnt get a accectable Result.

"convex decomposition" sounds great. I will read some stuff

I still found no proper solution, so if someone has fun with this stuff ,  i would be so happy.

##### Share on other sites

Hi

I found this very  interesting stuff vhacd4h

Has someone compiled it already ?

##### Share on other sites

not sure if it helps but the attached file is a simple implementation of a 2d convex decomposition. it´s far from being production-ready but might be a good start ...

petz

• 2

##### Share on other sites

Very cool @petz!
just for fun, I tried a SOP solver approach, very brute force but good for packaging squares
just a "fill" method on one square at a time, if it's not square of filled enough, move to another area ...
converting the points to a shape needs a lot of work...

I

using the osm map with a bit of cleanup of the edges and some random extrusion...

Edited by bunker
• 2

##### Share on other sites

Wow thank you very much. Looks very promising

I'm living here in the stoneage and it will take some time to rebuild your stuff in Houdini 13.

##### Share on other sites

no problem, should be the same in H13, wrangle nodes have been introduced in H12.5
would be cool to see what you do with it, if you can post it...

##### Share on other sites

One of the expected problems may occur due to VOP SOP implementation of early Point Wrangle. Some variables use different names. Another one is that VEX library was about two times smaller. For example getpointbbox function was added in H14. But getbbox must be and do similar job there. It returns different results for non-polygonal geometry, where surface are not fully bound with points.

Edited by f1480187

##### Share on other sites

nice file julien!

if you just want to fill or rather divide the polygon into smaller axis aligned parts you could also recursively clip it, similar to binary partitioning.

• 2

## Create an account

Register a new account