Disclaimer: Nothing special, I’m just thinking out loud to see if it will be useful for someone …
I recently noticed that a new method has appeared in the latest version of Sketchup (20.1.235):
#weld(edges) ⇒ Array<Sketchup::Curve>
The #weld method takes a set of edges and find all possible chains of edges and connect them with a Curve.
A curve will not cross another curve. They will split where multiple curves meet.
There are several plugins (extension) currently in EW and PluginsSore, for example by Eneroth, Fredo, s4u, TIG, Smustard Team… etc. which was made for similar reasons.
I was wondering how this new method works, so I compared it to a randomly selected existing plugin:
TIG-weld
The comparison was made on this file:
weld_test.skp (118.4 KB)
#I assume that the edges are preselected:
start_time = Time.now
edges = TIG.weld
end_time = Time.now
puts "TIG-weld converted #{edges.length} edges to curve in #{end_time -start_time} sec"
#> TIG-weld converted 2002 edges to curve in 8.827291 sec
Then I created a test Extension:
Dezmo_SU_weld_Beta 2020_0719_1219.rbz (11.0 KB)
And run on the same edges with this result:
#> SU weld by Dezmo: 2002 edges converted to 1 curve in 0.054669 sec
Pretty impressive!
However the example in the documentation is quite incomplete, i.e.
“model = Sketchup.active_mode
l”
is missing.
Happy wedding!
Welding <-> Wedding
Both are about the unbreakable connection, aren’t they?