[Plugin] Drop Vertices

[Plugin] Drop Vertices

Postby TIG » Sat Aug 06, 2011 2:39 pm

Copyright 2011, TIG (c)
Permission to use, copy, modify, and distribute this software for any
purpose, and currently without fee, is hereby granted, provided that
this text and the above copyright (c) notice appear in all copies.
This software is provided "as is" and without any express or implied
warranties, including, without limitation, the implied warranties of
merchantability and fitness for a particular purpose.
###
Name: dropverts.rb
###
Menu: 'Plugins' > 'Drop Vertices...' >
'To Nearest Object'
'To Nearest Below'
'To Nearest Above'
'To Nearest+Z=?'
'To Lowest'
'To Highest'
'To Middle'
'To Average'
'To Z=?'
'To Z=%'
###
Usage:

Preselect the edges where you want vertices to 'adjust', choose tool...

'To Nearest Object' means all of the edges' vertices will 'drop' on to
the 'objects' below them, OR 'lift' to the 'objects' above them if there
was nothing below, or to Z=0 if there is nothing above/below.

'To Nearest Below' means all of the edges' vertices will 'drop' on to
the next 'object' below them, or to Z=0 if there is nothing below.

'To Nearest Above' means all of the edges' vertices will 'lift' up to
the next 'object' above them, or to Z=0 if there is nothing above.

'To Nearest+Z=?' means you enter the default drop Z value in a dialog
and it then does the equivalent of 'To Nearest Object' BUT stops at
the specified Z value [rather than Z=0] is nothing is above/below.

'To Lowest' means all of the edges' vertices will 'drop' to match the
Z value of the lowest selected vertex.

'To Highest' means all of the edges' vertices will 'lift' to match the
Z value of the highest selected vertex.

'To Middle' means all of the edges' vertices will 'adjust' to match the
mid Z value between the highest and lowest selected vertices.

'To Average' means all of the edges' vertices will 'adjust' to match the
average Z value of all of the selected vertices; this is not necessarily
the same as 'To Middle' as a disproportionate number of low vertices
in the selection will reduce the average but not affect the mid value.

'To Z=?' means a dialog asks for the Z value; enter a number to use
current-units e.g. 123 might be 123" or 123mm depending on the model's
current units; to use something other than the current units suffix the
number thus '123mm' to use 123mm when your units might be in 'meters':
the vertices will all adjust to that specified Z value: default Z=0.

'To Z=%' means that a dialog asks for the % [Percentage]; enter a
value: the default is 100 which means 'no change': entering a smaller
value, say 50, will adjust each selected vertex to be 50% its height
above the lowest selected vertex [i.e. the mesh is 'deflated']; entering
a higher value, say 150, will adjust each selected vertex to be 150%
its height above the lowest selected vertex [i.e. the mesh is
'inflated']; entering 0 will completely 'flatten' the mesh to the level
of the lowest selected vertex [equivalent to using 'To Lowest'];
entering negative values will 'flip' the mesh - so -100 will invert it,
-50 will invert it and deflate it, and -150 will invert it and inflate
it.

###
Donations: PayPal.com to info @ revitrev.org
###
Version:
1.0 20110806 First issue.
1.1 20110807 Nearest-Below/-Above, Middle/Average and Z=% options added.
1.2 20110807 Nearest+Z=? option added.
1.3 20110810 Glitch with Lowest/Highest/Middle fixed.
2.0 20150422 Glitches with dropping curves resolved.
###
dropverts.rb

dropvertsExamples.PNG
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby Rich O Brien » Sat Aug 06, 2011 3:01 pm

Excellent
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby Rich O Brien » Sat Aug 06, 2011 3:17 pm

0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby TIG » Sat Aug 06, 2011 3:35 pm

Thanks Rich [he's now my official my publicist! ;) ]
:D
That's also a nifty tool you have that's showing the Tools being used 'on-screen' - what is it?
;)
Hope this is a useful tool - feedback please...

:enlight: Incidentally... when a mesh's 'corner' drops as a 'flat-square', whilst some other seemingly identical corners drop to a nice 'point' it's because the mesh's diagonal at that corner is 'across' the corner so it is the correct result. If you don't want that you can undo the 'drop' and then set "View > Hidden Geometry > ON" and use the 'Sandbox Tool' > 'Flip Edges' to swap the problem diagonal[s] to arrive at the 'apex' of the corner[s]; then just redo the 'Drop Vertices' to get all 'pointy' corners [OR of course do the reverse to avoid any 'pointy' corners at all :roll: ]... :D
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby Rich O Brien » Sat Aug 06, 2011 3:45 pm

This deserved a little video I thought. Especially for those inclined not to read your blurb.

That's also a nifty tool you have that's showing the Tools being used 'on-screen'


Something I cobbled together called 'Onscreen Rolling Reel' but it's very buggy at the moment and being unemployed I've no time to sort the code :roll:

You actually missed the other hidden gem I used in there....SplitUp ;) again a nifty tool that's buggy as bejaysus :roll:
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby TIG » Sat Aug 06, 2011 3:55 pm

images.jpg
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby mitcorb » Sat Aug 06, 2011 4:22 pm

@TIG:
First of all, an excellent script. I applaud your generosity.

Your " :enlight: Incidentally..." paragraph above refers to the end frame image in Rich's video, right hand corner of the model, am I correct?

@Rich: Thank you for the excellent video tutorial.
0
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb 
Top SketchUcator
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby TIG » Sat Aug 06, 2011 4:34 pm

These 'flat' corners are simply a result of the mesh's diagonals at its corners.
My 'flip' tip was how to avoid it [or indeed ensure it]... and 'cut off the complainers at the pass...' ;) - because it's only doing what it's been told...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby EarthMover » Sat Aug 06, 2011 4:43 pm

Very nice TIG!!!! This is a much needed plugin! :thumb: :thumb: As soon as I get some paying work again, I'll definitely drop a ten spot in your paypal account!
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby jorge2011 » Sun Aug 07, 2011 12:38 am

Thanks for this new tool, Mr. tig, is very useful.
-------------------------------------------------
Mr. Rich O'Brien.
Where I can download the plugin split up?
0

jorge2011 
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby Rich O Brien » Sun Aug 07, 2011 1:01 am

You can't
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby jorge2011 » Sun Aug 07, 2011 1:11 am

Excuse me, but I do not understand.
Does not exist plugins? payment is a plugin?
0

jorge2011 
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby Rich O Brien » Sun Aug 07, 2011 1:16 am

Sorry, but it's not available. Maybe in the future?
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby rv1974 » Sun Aug 07, 2011 6:35 am

And practically, what one could model with this ruby?
What's the aim?
0

rv1974 
 

Re: [Plugin] Drop Vertices v1.0 20110806

Postby Bob James » Sun Aug 07, 2011 7:53 am

rv1974 wrote:And practically, what one could model with this ruby?
What's the aim?

This:

http://forums.sketchucation.com/viewtopic.php?f=15&t=39224
0
i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60
User avatar
Bob James 
Premium Member
Premium Member
 

Re: [Plugin] Drop Vertices v1.1 20110807

Postby TIG » Sun Aug 07, 2011 2:36 pm

Here's v1.1 viewtopic.php?p=346754#p346754
Several additional features added - please read first post...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Drop Vertices v1.1 20110807

Postby EarthMover » Sun Aug 07, 2011 4:21 pm

TIG, would it be possible to add an option which is drop verts to =Z /to intersect. Meaning if you had the subdivided plane above, let's say a smaller box, then all verts would drop to the specified Z, except where they intersected with the box. Perhaps adding a "Drape Verts" choice to the submenu. It would essentially do what drape Cpoints and triangulate does, but with a predefined mesh.

Thanks for your work on this again. The new features are great. :thumb:
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] Drop Vertices v1.1 20110807

Postby TIG » Sun Aug 07, 2011 4:28 pm

I'll look at adding 'To Nearest + Z = ?' too... It should be too difficult...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby TIG » Sun Aug 07, 2011 5:13 pm

Here's v1.2 viewtopic.php?p=346754#p346754
'To Nearest+Z=?' option added for 'draping' whole mesh over objects.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby EarthMover » Sun Aug 07, 2011 5:23 pm

Wow, that was fast! :sketchstatic: I'll give it whirl and let you know how it works.
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby EarthMover » Sun Aug 07, 2011 5:50 pm

A quick play. Works great! Thanks again. :thumb: This will be great for retopology of high poly terrain data or terrains made with From Contours!

0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby JClements » Sun Aug 07, 2011 6:13 pm

Thanks, TIG! This should remedy some problem issues with the Smooth Tool in Sandbox where the boundary edges can't be anchored to their existing Z location.

1- Wondering about having functions similar to DropVert that would need to be in a different script called, MoveVertsTo.

After selecting edges, user would be asked to select a TARGET SURFACE and then choose "OK" to validate the target surface.

2- Perhaps additional mode (chekbox) for DropVerts and MoveVerts would be "SHOW ME" where the average, %, lowest, Highest, Z-value, etc., would temporarily be displayed (as plane) before the vertices are moved; the user could then: a) cancel the choice and choose another option or b) execute the move.
0
John
Illustrator
Beaverton, Oregon
User avatar
JClements 
Premium Member
Premium Member
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby EarthMover » Sun Aug 07, 2011 6:29 pm

Additionally I wonder if it would be possible to implement a Vert Memory option, where you could select all border edges and choose "Remember Vertex Positions", then once you are finished sculpting a terrain, you could "Restore Vertex Positions". This would essentially allow a user to freeze all border edges from being affected by manipulation. This way, if I had, say a flower bed on a hillside that I wanted to add undulation to, I could store the perimeter verts to memory, sculpt to my leisure, then restore the border perfectly. 8-) Just a thought.
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby bac9-flcl » Tue Aug 09, 2011 2:28 pm

I am sorry to interrupt the thread, but as you seem to very experienced in working with SketchUp model vertex structure, I've wanted to ask a simple question: is it possible to write a small plugin that can display the total vertex count of a model? It is a very important parameter to keep an eye on, for example, if developing Google Earth targeted model, but it's nowhere to be found in standart SketchUp stats. :(
0
User avatar
bac9-flcl 
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby TIG » Tue Aug 09, 2011 5:11 pm

This will do it
Code: Select all
v=[];t=0;m=Sketchup.active_model;m.entities.each{|e|v<<e.vertices if e.class==Sketchup::Edge};v.flatten!;v.uniq!;p t=v.length;tt=0;m.definitions.each{|d|v=[];d.entities.each{|e|v<<e.vertices if e.class==Sketchup::Edge};v.flatten!;v.uniq!;tt=tt+(v.length*d.instances.length)};p tt;p gt=t+tt;puts
Copy+Paste this one-liner into the Ruby Console + <Enter> it prints the total of all unique vertices in the model AND then those vertices inside groups/instance [multiplied by the number of instances of each] and then the grand total of the two.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby wyatt » Tue Aug 09, 2011 8:19 pm

I think this will be a very useful plugin. I can't get Lowest, Highest, Average, or Middle to work though. No matter which ones I pick, all the vertices go to zero. First I created a surface with undulating edges, selected the outer edges, and ran the plugin. I thought that's what I saw in the videos, and that process works for the other tools. Did I miss something, or is there a bug in the .2 release that wasn't there in .1?
0

wyatt 
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby MartinK » Tue Aug 09, 2011 10:42 pm

Thanks for another great plugin. I may be missing something, but is there a way to specify, by picking a point, where the selected vertices drop/raise to?
0

MartinK 
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby TIG » Wed Aug 10, 2011 9:46 am

  • Lowest/Highest/Middle should adjust the vertices' z-value to match the z-value of the vertex in the selection that is lowest/highest/midway-between ??? Can you post and example of a SKP where it fails...
  • You can't 'pick a point' - depending on the tool you've selected you can specify a 'Z value' or it drops/lifts to objects etc...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby MartinK » Wed Aug 10, 2011 12:16 pm

Thanks for the answer.
0

MartinK 
 

Re: [Plugin] Drop Vertices v1.2 20110807

Postby MartinK » Wed Aug 10, 2011 1:22 pm

I seem to be having the same problem as Wyatt, vertices only move to Z=0 no matter what method I use. I can't post the SKP as it is a large site model. Just wondering if anyone else has had this issue with Version 1.2.

Thanks
0

MartinK 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: Bing [Bot], yurimendes and 7 guests

Visit our sponsors: