It is currently Thu Sep 02, 2010 9:56 pm

Registration
Login Help

Advertise Here

[Plugin] Point Merger tools v1.2 UPDATED@ 23/06/09

FAQMembersRegisterLogin

[Plugin] Point Merger tools v1.2 UPDATED@ 23/06/09

Postby •BTM on Sat Jun 13, 2009 1:27 am

DOWNLOAD FILES:
btm_Point_Merger_Files.zip

download, unzip, and move the contents of the folder to your plugins folder.
When you open SketchUp, they can be found in 'Point Merger' in the Plugins menu, or in the 'Merge Points' Toolbar.

———————————————————————————————————————————————
Merge Points

VERSION 1.2 (23/06/09)
Added proper undo function, a cursor, toolbar, it now uses the VCB for input, and other small changes were made.

Version: 1.1
~ Very small changes, now the current radius of the tool appears in the inputbox. Radius still isn't saved when tool is unselected.

Use:
This plugin is called 'Merge Points', and does exactly that. You first press enter/ return, and select the radius the tool will affect. Then you click where you want to merge points. It will take any points close enough, and move them to the position you clicked on.
This can get rid of those pesky areas with messed-up geometry, as-well as lowering the poly-count of a model manually (If you really wanted to).

Things I want to change/ add:
• Visualization while using the tool.
———————————————————————————————————————————————
Merge Points to Selection

VERSION: 1.2 (23/06/09)
~ Added ability to find edges and endpoints of selected faces, a proper 'undo' function, a toolbar, and slight changes.

Version: 1.1
~ Added the ability to chose between moving points to closest position on selected lines, or closest endpoint of selected lines.

Use:
This plugin is called 'Merge Points to Selection'. You select the lines you want the points to move to, or faces the lines are part of, and select the radius the tool will affect. Then you click OK. It will take any points close enough, and move them to the closest position on any any of the lines that were selected.
This can get rid of those pesky areas with messed-up geometry, and also for connecting things to lines, or connecting meshes together.

Things I want to change/ add:
• Visualization while using the tool.
———————————————————————————————————————————————
known issue: Sometimes when the points are merged, as i've seen sometimes when using other tools, sketchup doesn't realize they are in the same position exactly. When/ if this happens, it's best to use 'Fix Problems', and possibly 'Intersect'.
You do not have the required permissions to view the files attached to this post.
Last edited by thomthom on Tue Dec 08, 2009 10:14 pm, edited 13 times in total.
Reason: Just cleaning up and organizing the Plugin forum.
User avatar
•BTM
 
Posts: 716
Joined: Wed Jul 23, 2008 12:59 am
Operating system: Mac OSX 10.5.7
SketchUp version: SU7 free

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby leixing on Sat Jun 13, 2009 4:54 am

A good idea!i agree with jims idea and i think we could saw the circle when we do it.
leixing
 
Posts: 27
Joined: Fri Apr 11, 2008 9:24 am

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby TIG on Sat Jun 13, 2009 2:26 pm

To keep 'max_weld_distance' set during a session call it @@max_weld_distance, on activate set it to 1" at the start if it's not set in the form
Code: Select all
@@max_weld_distance=1.to_l if not @@max_weld_distance
and in the inputbox use
Code: Select all
defaults = [@@max_weld_distance]
to use it...
TIG
User avatar
TIG
Global Moderator
 
Posts: 4478
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Operating system: Vista
SketchUp version: Latest Pro 7.1

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby Pilou on Sun Jun 14, 2009 10:35 am

Does it possible to make the same but collapse points on an axe (X,Y,Z) or on a straight line given?
You do not have the required permissions to view the files attached to this post.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
 
Posts: 4345
Joined: Wed Jan 23, 2008 10:33 pm

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby mitcorb on Sun Jun 14, 2009 1:52 pm

BTM:
I have not tried the ruby yet, but I have some questions.
Is there an upper and lower limit to the selection radius?
From the description, this could be used as a seam stitcher, maybe? In other words, you construct a line or curve, or loop along which you can snap nearby vertices to it?
Epiphany: Everything emanates from the singularity at 0,0,0.
mitcorb
 
Posts: 741
Joined: Sat Mar 22, 2008 2:32 pm
Operating system: xphome,xpro(at work)
SketchUp version: 6,&7(free home),6pro,7free(work)

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby Ken on Sun Jun 14, 2009 2:07 pm

BTM

I have tried you script and find it useful. However, is it necessary to pick a distance? Why not, pick point A, a point B, and have point A move to point B.

Thanks for all your work
Ken
User avatar
Ken
 
Posts: 327
Joined: Thu Nov 15, 2007 1:38 pm
Location: Fort Mill, SC
Operating system: Vista
SketchUp version: 7 Pro

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby •BTM on Sun Jun 14, 2009 2:34 pm

Ken wrote:BTM

I have tried you script and find it useful. However, is it necessary to pick a distance? Why not, pick point A, a point B, and have point A move to point B.

Thanks for all your work
Ken
Well, as I see it, I'd usually use the move tool to move a single point to another single point. This script was made for those areas with a bunch of points, that are mostly unnecessary, and you just want to make them all into a single point.

mitcorb wrote:…you construct a line or curve, or loop along which you can snap nearby vertices to it?
Not yet, sorry. :( maybe I'll add it as a feature eventually.

Pilou wrote:Does it possible to make the same but collapse points on an axe (X,Y,Z) or on a straight line given?
Pilou, je ne sais pas exactement ce que tu veux dire, mais je pense que tu demande si c’est possible de changer la code, pour qu’il puisse attacher des points proches à une ligne sélectionner. Sinon, peux-tu expliquer plus?


TIG wrote:To keep 'max_weld_distance' set during a session call it @@max_weld_distance, on activate set it to 1" at the start if it's not set in the form
Code: Select all
@@max_weld_distance=1.to_l if not @@max_weld_distance
and in the inputbox use
Code: Select all
defaults = [@@max_weld_distance]
to use it...
I've tried some similar things, but I always seem to get the error that @@max_weld_distance is an 'uninitialized class variable'.

Jim wrote:…make it highlight each point within the weld distance so you know what is about to happen when you click.
I'll try. :D Visualization isn't something I'm all that good with yet.
User avatar
•BTM
 
Posts: 716
Joined: Wed Jul 23, 2008 12:59 am
Operating system: Mac OSX 10.5.7
SketchUp version: SU7 free

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby TIG on Sun Jun 14, 2009 3:24 pm

Initially set
Code: Select all
@@max_weld_distance=1.to_l if not @@max_weld_distance
inside the class BUT not inside a sub-definition...
TIG
User avatar
TIG
Global Moderator
 
Posts: 4478
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Operating system: Vista
SketchUp version: Latest Pro 7.1

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby Pilou on Sun Jun 14, 2009 5:50 pm

is that more clear? :)
You do not have the required permissions to view the files attached to this post.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
 
Posts: 4345
Joined: Wed Jan 23, 2008 10:33 pm

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby Chris Fullmer on Sun Jun 14, 2009 9:54 pm

Is there a practical application for that type of functionality? Seems faster to juist draw it.

Chris
Your intelligence will never fully compensate for my stupidity.
Cal Poly Pomona - BS Landscape Architecture
UC Berkeley - Masters of Landscape Architecture
All my Plugins I've written
chrisfullmer.com - Art Blog
User avatar
Chris Fullmer
Global Moderator
 
Posts: 4760
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows Vista
SketchUp version: 7.1x

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby •BTM on Sun Jun 14, 2009 10:01 pm

mitcorb wrote:BTM:
I have not tried the ruby yet, but I have some questions.
Is there an upper and lower limit to the selection radius?
From the description, this could be used as a seam stitcher, maybe? In other words, you construct a line or curve, or loop along which you can snap nearby vertices to it?

Today, I've made another script to do this… well, I think it does this.

http://www.screencast.com/t/zIfDNh5jG

You select a number of edges, and click the tool. It asks you for a radius, like in the other one. You select it, and any points within that distance from a selected line, are moved to the closest point on any of the lines selected. In the next release, most likely tonight, both of the scripts will be included in a submenu.
User avatar
•BTM
 
Posts: 716
Joined: Wed Jul 23, 2008 12:59 am
Operating system: Mac OSX 10.5.7
SketchUp version: SU7 free

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby Pilou on Sun Jun 14, 2009 10:02 pm

Is there a practical application for that type of functionality?

Very practical for flatten or deform (for any reason) an existing volume (or part of volume) on any orientation!
Normal way when that is collapsed on a plan 3D
Funny when that is collapsed on a line
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
 
Posts: 4345
Joined: Wed Jan 23, 2008 10:33 pm

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby •BTM on Mon Jun 15, 2009 12:56 am

OK, I have 2 issues, one with each script, that are holding me back from posting the next version. :evil:

1. With the current 'Merge Points' script, the transformation isn't always 'perfect'. since SketchUp only allows vertices to be transformed by vectors, and not able to be given a specific point to move to, the points don't always end up exactly in the same place. Sometimes they are off by an amount SketchUp barely even recognizes. This causes them to not be attached, and thus are annoying. This doesn't always happen, but it does happen on occasion. Does Anyone know of a way to get the transformation to be perfect every time?

2. The next script moves points to the closest position on the lines of the selected edges. The annoying part is that lines are infinite. I could probably figure out how to get it working properly, with the edges and not lines by using if functions, but it wouldn't be ready by tonight.
User avatar
•BTM
 
Posts: 716
Joined: Wed Jul 23, 2008 12:59 am
Operating system: Mac OSX 10.5.7
SketchUp version: SU7 free

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby Chris Fullmer on Mon Jun 15, 2009 2:19 am

#1 - yeah, the easiest way to do it is using the transform by vector method. But there is also Entities.transform_entities method which lets you apply a single transformation object to multiple objects simultaneously....but in your case you would only tansform a single entity at a time. Then, since you are using a transformation object, you can transform something to a given 3d point. So your code that looks like this:

Code: Select all
dist = pos.distance @mouse_point
   if dist <= @max_weld_distance
   vec = p.position.vector_to @mouse_point
   @entities.transform_entities(vec,p)
   end
end


could look like this:

Code: Select all
dist = pos.distance @mouse_point
   if dist <= @max_weld_distance
   t = Geom::Transformation.new(@mouse_point)
   @entities.transform_entities(t,p)
   end
end


I have not tested that for syntax and I don't know if it will fix your #1 problem, but I think it might.

Chris
Your intelligence will never fully compensate for my stupidity.
Cal Poly Pomona - BS Landscape Architecture
UC Berkeley - Masters of Landscape Architecture
All my Plugins I've written
chrisfullmer.com - Art Blog
User avatar
Chris Fullmer
Global Moderator
 
Posts: 4760
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows Vista
SketchUp version: 7.1x

Re: [Plugin] Merge Points v1.0 (June 12, 2009)

Postby •BTM on Mon Jun 15, 2009 1:17 pm

...I figured out how to solve problem 2!!! :berserk:

As for problem 1, Chris, the transform_entities works pretty much the same way whether you give it a transformation or a vector; the script you have down there moves the points by the vector @mouse_point, so they end up in a completely different spot. That's why I used vector_to. The only problem, is that SketchUp sees things like 3.999m as 4 meters ( Well, according to the VCB, it doesn't show up as ~4.00m, but as if it were just 4.00m), and I think it's inaccuracies like this that can mess it up sometimes. :? :(
User avatar
•BTM
 
Posts: 716
Joined: Wed Jul 23, 2008 12:59 am
Operating system: Mac OSX 10.5.7
SketchUp version: SU7 free

SketchUcation One-Liner Adverts

by Ad Machine on 5 minutes ago

V-Ray for SketchUp - Take your SketchUp Renders to the next level
Ad Machine
Robot
 
Posts: 2010

Next

 

Advertise Here

Who is online

Users browsing this forum: MSN Bot and 2 guests