3 posts • Page 1 of 1
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.
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.
TIG recently developed a very similar ruby
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
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.
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
3 posts • Page 1 of 1