[Plugin] Flatten and Extrude

[Plugin] Flatten and Extrude

Postby thomthom » Tue Nov 10, 2009 3:09 pm

Overview
I often get tasks to model terrain and context buildings for project we do. It's dog boring work!
Today when I got a new such project with a large plan I thought there had to be a better way to do most of this repetitive work. So I wrote a crude script to lessen some of my burden.

The purpose of this script was just to get the bulk work done. Don't expect any magic from it.

Note: Result will vary from the quality of the lines you feed it. I've just mocked this up to get a job done - so the UI is crude. I want to get back to this later and provide a better interface. But until them; this is it.

Menus: Plugins->Flatten->...


Functions
Flatten
(Only takes a single group or component as input at the moment, sorry.)
Creates a new group where all the edges in the selected Group or Component is projected down to the Ground (Elevation 0).
Flatten-Flatten.png


Flatten and Extrude
(Only takes a single group or component as input at the moment, sorry.)
Same as flatten, but it then tries to extrude the faces back up to the lowest/highest point above it.

Note that there is a layer filter where the plugin will only use the edges on layers containing that filter. The filter is a series of strings separated by | (pipe character).

(Yes, I know. The settings isn't persistent. Will see if I can get around for a quick update for that later. Until then - modify line 120 yourself.)
Flatten-Extrude.png


Smart People!
Does anyone have any idea of how to generate roofs? Not generic roofs, but ones that fit the roof edges.

Download

1
Last edited by thomthom on Fri Nov 29, 2013 12:20 am, edited 2 times in total.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby remus » Tue Nov 10, 2009 3:17 pm

For the roofs, perhaps have a look at TIGs roof script. I imagine itd be fairly easy to filter all the horizontal faces that have some z then apply TIGs roof stuff to it with some generic/random values plugged in (depending on what sort of results your after.)
0

remus 
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Tue Nov 10, 2009 3:31 pm

remus wrote:For the roofs, perhaps have a look at TIGs roof script. I imagine itd be fairly easy to filter all the horizontal faces that have some z then apply TIGs roof stuff to it with some generic/random values plugged in (depending on what sort of results your after.)

thomthom wrote:Does anyone have any idea of how to generate roofs? Not generic roofs, but ones that fit the roof edges.
;)

Making generic roofs is the current work around. But being able to produce roofs from the CAD lines would be really cool. I don't expect perfect roofs, but at least some approximation.

One possible alternative would be to get the height of the roof from the CAD lines and make a generic roof from that...
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby remus » Tue Nov 10, 2009 4:00 pm

:oops:
0

remus 
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Tue Nov 10, 2009 4:02 pm

No worries! :D ;)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby dtrarch » Tue Nov 10, 2009 5:00 pm

TT

How about using TIG's Height/datum tool to set Z with your new tool.
Hmmm?

dtr
0

dtrarch 
Premium Member
Premium Member
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Tue Nov 10, 2009 5:02 pm

dtrarch wrote:TT

How about using TIG's Height/datum tool to set Z with your new tool.
Hmmm?

dtr

Set Z? What you mean?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby TIG » Tue Nov 10, 2009 8:03 pm

My Datum tool sets a 'Z' datum in your model [as an attribute] so when z=0 z_datum=123.456m or whatever. Then you use the tool to add text to refer to a point so that floors or points on an elevation etc are given their corrected height above 'datum', rather than z=0...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Tue Nov 10, 2009 8:06 pm

Ok - but how does that relate to this plugin? (I'm confused...)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby TIG » Tue Nov 10, 2009 8:10 pm

I surmise he means instead of flattening everything to z-o allow you to set it to flatten to z=123.456m. Easy done as it's in a group - flatten all to z=0 end with an option to enter a new z or pick a point and move the flattened group up/down to suit the desired z ???
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Tue Nov 10, 2009 8:15 pm

TIG wrote:flatten all to z=0 end with an option to enter a new z or pick a point and move the flattened group up/down to suit the desired z ???

That would move the top above the lines it extrudes up to. But it's just as easy to just to flatten down to a given Z level.

Anyway - thanks for clearing that up. Will see if I'll be adding that in the future.
Btw, does your Z-Level plugin expose the Z Height publicly? Wondering if I can read the value and use that as default if present.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby TIG » Tue Nov 10, 2009 8:19 pm

Frankly I'd keep them separate...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby pilou » Tue Nov 10, 2009 11:44 pm

Flat land ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Tue Nov 10, 2009 11:50 pm

Pilou wrote:Flat land ;)

Someone's been snooping in the code, eh? :D It just so happened to be the last book I read. :ugeek:
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby kwistenbiebel » Wed Nov 11, 2009 12:02 am

Nice idea thomthom. Things are busy now, but I will try the plugin in depth at the weekend.
For architects this is extremely useful!
Now I don't have to ask the Rhino guy to do it for me and to import it in SU ;)

By the way,
I love the CookieWare idea! Whenever you're in Australia, please drop by for a beer... :)
0

kwistenbiebel 
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby dtrarch » Wed Nov 11, 2009 12:30 am

I yield :knockout:
Just thought that muli-level flat and extrude might be a possible for structural elements and such.

tt many thanks in any case :enlight:

dtr
0

dtrarch 
Premium Member
Premium Member
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby utiler » Wed Nov 11, 2009 12:55 am

kwistenbiebel wrote:Nice idea thomthom. Things are busy now, but I will try the plugin in depth at the weekend.
For architects this is extremely useful!
Now I don't have to ask the Rhino guy to do it for me and to import it in SU ;)

By the way,
I love the CookieWare idea! Whenever you're in Australia, please drop by for a beer... :)



Some nice boutique breweries over there, kwist......
After you've had a few beers with kwist, Thom fly across the other side of the country and I'll shout you a few also!!! :thumb:
0
purpose/expression/purpose/....
User avatar
utiler 
Top SketchUcator
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Wed Nov 11, 2009 8:22 am

kwistenbiebel wrote:Now I don't have to ask the Rhino guy to do it for me and to import it in SU ;)

Rhino has a function like this??
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Wed Nov 11, 2009 8:23 am

dtrarch wrote:I yield :knockout:
Just thought that muli-level flat and extrude might be a possible for structural elements and such.

tt many thanks in any case :enlight:

dtr

Multi-level flat and extrude? Could you care to explain more what you got in mind?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby gavvy » Thu Nov 12, 2009 3:59 am

thomthom
:roll:
I tride this plugin .The groups in the group can't be faltten
Is it a better idea to flatten the group in group,and hold the group of faces?

to build a city ,i always use clf_greeble_2.rb :)
0

gavvy 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Thu Nov 12, 2009 8:20 am

Currently it doesn't dig into nested groups. It only works on the edges directly inside the selected group/component.
Will change that later.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby gavvy » Thu Nov 12, 2009 10:15 am

thomthom wrote:Currently it doesn't dig into nested groups. It only works on the edges directly inside the selected group/component.
Will change that later.

:)
zorro tool is a good EXAMPLE
0

gavvy 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby Gaieus » Thu Nov 12, 2009 2:21 pm

Hm. My city has just stopped at 31% (and SU is unresponsive). But I gues there are limitations also (file size and edge count) so maybe I shouldn't be so eager and clean the file up a bit before I try.
;)
0
User avatar
Gaieus 
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Thu Nov 12, 2009 2:27 pm

Gaieus wrote:Hm. My city has just stopped at 31% (and SU is unresponsive). But I gues there are limitations also (file size and edge count) so maybe I shouldn't be so eager and clean the file up a bit before I try.
;)

Can you send me the model for debugging?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby dtrarch » Thu Nov 12, 2009 5:52 pm

TT
It seemed useful to be able to flatten selected objects (groups components etc) to adjusted (TIG's)heights above default Z height zero.
Then select and extrude +/- as wanted.
A multi-Z height selection.
Just an idea for consideration.

dtr
0

dtrarch 
Premium Member
Premium Member
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Fri Nov 13, 2009 11:08 am

roof-builder.png


Been trying to find a way to triangulate Roofs from 3d plans. Will never be perfect, but "good enough" to do the bulk work and get a rough idea of the shape.

Think the name of this plugin isn't fitting any more. It's doing much more building than flattening. "BuildUp"?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby Gaieus » Fri Nov 13, 2009 11:18 am

thomthom wrote:...Can you send me the model for debugging?

Sure - see your PM (when I finish this post). But in fact, the file is still a mess as everything is connected with everything (street ends for instance are "closed") and also it's a rather large piece of the city (and where I cut it out from the whole city plan, there are a bunch of open ends, too) so no wonder it didn't really work.

Wherever I cleaned up a bit and grouped separately, it worked just fine.
0
User avatar
Gaieus 
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby Gaieus » Fri Nov 13, 2009 11:20 am

And the roofing also looks promising!
;)
0
User avatar
Gaieus 
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby pilou » Fri Nov 13, 2009 1:34 pm

you have a very cool roof maker from flat plan and many more roofs actions in 1001bit ;) (expand the roof menu)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Flatten and Extrude (1.0.1) — 10 November 2009

Postby thomthom » Fri Nov 13, 2009 1:39 pm

Pilou wrote:you have a very cool roof maker from flat plan and many more roofs actions in 1001bit ;) (expand the roof menu)

True, but that's a generic roof. All the existing roof tools make generic roofs. This is to generate accurate-ish roofs from 3D plan data.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: No registered users and 8 guests

Visit our sponsors: