Re: [Plugin] Another Mirror Ruby

Re: [Plugin] Another Mirror Ruby

Postby watkins » Fri Jul 25, 2008 3:07 pm

Dear James,

I use Mirror.rb (Version 3.0), tweaked by TIG, but originally by Frank Wiesner. How is version 3[1].0 different from that existing? An icon would be useful too as I use this script a lot. The AutoCAD icon shows a mirrored triangle.

Kind regards,
Bob
EDIT: NOTE THAT THE LATEST VERSION OF 'MIRROR' IS NOW AVAILABLE HERE viewtopic.php?p=276512#p276512
0

watkins 
 

Re: [Plugin] Another Mirror Ruby

Postby Matt666 » Fri Jul 25, 2008 5:15 pm

Here is icon I use for this plugin.
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Another Mirror Ruby

Postby boofredlay » Fri Jul 25, 2008 5:57 pm

Matt, do you use it for the Mirror3[1].0.rb or for Mirror.rb?
And how do you get the icon/button to work with the script?
Thanks.


The current issue I have with Mirror.rb is that I get a bugsplat about 15-20% of the time, which inversely correlates to the frequency of times I save before using it. :cry:
0
User avatar
boofredlay 
Global Moderator
 

Re: [Plugin] Another Mirror Ruby

Postby Matt666 » Fri Jul 25, 2008 6:14 pm

Hi Boofredlay !
do you use it for the Mirror3[1].0.rb or for Mirror.rb?

I don't know !! I've renamed it...

At the beginning of the script, it's written :
# Name : Mirror 3.0 ###

# Description : Mirrors Selection at Point, Line or Plane

# Author : Originally by Frank Wiesner
# BUT NOTE from v2.6 it's been TIG tweaked and rewritten...###

# Usage : 1. Make Selection (Any Entites allowed)###
# 2. Select 'Mirror Selection' from Plugins Menu
# or from Context Menu or your ShortCut Key ###
# 3. If here's no Selection then dialog informs ###
# 4. Pick a Point and RETURN to Mirror at the Point
# 5. Pick a Second Point and RETURN to Mirror at the Line
# 6. Pick a Third Point to Mirror at the Plane
# 7. Final Option is Erase Original ? ###
# If Yes then Highlighting of Selection passes to Copies
# (Note: Erase is undo-able separately from the Mirroring) ###



how do you get the icon/button to work with the script?

Replace that
Code: Select all
if( not file_loaded?("mirror3.0.rb") )
   UI.menu("Plugins").add_item("Mirror Selection") { Sketchup.active_model.select_tool MirrorTool.new }
   UI.add_context_menu_handler do | menu |
      if Sketchup.active_model.selection
         menu.add_separator
         menu.add_item("Mirror Selection") { Sketchup.active_model.select_tool MirrorTool.new }
      end
   end
end
file_loaded("mirror3.0.rb")


By that :
Code: Select all
if( not file_loaded?("mirror3.0.rb") )
   tb = UI::Toolbar.new("Mirror")
   cmd = UI::Command.new("MI") { Sketchup.active_model.select_tool MirrorTool.new }
   cmd.large_icon = cmd.small_icon = File.join("plugins", "MI.png")
   cmd.tooltip = cmd.status_bar_text = "Mirror"
   tb.add_item(cmd)
   UI.menu("Plugins").add_item("Mirror Selection") { Sketchup.active_model.select_tool MirrorTool.new }
   UI.add_context_menu_handler do | menu |
      if Sketchup.active_model.selection
         menu.add_separator
         menu.add_item("Mirror Selection") { Sketchup.active_model.select_tool MirrorTool.new }
      end
   end
   state = tb.get_last_state
   if(state == TB_NEVER_SHOWN)
      tb.show
   elsif (state == TB_VISIBLE)
      tb.restore
   end
end
file_loaded("mirror3.0.rb")

In the code.
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Another Mirror Ruby

Postby boofredlay » Fri Jul 25, 2008 6:51 pm

Thanks Matt, that did the trick however I cannot see the image, just the toolbar. I have the image placed in my Plugins folder, does it need to go elsewhere?

Thanks again.
0
User avatar
boofredlay 
Global Moderator
 

Re: [Plugin] Another Mirror Ruby

Postby Didier Bur » Fri Jul 25, 2008 10:44 pm

Hi,

cmd.large_icon = cmd.small_icon = File.join("plugins", "MI.png")

This line sounds wrong to me. Replace it with:

Code: Select all
cmd.large_icon = cmd.small_icon = "Plugins"/MI.png"
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: [Plugin] Another Mirror Ruby

Postby Matt666 » Sat Jul 26, 2008 12:18 am

Oops :thumbd: :oops:
Excuse me I have not tested the code...
Didier wrote:cmd.large_icon = cmd.small_icon = "Plugins"/MI.png"

I don't use slashes in my scripts, because I think (not sure) they could cause a bug on mac machines...
Code: Select all
cmd.large_icon = cmd.small_icon = File.join(File.dirname(__FILE__),"MI.png")


Thank you for your correction Didier !
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Another Mirror Ruby

Postby TIG » Sun Jul 27, 2008 10:12 pm

James wrote:I now TIG did one but here's another..
Mirror Creates reversed images of existing objects. You have the option of erasing or retaining your original image – to create a symmetrical mirror effect or to simply reverse the image. Author: Originally created by Frank Wiesner.
Mirror3[1].0.rb

To set the record straight... Frank invented the Mirror script ages ago: however, after version 2.6 I rewrote it - using some of his algorithms for picking the mirroring lines/planes etc, but with a completely different mirroring method. Everything after v3 [so far] is my tweaking of the code... My version is at v3.1...

If you want to make a toolbar / icon feel free. Remember to increment the revision / version and publish it. Then if I [or anyone else taking up the mantel] need to make any future adjustments it'll be based on that current updated version...

Mirror is in the public domain - so simply adjust it with your 'improvements' - remembering to credit previous originators - like Frank, or me - in the introductory notes - and let it rip...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Another Mirror Ruby

Postby boofredlay » Mon Jul 28, 2008 3:13 am

Thanks!
0
User avatar
boofredlay 
Global Moderator
 

Re: [Plugin] Another Mirror Ruby

Postby Edson » Mon Jul 28, 2008 11:27 am

perhaps some of our ruby experts could tweak this script so that when installed the icon would be too.
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: [Plugin] Another Mirror Ruby

Postby arjunmax09 » Tue Feb 16, 2010 1:00 pm

I installed the icon made by matt666 in my plugins directory and made the requisite changes to the plugin as specified on this forum. The icon is showing in my SketchUp Interface. Unfortunately when I select a group, click on the mirror icon, select two axis for mirroring. ....nothing happens :(



i've modified the plugin like this...



Code: Select all
# Name :          Mirror 3.0 ###

# Description :   Mirrors Selection at Point, Line or Plane

# Author :        Originally by Frank Wiesner
#              BUT NOTE from v2.6 it's been TIG tweaked and rewritten...###

# Usage :         1. Make Selection (Any Entites allowed)###
#                 2. Select 'Mirror Selection' from Plugins Menu
#                or from Context Menu or your ShortCut Key ###
#                 3. If here's no Selection then dialog informs ###
#                 4. Pick a Point and RETURN to Mirror at the Point
#                 5. Pick a Second Point and RETURN to Mirror at the Line
#                 6. Pick a Third Point to Mirror at the Plane
#                 7. Final Option is Erase Original ? ###
#                If Yes then Highlighting of Selection passes to Copies
#                (Note: Erase is undo-able separately from the Mirroring) ###

# Type :         Script

# History:     
#            3.0  05 Aug  2006 ### TIG Ending rewritten to avoid rare bugsplats.
#            2.9  03 Aug  2006 ### TIG Start:commit loops to avoid rare bugsplats.
#            2.8  26 July 2006 ### TIG re-tweaked - Rewritten to be MUCH simpler.
#                              Mirroring of ANY Entity Selection works properly.
#            2.7  23 July 2006 ### TIG tweaked - Rewritten generally.
#                              Now processes Multiple selections of Groups and/or
#                              Components, but warns if any 'loose' (UnGrouped)
#                              Faces in Selection as they might lose any RePostioned
#                              Texture data, interfere etc. 
#            2.6  22 July 2006 ### TIG tweaked - Context menu added IF ONE group/compo. 
#                                       Warns about selection IF NOT ONE group/compo. 
#                                       Materials now preserved in mirrored copy BUT you will
#                               need to group selection to preserve material positioning
#                              - although this is define-able it is not find-able from
#                              the orignal face info ! 
#                                       Final option to Erase of Original Group/Compo.
#                 2.5  (8.Jul.2oo5)  - bugfix: faces with holes reduce now to a single face
#                                    - major code rewrite (dropped @clondedObject hash, heavy
#                                      use of groups during construction,...
#                                    - more redundant constructions, but seems to be more robust
#                                    - WARNING: POLYGONS DO NOT WORK VERY WELL
#                 2.4  (5.Jul.2oo5)  - all unnecessary edges created by the add_faces_from_mesh()
#                                      method are erased! faces with holes mirror now perfectly.
#                 2.3  (4.Jul.2oo5)  - fixed "mirror at plane" error
#                 2.2  (2.Jul.2oo5)  - works in group editting mode
#                                    - prevents picking of identical points
#                 2.1  (1.Jul.2oo5)  - fixed "undo group" bug
#                                    - code cleanup
#                 2.0  (30.Jun.2oo5) - new tool-like interface
#                 1.4  (29.Jun.2oo5) - arc bug fixed
#                                    - code simplified (clone_selection() removed)
#                 1.3  (24.Jun.2oo5) - can handle faces with holes in it (although more edges
#                                      are drawn than nessesary)
#                                    - correct orientation of mirrored faces
#                                    - supports arcs (at least works for circles), curves and groups
#                 1.2  (20.Jun.2oo5) - axis and origin selection algorithm does not rely on tool tips any more.
#                 1.1  (19.Jun.2oo5) - fix coplanar point bug
#                                    - better tooltips
#                                    - supports mirror at lines (edges, axis, construction lines)
#                                    - mirror-at-plane code simplified
#                 1.o  (10.Jun.2oo5) - first version

require 'sketchup.rb'
class MirrorTool

    def initialize
        @MIRROR_AT_POINT = 1
        @MIRROR_AT_LINE = 2
        @MIRROR_AT_PLANE = 3
        @numPrecision = 0.00001
    end
    def reset
        @pts = []
        @state = 0
        @transformationType = nil
        @trans = nil
        @point = nil
        @line = nil
        @linev = nil
        @plane = nil
        @planeNormal = nil
        @pointOnPlane = nil
        @curvesDone = Hash.new()
        @cloneGroup = nil
        @ip = Sketchup::InputPoint.new
        @ip1 = Sketchup::InputPoint.new
        @ip2 = Sketchup::InputPoint.new
        @ip3 = Sketchup::InputPoint.new
        @ip = Sketchup::InputPoint.new
        Sketchup::set_status_text "Mirror:  Pick First Point"###
        @drawn = false
    end
    def activate
        ###Sketchup.send_action("showRubyPanel:")
        self.reset
        ss=Sketchup.active_model.selection
        if ss.empty?
            Sketchup::set_status_text "Mirror: NO Selection !"###
          UI.messagebox("Select Something BEFORE Using the Mirror Tool.")###v2.8
            Sketchup.active_model.select_tool nil
        end
    end
    def deactivate(view)
        view.invalidate if @drawn
        @ip1 = nil
        @ip2 = nil
        @ip3 = nil
    end
    def onMouseMove(flags, x, y, view)
        case @state
        when 0 # getting the first end point
            @ip.pick view, x, y
            if( @ip.valid? && @ip != @ip1 )
                @ip1.copy! @ip
            end
            view.invalidate
            view.tooltip = @ip.tooltip if @ip.valid?
        when 1 # getting the second end point
            @ip.pick view, x, y, @ip1
            if( @ip.valid? && @ip != @ip2 )
                @ip2.copy! @ip
                @pts[1] = @ip2.position
            end
            view.invalidate
            view.tooltip = @ip.tooltip if @ip.valid?
        when 2 # getting the third end point
            @ip.pick view, x, y, @ip2
            if( @ip.valid? && @ip != @ip3 )
                @ip3.copy! @ip
                @pts[1] = @ip3.position
            end
            view.invalidate
            view.tooltip = @ip.tooltip if @ip.valid?
        end
    end
    def onLButtonDown(flags, x, y, view)
        @ip.pick view, x, y
        if( @ip.valid? )
            case @state
            when 0
                if( @ip.valid? )
                    @pts[0] = @ip.position
                    Sketchup::set_status_text "Mirror:  Hit RETURN to Mirror at Point or Pick Point 2"
                    @state = 1
                end
            when 1
                if( @ip.valid? && @ip != @ip1 )
                    @pts[1] = @ip.position
                    @state = 2
                    Sketchup::set_status_text "Mirror:  Hit RETURN to Mirror at Line or Pick Point 3"
                end
            when 2
                if( @ip.valid? && @ip != @ip1 && @ip != @ip2 )
                    @pts[2] = @ip.position
                    @state = 3
                    mirror()
                end
            end
        end
    end
    def onCancel(flag, view)
        view.invalidate if @drawn
        reset
    end
    def draw(view)
        if( @ip.valid? && @ip.display? )
            @ip.draw(view)
            @drawn = true
        end
        if( @state == 1 )
            view.set_color_from_line(@ip1, @ip)
            view.draw(GL_LINE_STRIP, @ip1.position, @ip.position)
            @drawn = true
        elsif( @state == 2 )
            view.drawing_color = "gray"
            view.draw(GL_LINE_STRIP, @ip1.position, @ip2.position)
            view.set_color_from_line(@ip2, @ip)
            view.draw(GL_LINE_STRIP, @ip2.position, @ip.position)
            @drawn = true
        end
    end
    def onKeyDown(key, repeat, flags, view)
        if( key == CONSTRAIN_MODIFIER_KEY && repeat == 1 )
            @shift_down_time = Time.now
            if( view.inference_locked? )
                view.lock_inference
            elsif( @ip.valid? )
                view.lock_inference @ip
            end
        end
    end
    def onKeyUp(key, repeat, flags, view)
        if( key == CONSTRAIN_MODIFIER_KEY && view.inference_locked? && (Time.now - @shift_down_time) > 0.5 )
            view.lock_inference
        end
        if( key == 13)
            mirror()
            self.reset
        end
    end
   
    def mirror()
        case @state
        when 1
            @transformationType = @MIRROR_AT_POINT
            @point = @ip1.position.clone
            @trans = Geom::Transformation.scaling(@point, -1.0)
            Sketchup.active_model.start_operation "Mirror at Point"
        when 2
            @transformationType = @MIRROR_AT_LINE
            @line = [@ip1.position, @ip2.position]
            @linev = Geom::Vector3d.new(@ip2.position.x-@ip1.position.x, @ip2.position.y-@ip1.position.y, @ip2.position.z-@ip1.position.z)
            Sketchup.active_model.start_operation "Mirror at Line"
        when 3
            @transformationType = @MIRROR_AT_PLANE
            @plane = Geom.fit_plane_to_points(@ip1.position, @ip2.position, @ip3.position)
            @planeNormal = Geom::Vector3d.new(@plane[0], @plane[1], @plane[2])
            @planeNormal.normalize!
            @pointOnPlane = @ip1.position
            Sketchup.active_model.start_operation "Mirror at Plane"
        end
        ###
        ss=Sketchup.active_model.selection###
       sents=[]
       ss.each{|e|sents.push(e)}
       copy_group=Sketchup.active_model.active_entities.add_group(sents)
        new_group=copy_group.copy
        nents=[]
        new_group.entities.each{|e|nents.push(e)}
        new_center = new_group.bounds.center.clone
        mirror_point(new_center)
        t=nil
        t = Geom::Transformation.scaling(new_center,-1,-1,-1)if @state==1
        t = Geom::Transformation.rotation(new_center,@linev,Math::PI)if @state==2
        tt=nil
        if @state==3
           xxx=@planeNormal.normalize.to_a[0].abs*-1
           yyy=@planeNormal.normalize.to_a[1].abs*-1
           zzz=@planeNormal.normalize.to_a[2].abs*-1
           xxx=1 if xxx>0
           yyy=1 if yyy>0
           zzz=1 if zzz>0
           xxx=-1 if xxx<=0
           yyy=-1 if yyy<=0
           zzz=-1 if zzz<=0
           t = Geom::Transformation.scaling(new_center,xxx,yyy,zzz)
           tt= Geom::Transformation.rotation(new_center,@planeNormal,Math::PI)
        end#if
        new_group.transform!(t)if t###mirror
        new_group.transform!(tt)if tt###
        transVec = Geom::Vector3d.new(new_center.x-new_group.bounds.center.x, new_center.y-new_group.bounds.center.y, new_center.z-new_group.bounds.center.z)
        t = Geom::Transformation.translation(transVec)
        new_group.transform!(t)###then move
        ### ending dialog...
       Sketchup::set_status_text "Mirror: Erase Original Selection ?"###
       if UI.messagebox("Erase Original Selection ? ",MB_YESNO,"")==6
          ### 6=YES 7=NO
          Sketchup.active_model.commit_operation###v2.9
            Sketchup.active_model.start_operation "Mirror: Erase Original Selection"
           Sketchup.active_model.selection.clear
             copy_group.erase!
           new_group.explode
             nents.each{|e|Sketchup.active_model.selection.add(e)if e.valid?}###v3.0
          Sketchup.active_model.commit_operation
         else
           Sketchup.active_model.selection.clear
           new_group.explode
           copy_group.explode
           sents.each{|e|Sketchup.active_model.selection.add(e)if e.valid?}###v3.0
           Sketchup.active_model.commit_operation###v2.9
       end#if
       ###
        self.reset
        Sketchup.send_action "selectSelectionTool:"

    end#def
   
    def mirror_point(new_p)
        if (@transformationType == @MIRROR_AT_PLANE)
            if (!new_p.on_plane?(@plane))
                mirrorp = new_p.project_to_plane(@plane)
                @trans = Geom::Transformation.scaling(mirrorp, -1.0)
                new_p.transform!(@trans)
            end
        elsif (@transformationType == @MIRROR_AT_LINE)
            if (!new_p.on_line?(@line))
                mirrorp = new_p.project_to_line(@line)
                @trans = Geom::Transformation.scaling(mirrorp, -1.0)
                new_p.transform!(@trans)
            end
        elsif (@transformationType == @MIRROR_AT_POINT)
            if (!(new_p == @point))
                new_p.transform!(@trans)
            end
        end
    end#def
   
end # class MirrorTool

### menus ##############################################################
    if( not file_loaded?("mirror3.0.rb") )
       tb = UI::Toolbar.new("Mirror")
       cmd = UI::Command.new("MI") { Sketchup.active_model.select_tool MirrorTool.new }
       cmd.large_icon = cmd.small_icon = File.join(File.dirname(__FILE__),"MI.png")
       cmd.tooltip = cmd.status_bar_text = "Mirror"
       tb.add_item(cmd)
       UI.menu("Plugins").add_item("Mirror Selection") { Sketchup.active_model.select_tool MirrorTool.new }
       UI.add_context_menu_handler do | menu |
          if Sketchup.active_model.selection
             menu.add_separator
             menu.add_item("Mirror Selection") { Sketchup.active_model.select_tool MirrorTool.new }
          end
       end
       state = tb.get_last_state
       if(state == TB_NEVER_SHOWN)
          tb.show
       elsif (state == TB_VISIBLE)
          tb.restore
       end
    end
    file_loaded("mirror3.0.rb")
0
when you fail at something....you haven't really failed...you've found one way the thing will not work out

arjunmax09 
Banned
 

Re: [Plugin] Another Mirror Ruby

Postby thomthom » Tue Feb 16, 2010 1:07 pm

arjunmax09: All formatting is lost like that. Use the [code] tag to mark up code. Or preferably, when you got a longer piece of code like that, just upload the .rb file.
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] Another Mirror Ruby

Postby TIG » Tue Feb 16, 2010 1:17 pm

Please remove one of your duplicated posts - one is more than long enough ! [done, thanks]
Also, please put long bits of code inside a code/code-block - it keeps its formating and is easier to read/copy.

Your toolbar/menu part works fine for me - so you must have edited something else within the main text ???
Just copy your new part [below '###menus###...'] and then paste it over the equivalent section in a copy of the original script - it should then work...
Note that the last version is 3.1...

Are you picking suitable axes, points to actually give a 'mirror' ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Another Mirror Ruby

Postby arjunmax09 » Wed Feb 17, 2010 12:05 pm

TIG wrote:Please remove one of your duplicated posts - one is more than long enough ! [done, thanks]
Also, please put long bits of code inside a code/code-block - it keeps its formating and is easier to read/copy.

Your toolbar/menu part works fine for me - so you must have edited something else within the main text ???
Just copy your new part [below '###menus###...'] and then paste it over the equivalent section in a copy of the original script - it should then work...
Note that the last version is 3.1...

Are you picking suitable axes, points to actually give a 'mirror' ?


yeah i'm picking the right axes, points to give a mirror.... only to find nothing...

:? uh.... TIG I know zilch about ruby... I just followed the instructions given on the forum to modify my mirror plugin... but nothin' happened... I'm unable to understand the instructions that ur givin' on this post. Is it necessary that I keep the old mirror ruby in my folder as well as the new one... i.e. 2 ruby files for mirror in my plugins folder??
0
when you fail at something....you haven't really failed...you've found one way the thing will not work out

arjunmax09 
Banned
 

Re: [Plugin] Another Mirror Ruby

Postby TIG » Wed Feb 17, 2010 12:24 pm

You only need one 'version' of the script.
It is a self-contained file with everything it needs inside it [unless of course it's the toolbar version which then needs the button's image file too]

Temporarily remove one of the scripts and see if the other one works...
Also try opening the Ruby Console [Windows Menu] and type in [or easier copy/paste it]

Sketchup.active_model.select_tool(MirrorTool.new)

then <enter> key.

Does the mirror tool then work or print an error etc ? :?
Do you get prompted for the axes etc ?
What does the Ruby Console say when you run the tool in the four available ways - from Plugins Menu, Toolbar, Right-click Context-Menu and Typing in the command as above ?

Do you pick three discrete points that form something to mirror about - say one point on the group and then a point on the green axis and one on then blue axis ? You should then get a copy made and a request to keep/erase the original...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Another Mirror Ruby

Postby arjunmax09 » Wed Feb 17, 2010 12:30 pm

TIG wrote:You only need one 'version' of the script.
It is a self-contained file with everything it needs inside it [unless of course it's the toolbar version which then needs the button's image file too]

Temporarily remove one of the scripts and see if the other one works...
Also try opening the Ruby Console [Windows Menu] and type in [or easier copy/paste it]

Sketchup.active_model.select_tool(MirrorTool.new)

+ <enter> key.

Does the mirror tool then work or print an error etc ? :?



No ... it doesn't ....My older version of mirror plugin works just fine [i haven't tweaked it for the icon]... ..Can you upload your tweaked mirror script [ the one that uses the icon]so that i can use it????


and... one more question..... I don't know ruby... is there a standard string that can be added to a ruby script so that i can make its custom toolbar or buttons work...??? I really hate scrolling through the plugins menu to get the one i want to use...
0
when you fail at something....you haven't really failed...you've found one way the thing will not work out

arjunmax09 
Banned
 

Re: [Plugin] Another Mirror Ruby

Postby TIG » Wed Feb 17, 2010 12:34 pm

See my edited post...
Have you removed the 'working version' and retried in case they are clashing ?
I actually don't have a toolbar version as I always use a shortcut key to run it. :cry:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Another Mirror Ruby

Postby arjunmax09 » Thu Feb 18, 2010 5:12 am

TIG wrote:See my edited post...
Have you removed the 'working version' and retried in case they are clashing ?
I actually don't have a toolbar version as I always use a shortcut key to run it. :cry:



Yeah... i've removed my 'workin version' and retried ....... the problem persists....

Actually this is what happening...

The objects that i want to mirror get recreated as a group on the spot itself. suppose i have a cube and next to it a sphere is there....

i select the sphere and cube using the shift key...

next i click on mirror button

next... i draw a line along green axis


now... i draw my path across blue axis...

..... the two objects get grouped together on the spot...

i can't seem to figure out the problem :(
0
when you fail at something....you haven't really failed...you've found one way the thing will not work out

arjunmax09 
Banned
 

Re: [Plugin] Another Mirror Ruby

Postby TIG » Thu Feb 18, 2010 10:15 am

It groups them to do the mirroring then explodes the group back as it was - if it's working...

I have decided I will add the tool button to the script for you and ensure it's working, then post it.

Can you post the .png button image for me please... :?:
EDIT: no need I found it...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]Mirror Ruby v3.2

Postby TIG » Thu Feb 18, 2010 10:57 am

Here's v3.2 with the toolbar option added.
Otherwise the script's workings are unchanged.
It's been fully tested and works when activated from the Menu, the Context-Menu, a Shortcut or the new Toolbar.
If the MI.png file is not found with the .rb file then the toolbar is NOT made.
You can activate this new 'Mirror' toolbar from View>Toolbars.
Put these 2 files into 'Plugins' - you can omit MI.png [or rename] it if you don't want a toolbar.
Mirror.rb
MI.png

:ugeek:
EDIT: NOTE THAT THE LATEST VERSION IS NOW AVAILABLE HERE viewtopic.php?p=276512#p276512
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Another Mirror Ruby

Postby broomstick » Fri Feb 19, 2010 4:57 pm

I think a variant of the Mirror Plugin, should consider creating a toolbar with 3 buttons: each one would perform the mirror simmetrically to one of the axis, asking before the operation to click on the plane to define the start of the mirror line.

It would work similarly to rot90 plugin, but for the mirror.

I hate myself for not being able to code, otherwise I'd do it myself!
0
User avatar
broomstick 
 

Re: [Plugin] Another Mirror Ruby

Postby ideas_arte » Sat Feb 20, 2010 12:55 am

Thank you very much, a basic tool and very useful!
:berserk:
0

ideas_arte 
 

Re: [Plugin] Another Mirror Ruby

Postby bjack56 » Wed Mar 17, 2010 6:48 pm

Thank you...works great, once I figured out to "right-click.save as" the image. :ecstatic:
0

bjack56 
 

Re: [Plugin] Another Mirror Ruby

Postby Ben Ritter » Thu May 06, 2010 3:30 pm

Thanks for the script. However, I get a Bug Splat when I do not erase the original. I do not have this problem with SU 6. I'm running SU7.
0

Ben Ritter 
 

Re: [Plugin] Another Mirror Ruby

Postby dedmin » Mon May 17, 2010 1:59 pm

Bugsplat with Outliner open! SU7.
0

dedmin 
 

Re: [Plugin] Another Mirror Ruby

Postby lapx » Wed Sep 01, 2010 4:37 pm

I'm getting the bugsplat as well and I'm using Su6. It worked fine before. But not working these days?
It occurs when answering "no" to erase original. BUGSPLAT! everytime.
0

lapx 
 

Re: [Plugin] Another Mirror Ruby

Postby lapx » Wed Sep 01, 2010 9:36 pm

There error occurs with all three scrpits that I have: mirror 3[1].0rb , mirror2.8.rb and mirror.rb.
I tested each one while temporarily renaming the others and each one failed with a bugsplat.
Might there be conflicts with some other script(s)? :shock:
0

lapx 
 

Re: [Plugin] Another Mirror Ruby

Postby dedmin » Sun Oct 03, 2010 1:34 pm

Can the Bugsplat when Outliner is open be fixed? I always forget about this and crash SketchUP!

2010-10-03_152559.jpg
0

dedmin 
 

Re: [Plugin] Another Mirror Ruby

Postby TIG » Sun Oct 03, 2010 2:54 pm

You have to 'roll-up' the Outliner window to avoid a splat - it's a known issue with Sketchup itself... not any tool per se... You should never use any tool that makes and deletes instances in succession with the Outliner 'rolled-down'...
I have posted an updated version here viewtopic.php?p=276512#p276512

Don't worry about the 'group.make_unique is deprecated...' error messages - it's a known mistake in the API error reporting, and Thomthom has been pressing to get it removed - you DO need to use group.make_unique in some circumstances...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Another Mirror Ruby

Postby dedmin » Sun Oct 03, 2010 3:17 pm

I see - thanks TIG!
0

dedmin 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: JUNGHEE, oheimala, sketchy22 and 14 guests

Visit our sponsors: