[Plugin] xLine2Line

[Plugin] xLine2Line

Postby TIG » Sun Sep 26, 2010 4:35 pm

A bump of an ancient scipt...
Here's my ruby based on RickW's (Smustard http://www.smustard.com/script/Xline ) - his 'xline.rb' makes lines into xlines [cline/guides].
Mine makes selected xlines [clines/guides] into lines, BUT infinitely long clines/guides are ignored...
Select "Edges from Construction:Guide Lines" from the context-menu after selecting guide-line(s).

Get the latest version from the PluginStore:

Download

3
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] xLIne2Line

Postby Rich O Brien » Mon Sep 27, 2010 1:07 am

On behalf of all those who downloaded and forgot to thank you I'll offer some thanks.

Thanks TIG :thumb:
1
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] xLIne2Line

Postby Panga » Mon Sep 27, 2010 7:52 am

Thanks Tig.
0

Panga 
Premium Member
Premium Member
 

Re: [Plugin] xLIne2Line

Postby Ben Ritter » Mon Sep 27, 2010 7:33 pm

Thank you TIG.
0

Ben Ritter 
 

Re: [Plugin] xLIne2Line

Postby utiler » Fri Oct 29, 2010 1:20 am

rclub24 wrote:On behalf of all those who downloaded and forgot to thank you I'll offer some thanks.

Thanks TIG :thumb:



Ditto 'me wee lad...' 105 downloads and 3 replies..... :oops:

I must have missed this one, thanks TIG; I'd download it now!!!
0
purpose/expression/purpose/....
User avatar
utiler 
Top SketchUcator
 

Re: [Plugin] xLIne2Line

Postby pilou » Fri Oct 29, 2010 1:45 am

So we must used the Rick's plug first before use your? ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] xLIne2Line

Postby Ken » Fri Oct 29, 2010 1:52 am

The plugin, "xline.rb", changes lines to Xline and Xlines to lines by the context menu. This plugin works great for me.

Header of the Plugin, so credit is given correctly to each script writer.
Name : xlines.rb 1.0
# Description : Convert selected edges to construction lines
# Author : Rick Wilson
# Usage : 1. Install into the plugins directory or into the
# Plugins/examples directory and manually load from the
# ruby console "load 'examples/xlines.rb'"
# 2. Select "Convert to xLine" from the context menu after
# selecting an edge.
# Date : 2008-01-21
# Type : Tool
# History:
# 1.2 (2006-07-06) - Modified by D. Bur, Lines stipple supported. Back converter integrated.
# 1.1 (2008-01-21) - updated to put resultant geometry in the same entity space as the original
# 1.0 (2004-08-20) - first version
0
Fight like your the third monkey on Noah's Ark gangway.
User avatar
Ken 
Premium Member
Premium Member
 

Re: [Plugin] xLIne2Line

Postby pilou » Fri Oct 29, 2010 2:06 am

xLIne2Line
Don't work for these guides lines :o
dont_work.png
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] xLIne2Line

Postby TIG » Fri Oct 29, 2010 9:30 am

Pilou wrote:xLIne2Line
Don't work for these guides lines :o
dont_work.png

That's because they are not clines - they are cpoints! - note the point on the start position...
Replace them with clines to see the difference...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] xLIne2Line

Postby thomthom » Fri Oct 29, 2010 9:39 am

This plugin, as well as the original xLine processes the entire selection in its context handler.

Code: Select all
def xLine2Line_validate_selection
   Sketchup.active_model.selection.each {|e| return true if e.class == Sketchup::ConstructionLine}
   return nil
end

This can lead to severe lag on large selection sets. As I mentioned in my thread about the topic, http://forums.sketchucation.com/viewtop ... 80&t=31788 , I am currently looking for best practice methods to provide context menus for the selection. At the moment I'm adding a limit to how large selections I process - if the selection is larger than 1000 I assume there is something in the selection of interest.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] xLIne2Line

Postby TIG » Fri Oct 29, 2010 1:23 pm

thomthom wrote:This plugin, as well as teh original xLine processes the entire selection in its context handler.

Code: Select all
def xLine2Line_validate_selection
   Sketchup.active_model.selection.each {|e| return true if e.class == Sketchup::ConstructionLine}
   return nil
end

This can lead to severe lag on large selection sets. As I mentioned in my thread about the topic, viewtopic.php?f=180&t=31788 , I am currently looking for best practice methods to provide context menus for the selection. At the moment I'm adding a limit to how large selections I process - if the selection is larger than 1000 I assume there is something in the selection of interest.

It breaks once it finds something matching so on average it'll only iterate half of the selection ?
If you want to 'extract' something from a selection then what other may is there but sift through it ?
Would selection.to_a be quicker ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] xLIne2Line

Postby thomthom » Fri Oct 29, 2010 1:46 pm

TIG wrote:It breaks once it finds something matching so on average it'll only iterate half of the selection ?

Or it could be last in the stack...
TIG wrote:Would selection.to_a be quicker ?

No.

The whole issue is that when you have a large selection 100K+ processing every entity is going to give a performance hit. One plugin add some lag, and when you combine all plugins installed you have many second lag before the context menu appear.

What I do at the moment, is that if there is more than 1000 entities I just assume there is something of interest in the selection and show the menu item. Then make sure the method that processes the selection filters out the entities of interest. It's better that the processing method does the work rather than the context handler.

I timed the lag I had with the plugins installed to 5-10 second for a particular selection of 100K. For larger meshes the times just got silly. Once I modified the various plugins or disabled them I got it down to a few milliseconds.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] xLIne2Line

Postby TIG » Fri Oct 29, 2010 5:10 pm

So if you just add the context-item without a selection search pre-check it's much quicker but the menu list gets stupidly long !
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] xLIne2Line

Postby thomthom » Fri Oct 29, 2010 11:40 pm

Yea - that's the downside with that. So I'm still looking for a better solution. I'm currently wondering if such menu items is not fit for a context menu.
The drawback of slowing down the menu is too big. Ideally, context menus should be optional. (Though I have a few plugins myself where they are not optional - simply because they where made to just do a specific job and adding UI to make it an option is an hazzle.)

But I'd like an conversation to this topic, because processing the whole selection simply becomes to expensive when you add it all up.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] xLIne2Line

Postby Tonysarus » Mon Jun 20, 2011 8:48 pm

Is there a Plugin that converts infinitely long Clines into Lines on a selected face only (so that it automatically deletes the clines past the face's bounding edges and leaves lines within the selected face only). I would like to select a face or the bounding edges, execute the plug-in and have a face with lines on it and all the clines gone.
0

Tonysarus 
 

Re: [Plugin] xLIne2Line

Postby TIG » Tue Jun 21, 2011 10:12 am

No, this one here makes all clines into edges unless they are infinite rays or clines...
You could take the code and rework it to do the calculation to project the 4 planes through the sides of the screen and the camera and intersect those with the cline to get the extents and draw a new line between those and erase the cline... :geek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] xLIne2Line

Postby A24ron » Sat Nov 24, 2012 11:56 pm

freakin awesome thanks.
0

A24ron 
 

Re: [Plugin] xLine2Line

Postby show32167 » Wed Jun 19, 2013 9:54 am

thx tig
0

show32167 
 

Re: [Plugin] xLine2Line

Postby Amazing Artist » Mon Jul 01, 2013 5:46 pm

THX TIG
0
That's my story, and I'm sticking to it!

Amazing Artist 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: coconm, temppiz, thalamix and 9 guests

Visit our sponsors: