SketchUcation Plugin Store

 

 

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

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

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.
Please, register (free) to access all the attachments on the forums.
Last edited by thomthom on Tue Nov 10, 2009 9:22 pm, edited 1 time in total.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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.)
remus
 
Posts: 8055
Joined: Fri Nov 30, 2007 8:48 am
Location: UK
Name: 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...
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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

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

:oops:
remus
 
Posts: 8055
Joined: Fri Nov 30, 2007 8:48 am
Location: UK
Name: remus

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

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

No worries! :D ;)
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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
dtrarch
Premium Member
Premium Member
 
Posts: 343
Joined: Tue Nov 13, 2007 8:03 pm

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?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14307
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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...)
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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 ???
TIG
User avatar
TIG
Global Moderator
 
Posts: 14307
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14307
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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

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

Flat land ;)
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10207
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced

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:
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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... :)
kwistenbiebel
 
Posts: 2681
Joined: Thu Nov 22, 2007 6:13 pm

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
dtrarch
Premium Member
Premium Member
 
Posts: 343
Joined: Tue Nov 13, 2007 8:03 pm

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:
purpose/expression/purpose/....
User avatar
utiler
Top SketchUcator
 
Posts: 1934
Joined: Wed Nov 14, 2007 11:35 am
Location: Queensland, Australia
Name: Andrew
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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??
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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 :)
gavvy
 
Posts: 48
Joined: Sat May 17, 2008 3:34 am

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.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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
gavvy
 
Posts: 48
Joined: Sat May 17, 2008 3:34 am

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.
;)
Gai...
User avatar
Gaieus
Administrator
 
Posts: 27722
Joined: Sat Oct 20, 2007 8:24 am
Location: Pécs, Hungary
Name: Csaba Pozsárkó
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: historical reconstruction
Level of SketchUp: Advanced

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?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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
dtrarch
Premium Member
Premium Member
 
Posts: 343
Joined: Tue Nov 13, 2007 8:03 pm

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"?
Please, register (free) to access all the attachments on the forums.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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.
Gai...
User avatar
Gaieus
Administrator
 
Posts: 27722
Joined: Sat Oct 20, 2007 8:24 am
Location: Pécs, Hungary
Name: Csaba Pozsárkó
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: historical reconstruction
Level of SketchUp: Advanced

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!
;)
Gai...
User avatar
Gaieus
Administrator
 
Posts: 27722
Joined: Sat Oct 20, 2007 8:24 am
Location: Pécs, Hungary
Name: Csaba Pozsárkó
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: historical reconstruction
Level of SketchUp: Advanced

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)
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10207
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced

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.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17894
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Not a Premium Member yet? Check out the great time-limited deal we are offering.

Ad Machine
Robot
 
Posts: 2012

Next

Return to Plugins

Who is online

Users browsing this forum: dizain, DOD3R, rodman100 and 12 guests