[Plugin] TIG-Smart_offset

Re: [Plugin] TIG-Smart_offset v1.2 20121221

Postby ccbiggs » Fri Dec 21, 2012 6:39 pm

Hey Tig,
I am getting the same thing Jeff has. But since Jeff actually knows what he is doing, he can do the ruby troubleshooting. Will stay tuned to see what you fellas figure out.
It works great on my windows machine at home.
Thanks Tig

Update
Jeff says his works. It does not work on my mac.
with nothing preselected TIG::Smart_offsetter.suitable?()
> TIG::Smart_offsetter.suitable?()
false


with one edge preselected TIG::Smart_offsetter.suitable?()
> TIG::Smart_offsetter.suitable?()
false



with one face preselected TIG::Smart_offsetter.suitable?()
> TIG::Smart_offsetter.suitable?()
true


with lots of things [including some edges] preselected TIG::Smart_offsetter.suitable?()
> TIG::Smart_offsetter.suitable?()
true



with one edge preselected TIG::Smart_offsetter.dialog()
TIG.Smart_offset:

PreSelect Face[s] !



with one face preselected TIG::Smart_offsetter.dialog()
Offset [+/-ve=out/


My drop down "Tools" Menu works with a face preselected. The toolbar does not.
Nothing works with just edges selected.
If you need me to check anything else, and I do not get right back to ya, I am not ignoring you I am just here there and everywhere today.
0
Last edited by ccbiggs on Fri Dec 21, 2012 7:05 pm, edited 3 times in total.

ccbiggs 
 

Re: [Plugin] TIG-Smart_offset v1.2 20121221

Postby jeff hammond » Fri Dec 21, 2012 6:44 pm

here are these results.. (since you took the time to write them.. i better take the time to report ;) )

TIG wrote:Copy/paste+<enter> these into the Ruby Console and report the results:


with nothing preselected TIG::Smart_offsetter.suitable?()
false

with one edge preselected TIG::Smart_offsetter.suitable?()
false

with one face preselected TIG::Smart_offsetter.suitable?()
true

with lots of things [including some edges] preselected TIG::Smart_offsetter.suitable?()
true (drew two squares and selected all)

with one edge preselected TIG::Smart_offsetter.dialog()
warning- PreSelect Face[s] !
ruby - nil

with one face preselected TIG::Smart_offsetter.dialog()
(works as expected)
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.2 20121221

Postby jeff hammond » Fri Dec 21, 2012 6:49 pm

uh.. not sure what the deal is but..

upon entering all of that stuff in the console, the toolbar is now working
:?

[edit] but then.. i quit sketchup then relaunched and the toolbar is greyed out again regardless of selection.. the menu item is working though
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.2 20121221

Postby Chris Fullmer » Fri Dec 21, 2012 6:52 pm

voodoo. definitely voodoo at work here.
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] TIG-Smart_offset v1.2 20121221

Postby jeff hammond » Fri Dec 21, 2012 7:03 pm

Chris Fullmer wrote:voodoo. definitely voodoo at work here.

ha.. that darn voodoo! :)


some more info:

so here's what the deal with the toolbar is.. (in this example, i have 3 squares with faces drawn)

•cmmdA (select all)
•toolbar remains greyed out (menu item is live)
•do something else (rotate, pan, etc)
•toolbar becomes active
•deselect all
•toolbar remains active (menu item greys out)
•do something else (switch tool, orbit, etc)
•toolbar greys out

so it appears, on mac, that something has to happen other than simply selecting in order to jump start the toolbar into updating it's state
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.3 20121221

Postby TIG » Fri Dec 21, 2012 7:31 pm

Here's v1.3 viewtopic.php?p=446462#p446462
Removed 'suitable?' method, to suit MACs, more error traps etc.
Try this and report back... :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.3 20121221

Postby ccbiggs » Fri Dec 21, 2012 7:50 pm

It works the same for me. With a face selected the drop down tools menu item will work but the single icon toolbar will not.
0

ccbiggs 
 

Re: [Plugin] TIG-Smart_offset v1.3 20121221

Postby TIG » Fri Dec 21, 2012 9:43 pm

ccbiggs wrote:It works the same for me. With a face selected the drop down tools menu item will work but the single icon toolbar will not.
Which is weird... because they BOTH use 'cmd' and share the same enabled/grayed code...
To check that the toolbar WILL work somehow... can you please edit the file 'TIG-Smart_offset.rb' on your MAC with a plain text editor [BBedit???] and find the three lines starting at #117 reading:
Code: Select all
      cmd.set_validation_proc{
         Sketchup.active_model.selection.grep(Sketchup::Face)[0] ? MF_ENABLED : MF_GRAYED
      }
and change them to read
Code: Select all
      #cmd.set_validation_proc{
         #Sketchup.active_model.selection.grep(Sketchup::Face)[0] ? MF_ENABLED : MF_GRAYED
      #}
i.e. add a # in front of each of the three lines to disable them.
Now the tool's command should always be 'enabled' in the menu & the toolbar button, if you try to use it without a Face in the Selection you'll get an error messagebox...
Let me know how this goes...

Incidentally, BEFORE [& after] you make the changes... do you get the tool's context-menu item IF there's a Face in the Selection ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.3 20121221

Postby jeff hammond » Fri Dec 21, 2012 9:51 pm

TIG wrote:To check that the toolbar WILL work somehow... can you please edit the file 'TIG-Smart_offset.rb' on your MAC with a plain text editor [BBedit???] and find the three lines starting at #117 reading:
Code: Select all
      cmd.set_validation_proc{
         Sketchup.active_model.selection.grep(Sketchup::Face)[0] ? MF_ENABLED : MF_GRAYED
      }
and change them to read
Code: Select all
      #cmd.set_validation_proc{
         #Sketchup.active_model.selection.grep(Sketchup::Face)[0] ? MF_ENABLED : MF_GRAYED
      #}
i.e. add a # in front of each of the three lines to disable them.


that does the trick.. the toolbar is always active now and i'll just receive an error if i try to run the tool without an appropriate selection..

[context menu works also.. but it worked prior to disabling the above lines]
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.3 20121221

Postby TIG » Fri Dec 21, 2012 9:58 pm

OK !
The current tool [v1.3] works just fine for PCs... but it baulks on a MAC with some of the enable/grayed code for the toolbar button - which is weird... :?

The editing of the three lines of code in the script to disable them with a leading #... as indicated in the preceding posts... will fix it for MAC users...

I'll see if I can get a version working properly for PC and MAC without this cludge ! :(

In the meantime, please report any issues...

Merry Xmas :D
Apocalypse averted! :P
Phew! ;)
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.3 20121221

Postby simon le bon » Sat Dec 22, 2012 12:30 am

Thank you for this one really "smart" dear TIG +++
We were used to the quirks of the native offset tool as a fatality. It is a surprise to realize that it was not the case :o :o :o

Merry Christmas to you too :ecstatic:

Simon
0
User avatar
simon le bon 
 

Re: [Plugin] TIG-Smart_offset v1.3 20121221

Postby driven » Sat Dec 22, 2012 12:41 am

TIG wrote:I'll see if I can get a version working properly for PC and MAC without this cludge ! :(

I posted this on the first page and it will work on both?
set validation doesn't seem to work on macs on Toolbars
Code: Select all
cmd2=UI::Command.new('TIG.Smart_offset'){self.dialog()}
cmd2.small_icon=File.join(dir, 'TIG-Smart_offset.png')
cmd2.large_icon=File.join(dir, 'TIG-Smart_offset.png')
toolbar=UI::Toolbar.new('TIG.Smart_offset')
toolbar.add_item(cmd2)

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby TIG » Sat Dec 22, 2012 11:33 am

Here's v1.4 viewtopic.php?p=446462#p446462
It now only applies toolbar enabled/grayed [validation] on PCs; on a MAC the toolbar button is always enabled, but when you attempt to use it without a suitable preselection there's an error-messagebox...
This now means PC and MAC users should have a quite similar usage :D
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby pilou » Sat Dec 22, 2012 1:23 pm

From Daredevil
Original
Smart_Offest
Normal result wished

0
Last edited by pilou on Sat Dec 22, 2012 1:35 pm, edited 1 time in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby DareDevil » Sat Dec 22, 2012 1:32 pm

Thanks for this advanced tool ! :thumb: Nice to solve round edge offset.

But I have a two requests :
First, (crossing post with Pilou ;)) I think when the offset cross itself, there is a chance it make a hole. Your Smart Offset fill all the shape. It will be cool if your toll can solve this case.
offset.jpg

The second is a bonus setting to create a round offset like this :
round-offset.jpg
I don't know if it's "easy" to make this kind of function, perhaps crossing your offset tool and your Chamfer tool from 2D Tools.
0
User avatar
DareDevil 
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby TIG » Sat Dec 22, 2012 1:50 pm

DareDevil/Pilou

I had been following your discussions about this in the French forum...
I know what you are asking for, but it is very complicated to come up with an algorithm to remove the 'hole' - it's easy for us to 'see' what's to go and what's to stay, but in code it is very complicated to ensure that the unwanted parts are removed.
If anyone has any ideas [even seemingly silly ones?] I am open to suggestions...

On the 'rounded corner' matter... This effectively a 'multi-fillet' tool.
The main issue I see in you'd need to select just the edges to fillet and not a face, otherwise in the case you illustrated the already curved part would potentially get 'multi-filleted'...

That's x6 clicks to select the ones needed with a new tool - or x2 to select face & its-edges, then x2+Ctrl+Shift to remove the face and the unwanted arc [or +x1 click to make a fence, e.g. for an 'arc' made from exploded edges...] - say x4 or x5...
OR using the existing 2dFillet tool x2 per vertex = x10 clicks.
But are your few extra clicks worth my lost brain-cells needed to contrive this wonder ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby pilou » Sat Dec 22, 2012 2:01 pm

For the multi fillet
Surely not but don't forget the pleasure to find the solution! ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby numerobis » Sat Dec 22, 2012 10:11 pm

WOW!!! This is really helpful! Great! Thank you very much!!! 8-)
And Merry Christmas to you too! :D
0

numerobis 
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby takesh h » Sun Dec 23, 2012 4:25 am

"Smart TIG" offsets indeed!
mcs.jpg
0
User avatar
takesh h 
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby jeff hammond » Sun Dec 23, 2012 5:27 am

Pilou wrote:For the multi fillet
Surely not but don't forget the pleasure to find the solution! ;)




that pleasure would be nothing compared to the pleasure experienced by figuring this one out :lol:



offff.jpg
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby rv1974 » Sun Dec 23, 2012 9:26 am

TIG, marry Xmas and thank you for this great present.
P.S. Could you take a look at attached?
P.P.S. a. It'd be neat if this tool was mode-less (I mean replicating the native SU behavior)
b. a number of offset option???
0

rv1974 
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby jolran » Sun Dec 23, 2012 1:07 pm

Thank you TIG and Merry Christmas!

This one is a difficult task.
0
User avatar
jolran 
PluginStore Author
PluginStore Author
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby JClements » Sun Dec 23, 2012 5:26 pm

Thank you, Santa TIG. Milk and cookies will await you Xmas morning. :D

Any chance of having:
1- a "Weld Offset" option button in the dialog
or
2- have the offset automatically welded if its source-edges were made from the circle, arch, polygon tools or previously "welded" edges?

Regards, John
0
John
Illustrator
Beaverton, Oregon
User avatar
JClements 
Premium Member
Premium Member
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby matt.gordon320 » Sun Dec 23, 2012 9:12 pm

Thanks TIG! I don't think I could have asked for a better Christmas/World not ending present!
0

matt.gordon320 
Premium Member
Premium Member
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby Pixero » Mon Dec 24, 2012 8:36 am

Thanks for this great plugin.
Would it be very difficult to have it work as an interactive tool also using the measurement toolbar instead of the pop up window so it can replace the native tool all together?
0
User avatar
Pixero 
 

Re: [Plugin] TIG-Smart_offset v1.5 20121224

Postby TIG » Mon Dec 24, 2012 6:30 pm

Here's v1.5 viewtopic.php?p=446462#p446462
There's some code improvements and fewer fails etc.
Some of the requested changes like 'holes', welded-outlines and VCB input will have to wait...

Merry Xmas... :D
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.4 20121222

Postby fredo6 » Mon Dec 24, 2012 10:15 pm

Pixero wrote:Thanks for this great plugin.
Would it be very difficult to have it work as an interactive tool also using the measurement toolbar instead of the pop up window so it can replace the native tool all together?

Pixero,

Then you can use Offset on Surface which shows interactively the offset profile and allow to type the offset distance in the VCB. Still many glitches with convoluted contours however.

Fredo
0
User avatar
fredo6 
PluginStore Author
PluginStore Author
 

Re: [Plugin] TIG-Smart_offset v1.5 20121224

Postby blajnov » Tue Dec 25, 2012 10:00 am

Excess loop ...
0

blajnov 
 

Re: [Plugin] TIG-Smart_offset v1.5 20121224

Postby TIG » Tue Dec 25, 2012 10:28 am

@blajnov

Looking at ways of minimizing this, and offsetting curves as curves...
Watch this space...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TIG-Smart_offset v1.6 20121225

Postby TIG » Tue Dec 25, 2012 11:30 am

Here's v1.6 viewtopic.php?p=446462#p446462
Curves/Arcs are now offset as curves in the offset-outline...
Speed improved.
Glitches avoided.

A Very Extra-Merry Xmas to you all... :D
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

Who is online

Users browsing this forum: No registered users and 11 guests

Visit our sponsors: