Any Plugin to count "Endpoints" in a selection??
-
Is there a plugin that will count Endpoints in a selection?
If 2 lines join, there is only 1 endpoint between them. If there are more than 1 it means the lines do not join.
Likewise if several faces join at a common vertex, there should only be the 1 endpoint they all share. If there are more than 1 endpoint, then 1 or more faces do not join to make a surface.
One of the biggest problems I have, and I am sure others share the same pain is isolating faults to make a surface or a solid, or Curviloft. The most common causes are 2 or more co-incident lines. I can select all the lines and that would tell me if I have 2 or more lines between any 2 endpoints, but many times 2 faces seem to join at a vertex, but do not. There may be a tiny gap of less than .001 inch that prevents a surface/solid/Curviloft from forming.
If there is a plugin or another way to do this, where is it?
If not, could one of you Ruby Wizards come up with one?
It should work like a selection lasso and simply count the number of endpoints within the selection.That and a simple subsequent selection over the lines that meet at that endpoint will lead me to where the problem is.
-
Vertex tools ($) show the number of selected vertices and you can merge close vertices (you can input a merge radius).
-
I think what you want is a quick way to find faces that are not closed in order to make a solid?
I made that tool a long time ago:
http://sketchucation.com/forums/viewtopic.php?t=17876
Or a year later, and more fully developed by Thomthom:
http://sketchucation.com/forums/viewtopic.php?t=30504
Or most recently, that even tried to help solve the problems by TIG:
-
Thanks guys,
Solids? Yes but not only.
Vertex Tools looks great but a bit overkill for me at this time.
I've d/l'd Label Open Faces and I'll see if that does the trick.
I tried using Solid Insp but in this case it went nuts with circles and lines to the extent it was more work finding individual lines and gaps (have to select group, go in then out for each instance) and Solid Solver while great; in this case won't work. The object is not (nor is intended to be) a solid and essentially it just left me with a cupla lines in space.
-
What about Cleanup by ThomThom? It highlights open ends and gives a count.
-
To think of it the other way...
You want to find all lines that have no faces and can't have faces, because a line with a 'free' vertex can't have a face...
So to find unfaceable-edges use this one-liner...
First Select the geometry in question [no need to be too careful as only the unfaceable-edges are left selected].Copy/Paste code + <enter> in the Ruby Console...
This version highlights unfaceable edges.
s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Edge) && (e.start.edges.length==1 || e.end.edges.length==1)}
Now only lines are in the selection than could never have a face...
This version highlights unfaced edges.
s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Edge) && e.faces.length==0}
This version highlights edges with < 2 faces [unfaced and flaps/hole-edges].
s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Edge) && e.faces.length<2}
This version highlights edges with just 1 face [flaps/hole-edges].
s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Edge) && e.faces.length==1}
This version highlights edges with > 2 faces [internal-partitions/coincident-edges/coincident-faces-overlaid].
s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Edge) && e.faces.length>2}
-
Tig,
Interesting stuff to try. Any chance you could make that into a plugin?
But the attached drawing is what I am trying to solve, where there is a gap between vertices/endpoints that is minute (less than .001 inch) and cannot be seen unless zoomed in very close, perspective off. Doing this is tedious as it has to be done on any suspected vertex or line segment.
Unless I'm missing something, I can think of no simpler way than to just count endpoints and easily deduce where the problem lies.
-
Its hard (VERY hard) to write a tool that selects ONLY vertices. SketchUp doesn't do that natively so you have to rewrite the selection lasso tool which is a major undertaking.
TIG's one liners are awesome and useful.
But if you'd rather use full plugins, Todd Burch wrote a plugin called label stray edges. It will point out the errors in the right box of your image. I wrote the plugin that labels "open faces" (maybe its poorly named) but it will point out the errors in the other 2 boxes. Between our 2 plugins, I think you will find it easy to fix all of the scenarios in your image. Try them, see if there is still a case that is not covered.
Label Stray Lines:
http://www.smustard.com/script/StrayLinesLabel Open Faces:
http://sketchucation.com/forums/viewtopic.php?t=17876 -
@jgb said:
Is there a plugin that will count Endpoints in a selection?
FredoTools? Marks and counts vertices in selection
-
The gap on the right is easy to trap, as there are two edges with one vertex that has other edges.
My first one-liner finds that.However, the other examples are more difficult to trap.
You'd need to inspect very edge.
Then process each of that edge's vertices.
Then inspect each of the other's edges' vertices, and check the distance between the tested-edge's vertex and the other vertices.
Label [or highlight or count] any that are within that distance...d=0.01; m=Sketchup.active_model; a=m.active_entities; s=m.selection; vs=[]; m.start_operation('*'); s.each{|e|vs<<e.vertices if e.is_a?(Sketchup;;Edge)}; s.clear; vs.flatten!; vs.uniq!; us=[]; vs.each{|v|(vs-[v]).each{|u|us<<u if v.position.distance(u.position)<=d;};};us.uniq!; us.each{|v|a.add_text('*',v.position,[6,6,6])};m.commit_operation;puts 'Near Vertices='<<us.length.to_s;
Set d=0.01 to any size/unit you like... Adjust it to something easy to test...
It adds a '*' text label to each vertex that is near to another vertex by 'd' or less, and reports the 'count', 1 gap == 2 vertices...
Get TT's 'Vertex Tools' to do this / fix this issue for you - it's worth it ! -
I think Wind-borne's idea is about as close as you get. It will not be quite as simple as you will have to do the math to figure out how many vertices the selected faces should have vs how many they do have. But it could be the closest thing to what your brain is expecting.
@TIG, I see what you mean. I am easily oversimplifying the problem in my brain. my plugin would label EVERY line with anything more or less than 2 faces attached. So it would also label every line around the outsides of those shapes - every single line shown would be labeled as bordering an "open face", which is not ideal.
It does seem like vertex proximity would have to come into play on some level here.
EDIT: Approximately 10 typos fixed, hopefully my post now makes some sense....
-
I'll revisit this on Mon or Tues. Going out of town for w/e.
-
@chris fullmer said:
Its hard (VERY hard) to write a tool that selects ONLY vertices. SketchUp doesn't do that natively so you have to rewrite the selection lasso tool which is a major undertaking.
This is exactly what Vertex Tools does.
And it had functions to bulk-close near-connected vertices:
http://www.thomthom.net/software/vertex_tools/manual/tools#merge_close_verticeshttp://sketchucation.com/forums/viewtopic.php?t=24593#p210736
But a free alternative is the Close Gaps feature in Edge Tools:
http://sketchucation.com/forums/viewtopic.php?f=323&t=24593&p=210736#close-gaps
It lets you visually inspect all the open end points in a mesh. -
@jgb said:
Vertex Tools looks great but a bit overkill for me at this time.
i can't figure out in wich way a piece of software that effective and with that price is an overkill..
just the merge vertex feature is about 245234533613644734% worth the money.. and the problem of small vertex gap is gone forever..
Advertisement