SketchUcation Premium Membership

 

 

weld.rb problem

weld.rb problem

Postby Photonix » Fri Mar 02, 2012 1:39 pm

Hey SU community,

I have the following problem using the weld.rb plugin:

I have to convert all edges of my model to closed polylines in a single step (the model is very complex) prior the dxf export for autocad.

Because I have nested geometries, the plugin does not work in the right way, I have added a simple test file. The plugin only works if I select the box and the text sequentially.

Is there a way to add some code to the weld.rb plugin to get it working with my geometry? My modell has ~4 million edges that have to get converted to closed curves (autocad polylines) with a single selection step.

Thanks in advance,

Marcel
Please, register (free) to access all the attachments on the forums.
Photonix
 
Posts: 6
Joined: Wed Aug 11, 2010 8:12 am

Re: weld.rb problem

Postby mitcorb » Fri Mar 02, 2012 2:32 pm

Hi, Marcel:
Perhaps I did not understand your question.
I was able to close with weld the segments on the E and the S. Tracing over one of the segments on the E to form a face, I was able to extrude it up. The corners were hidden. I could trace along this corner, or use CTRL+Eraser+Shift to harden the edge. If you want to convert to polylines, you may want to try Fredo6's Bezier tool. With this tool, you should be able to right click on the welded figure, select convert to polyline, or several other possibilities.

EDIT: My apologies :oops: First of all, you posted in the Developer's Forum. I would not normally comment here. What you are requesting is an "en masse" welder. And one that dives down into nested groups and components. There may be technical issues here that I am not qualified on.
I can suggest ThomThom's Clean Up and Vertex Tools in the interim.
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb
Top SketchUcator
 
Posts: 3407
Joined: Sat Mar 22, 2008 2:32 pm
Location: USA
Name: Tim
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: architecture
Level of SketchUp: Intermediate

Re: weld.rb problem

Postby Photonix » Sat Mar 03, 2012 11:09 am

Thanks mitcorb,

you are right: I need "En Masse weld".

I already tried the plugins you proposed, without success.

Could anyone help please, its quite urgent.



@ forum moderator: could you please move the thread to the right forum section, thanks.


-
Photonix
 
Posts: 6
Joined: Wed Aug 11, 2010 8:12 am

Re: weld.rb problem

Postby TIG » Sat Mar 03, 2012 12:18 pm

It is relatively simple to iterate a collection of edges and 'weld' them into connected curve 'sets', BUT if any of the edges 'branch' then 'weld' will fail to make a fully curve of all of the edges...
However, help might be at hand - have you looked at 'ReCurve' viewtopic.php?p=324196#p324196
This is perhaps more like you want ?
TIG
User avatar
TIG
Global Moderator
 
Posts: 13991
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: weld.rb problem

Postby Photonix » Mon Mar 05, 2012 10:17 am

I tried the recurve.rb plugin, without sucess.
It does not work with nested objects. Any other suggestion? Is anyone able to edit the weld.rb to run for nested closed lines as well?
Photonix
 
Posts: 6
Joined: Wed Aug 11, 2010 8:12 am

Re: weld.rb problem

Postby TIG » Mon Mar 05, 2012 3:36 pm

Here's about as good as it gets...
You need to install both of these scripts into the Plugins folder and follow the TIG.weldall instructions to make every edge in the model a welded curve...
###
TIG-weld.rb
Copyright 2004-2005 by Rick Wilson [parts], and 2012 (c) TIG.
Permission to use, copy, modify, and distribute this software for
any purpose and without fee is hereby granted, provided that the above
copyright 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:-
TIG-weld.rb
Description:
Joins selected edges into a 'curve' (~"polyline").
Author:-
TIG - based heavily on RickW's 'weld.rb'...
[but no close/face, and also suitable to be called in other methods].
Usage:-
Make a selection which includes the edges to be joined.
Run the script from the menu:
Tools > Weld
or type in the Ruby Console:
TIG.weld +<enter>
Selected edges will then be 'welded' into a curve wherever possible.
Disconnected edges or branching edges might give unexpected results.
A curve will be split where any 'branching' edge intersects it.
The process is one step undoable.
To use the tool run within another method include...
require 'TIG-weld.rb'
and use
TIG.weld(true)
to supress 'undo' complications.
The calling method must make a selection of potential edges to process,
even if inside another context, perhaps iterated in turn,
see "TIG-weldall.rb" for an example...
Version:-
1.0 20120305 First public issue.
###
TIG-weldall.rb
Copyright 2012 (c) TIG.
Permission to use, copy, modify, and distribute this software for
any purpose and without fee is hereby granted, provided that the above
copyright 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.
###
TIG-weldall.rb
###
Welds ALL edges in a model [including any nested inside groups/component-
definitions] into curves.
Note that disconnected edges or branching edges will all become curves, but
some might be one segemnt long where a vertec has more than two edges...
Note: it requires script TIG-weld.rb loading too...
Usage: in the Ruby Console type, TIG.weldall +<enter>
It is one step undobale.
###
Donations:
By PayPal.com to info @ revitrev.org
###
Version:
1.0 20120305 First issue.
###
Please, register (free) to access all the attachments on the forums.
TIG
User avatar
TIG
Global Moderator
 
Posts: 13991
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: weld.rb problem

Postby Photonix » Mon Mar 05, 2012 4:22 pm

Thank You TIG,

it works fine, but needs a lot of time for my geometries.

Is it possible to speed it up or if not, to implement a progressbar?

It still runs 30mins for 200.000 edges, no end in sight. I will abort now.

I will try with 15.000 edges and post the needed time when its done.
Photonix
 
Posts: 6
Joined: Wed Aug 11, 2010 8:12 am

Re: weld.rb problem

Postby TIG » Mon Mar 05, 2012 5:00 pm

If I could have sped it up I would have.
It has to iterate every edge in the model and all groups/definitions and then decide which go into which connected curve - it's complex stuff, I'd leave it running as long as you can - it'll beep when done.
A progress bar would only slow it further and as soon as it hits a limit it'll white-out anyway and stop updating it, giving the impression it's stalled when it is actually still processing...
The Task Manager will show if it's still doing its stuff...
TIG
User avatar
TIG
Global Moderator
 
Posts: 13991
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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: Betinho Cruz, chris87, cubcrafter, Daniel S, fdreise, fusty, Google Bot, JGA, jpvikholm, mhackee, miskoza, Rich O Brien, TIG, tin22, vicspa and 11 guests