SketchUcation Plugin Store

 

 

[Plugin] Flatten Vertices v1.1

[Plugin] Flatten Vertices v1.1

Postby bentleykfrog » Sun Aug 07, 2011 3:51 am

Flatten Vertices will move all vertices in the selection so they all have a z position of 0. Just select your edges you want to flatten and go Plugins->Flatten Vertices->To Z=0.

In this update I've included a method to flatten vertices based on the average normal of all the selected faces. Select your faces you want to flatten and go Plugins->Flatten Vertices->To Mean Normal.

Known Issues:
Currently the script doesn't preserve the edge conditions (ie, if outside the edge of your selection there's a non-triangular surface the surface will most likely be removed when you run this script. Try triangulating surfaces with TIG's triangulateFaces.rb first then run Flatten Vertices).
Please, register (free) to access all the attachments on the forums.
bentleykfrog
 
Posts: 84
Joined: Thu Sep 10, 2009 2:27 am
Location: Adelaide, Australia
Name: Niall Campbell

Re: [Plugin] Flatten Vertices v1.1

Postby Brodie » Wed Aug 10, 2011 9:41 pm

TIG recently developed a very similar ruby

viewtopic.php?p=346754#p346754

-Brodie
Hardware: Intel i7 980x 3.33 Ghz 6-Core Processor
nVidia Quadro FX 3700 512Mb, 18.0 G RAM
Software: Maxwell 2.5, SketchUp 8, 3ds Max 2011, Vray, Adobe CS5, AutoCAD 2007, Windows 7 64-bit
User avatar
Brodie
Top SketchUcator
 
Posts: 1345
Joined: Mon Mar 10, 2008 11:33 pm

Re: [Plugin] Flatten Vertices v1.1

Postby bentleykfrog » Thu Aug 11, 2011 9:39 am

Brodie wrote:TIG recently developed a very similar ruby

viewtopic.php?p=346754#p346754

-Brodie


Thanks brodie, I initally wrote v1.0 in 30 minutes that simply flattened vertices to z=0, posted it to the forum, then noticed TIG's drop vertices. With v1.1 I thought I'd take the development in a different direction with Flatten to mean normal, which works similar to TIG's scripts but my focus is on replacing the Z vector with the average normal of all the faces selected. I don't want to butt heads with TIG as he's quite a deal more talented than I. :oops:

In the next version I'm working on ways to preserve the edge conditions, so the script doesn't destroy four or more sided faces. The method I'm thinking of using considers edge conditions as 2 dimensional manifolds (so rotate along the border edge away from the border face's normal until you find a face that isn't in the selection). The normal determines the direction of rotation to avoid the angle_between not greater than 180 degrees issue. We rotate away from the normal to find the next face because there may be more than two faces sharing a border edge. This (hopefully) will remove interference by more than two faces sharing the same edge. This method also shows some promise for applications like correctly orienting faces and removing internal geometry on non-solid geometry, but more grey matter is required on my part. Hopefully all's not lost :D
bentleykfrog
 
Posts: 84
Joined: Thu Sep 10, 2009 2:27 am
Location: Adelaide, Australia
Name: Niall Campbell

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Need SketchUp Books, Models, Styles or Textures? Check out our One Stop Shop for SketchUp.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012


Return to Plugins

Who is online

Users browsing this forum: ayi1991, Bing [Bot], emesea, james2fpwill1984, juanlunaaa12, saher.joubran, sasan, sun55085508, thach, yuceleryilmaz and 8 guests