[Plugin] ArcByTools v1.2 20120412

[Plugin] ArcByTools v1.2 20120412

Postby TIG » Fri Nov 11, 2011 1:01 pm

(c) TIG 2011-2012
Script:
TIG-arcBYtools.rb
###
Type: TIG::ArcBy.rl
Menu: Draw >> TIG::ArcBy... >> Radius+Length
A dialog asks for Radius, ArcLength and NumberSegments.
The default values are 1m, 1m and 12.
A group containing an arc of that radius and length is added at [0,0,0]
It has clines and cpoints to help relocate it as needed.
The group is named showing the Arc_Radius_Length_Angle
The calculated Angle [to 6dp] might be useful...
If you add arguments after the typed command there is no dialog, e.g.
TIG::ArcBy.rl(1.m,1.m,24)
allowing it to be called from other methods invisibly.
It returns [group,angle] or nil on a failure.
###
Type: TIG::ArcBy.al
Menu: Draw >> TIG::ArcBy... >> SweptAngle+Length
A dialog asks for SweptAngle, ArcLength and NumberSegments.
The default values are 90 degrees, 1m and 12.
A group containing an arc of that swept-angle and length is added at
[0,0,0]
It has clines and cpoints to help relocate it as needed.
The group is named showing the Arc_Radius_Length_Angle
The calculated Radius [shown to current unit's accuracy] might be useful...
If you add arguments after the typed command there is no dialog, e.g.
TIG::ArcBy.al(45,1.m,18)
allowing it to be called from other methods invisibly.
It returns the [group,radius] or nil on a failure.
###
Type: TIG::ArcBy.rc
Menu: Draw >> TIG::ArcBy... >> Radius+ChordLength
A dialog asks for Radius, ChordLength and NumberSegments.
The default values are 1m, 1m and 12.
A group containing an arc of that radius and chord-length is added at
[0,0,0]
It has clines and cpoints to help relocate it as needed.
The group is named showing the Arc_Radius_ChordLength_Angle
The calculated Radius [shown to current unit's accuracy] might be useful...
If you add arguments after the typed command there is no dialog, e.g.
TIG::ArcBy.rc(2.m,1.m,18)
allowing it to be called from other methods invisibly.
It returns the [group,angle] or nil on a failure.
It will return nil / error if the ChordLength > Radius*2
###
Type: TIG::ArcBy.rs
Menu: Draw >> TIG::ArcBy... >> Radius+SegmentLength
A dialog asks for Radius, SegmentLength and NumberSegments.
The default values are 1m, 0.1m and 12.
A group containing an arc of that radius with the segment-length and number
and a claculated swept-angle is added at
[0,0,0]
It has clines and cpoints to help relocate it as needed.
The group is named showing the Arc_Radius_SegmentLength_Angle
If you add arguments after the typed command there is no dialog, e.g.
TIG::ArcBy.cs(1.m,250.mm,6)
allowing it to be called from other methods invisibly.
It returns the [group,angle] or nil on a failure.
###
Type: TIG::ArcBy.as
Menu: Draw >> TIG::ArcBy... >> SweptAngle+SegmentLength
A dialog asks for SweptAngle, SegmentLength and NumberSegments.
The default values are 90, 0.1m and 12.
A group containing an arc of a calculated radius with the given
swept-angle, segment-length and number of segments is added at
[0,0,0]
It has clines and cpoints to help relocate it as needed.
The group is named showing the Arc_Radius_SegmentLength_Angle
The calculated Radius [shown to current unit's accuracy] might be useful...
If you add arguments after the typed command there is no dialog, e.g.
TIG::ArcBy.as(45.0,250.mm,6)
allowing it to be called from other methods invisibly.
It returns the [group,angle] or nil on a failure.
###
Type: TIG::ArcBy.cs
Menu: Draw >> TIG::ArcBy... >> ChordX+ChordY+SegmentLength
A dialog asks for ChordX, ChordY, SegmentLength and NumberSegments.
The default values are 1m, 1m, 0.125m and 12.
A group containing an arc of a calculated radius with the chord from the
given chord-X/Y offsets, segment-length and number of segments is added at
[0,0,0]
It has clines and cpoints to help relocate it as needed.
The group is named showing the Arc_Radius_ChordLength_SegmentLength_Angle
The calculated Radius [shown to current unit's accuracy] might be useful...
If you add arguments after the typed command there is no dialog, e.g.
TIG::ArcBy.cs(1.m,500.mm,250.mm,6)
allowing it to be called from other methods invisibly.
It returns the [group,angle] or nil on a failure.
The arc's segment length should be to with ~0.02% of the specified length.
If you can't have an Arc with the given parameters you are told.
###
Donations: by PayPal.com to info @ revitrev.org
###
Version:
1.0 20111111 First issue.
1.1 20120219 Formating of group name adjusted.
1.2 20120412 Menu added. Extra ArcBy functions added.
###
1
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]ArcByTools v1.0. 20111111

Postby gnlmrc60b22f205v » Sat Feb 18, 2012 9:59 am

Good work but there is an error.

When I try to use "TIG.arcal" the Console Ruby report this:

TIG.arcal
Error: #<ArgumentError: C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/TIG-arcBYtools.rb:85:in `to_l': Cannot convert "25.0637705656528"" to Length>
C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/TIG-arcBYtools.rb:85
C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/TIG-arcBYtools.rb:85:in `arcal'
(eval):85


I solved changing:

g.name='Arc_R'+((r.to_f.to_s+'"').to_l.to_s.gsub(/ /,''))+'_L'+a.to_s+'_A'+an.to_s

with:

g.name='Arc_R'+r.to_s+'_L'+a.to_s+'_A'+an.to_s

I don't know if is the right procedure but it works.
0

gnlmrc60b22f205v 
 

Re: [Plugin]ArcByTools v1.0. 20111111

Postby TIG » Sat Feb 18, 2012 10:35 am

Unsure why it's not working for you... :?
If I enter this exact length into my version it returns a correct arc with a suitable named group and no errors.
It's also an odd error-message because the part of the code that's failing '25.0637705656528"'.to_l if pasted into the Ruby Console will work for me - does it for you !?
The original code is needed the way it is made to name the arc-group after it dimensions in 'current units', because things like 'radius' are only obtainable through the API in inches - so if you are working in 'mm' the .to_l is need to convert the arc's radius to 'mm'...
What are your current Model Info > Unit settings?
What exactly are you typing into the dialog.
The default is in 'current units' if typed without a units-suffix, but if a 'legal' units-suffix [m/cm/mm/"/'] is added then it should convert to that - so for example if you are working in inches but want a dimension in 'mm' type 1234mm; or conversely if you are working in 'm' but want to use inches type 67.8" ???
If your version works for you that's fine, but I wonder what it is that you are doing differently from the hundreds of other users who have no problems like this
:?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]ArcByTools v1.0. 20111111

Postby gnlmrc60b22f205v » Sun Feb 19, 2012 11:18 am

If I past the code '25.0637705656528"'.to_l into the Ruby Console I obtain this answer:

'25.0637705656528"'.to_l
Error: #<ArgumentError: (eval):24:in `to_l': Cannot convert "25.0637705656528"" to Length>
(eval):24
(eval):24


The Unit setting that I use is "millimeters" and the error came also with the default dimensions (90°, 1000mm, 12 segments).
I have a big quantity of plugin mounted on my Sketchup and this is the first that don't works fine.
A bug of the italian version of SU?
Booh!
0
Last edited by gnlmrc60b22f205v on Sun Feb 19, 2012 12:24 pm, edited 1 time in total.

gnlmrc60b22f205v 
 

Re: [Plugin]ArcByTools v1.0. 20111111

Postby TIG » Sun Feb 19, 2012 12:17 pm

What is your OS and SUp version - adding this to your profile is not compulsory BUT very helpful...
I two use mm and I get this in the Ruby Console -
'25.0637705656528"'.to_l
25.0637705656528

which in the original code it then turns into a 'current-unit'...
- so something is adrift with your system...
What other scripts do you have loading ?
There are a few that mess with the base-classes ill-advisedly.
Can you temporarily disable SketchyPhysics and DrivingDimensions [and any others not obtained directly from SCF/Smustard] and restart and try again...

You fix does not report the arc's radius in current units, but inches ?
I will adjust the code to try and make it compatible for everyone...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ArcByTools v1.1 20120219

Postby TIG » Sun Feb 19, 2012 12:35 pm

Here's v1.1 viewtopic.php?p=365402#p365402
Hopefully it avoids this rare group-name formating issue...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ArcByTools v1.1 20120219

Postby gnlmrc60b22f205v » Sun Feb 19, 2012 2:21 pm

Now it works!

In the meantime I tried the plugin with a completely clean Skechup (except sketchup.rb of course) but I got the same result. Most likely the problem is the Italian version of SketchUp 8.0.4811.

Thanks a lot.

Marco.
0

gnlmrc60b22f205v 
 

Re: [Plugin] ArcByTools v1.1 20120219

Postby Elibjr » Thu Mar 08, 2012 6:01 am

Thank you TIG. I have always wanted this tool.
0
User avatar
Elibjr 
Premium Member
Premium Member
 

Re: [Plugin] ArcByTools v1.1 20120219

Postby jeff hammond » Fri Apr 06, 2012 8:32 am

i have an idea for an addition to this plugin.. i'm not sure how you would call it.. maybe arc by height and sector length?


one thing that is very time consuming (and actually pretty hard) to accomplish when drawing a sketchup arc is if your model calls for a certain arc height along with a certain arc length per segment..

the basic problem is that you can only, somewhat easily, get one of those two..

if your arc is the proper height then you won't be able to control the sector length because the arc will evenly divide into x amount of segments throughout it's entire length.

if you draw an arc with the proper sector length, then cut it off at the required height, the end point will be wrong there (as you create an endpoint, which should happen at a radial length, on a random point somewhere along the segment)..

i have a dc that i use for doing this now, and while it's my go to for this, it can be cumbersome when i just want an arc.. (the dc creates a solid component as opposed to just a curve so i have to go in and copy/paste/delete/weld/etc.)

here's that DC:

DC_Template_cutter.skp



if you try the DC and play around with the component options, you'll see how the top sector is a different size/angle than the rest of the pie pieces.. it's adjusting to make the final endpoint to be the correct distance from the centerpoint and it's length varies depending on what happens with all the other sectors..
[EDIT- oh, but that dc is designed to stop an arc at 90º… if the desired height is greater than the radius then the difference will be drawn as a vertical line.. i think if you were to do the ruby, it shouldn't work like that.. it should keep going past 90 until a semicircle has formed (after which, i guess there would be an error as you couldn't create an arc with a height greater than 2x radius?]

i know the maths for it.. i don't know the ruby though :mrgreen:
so, here's one for a rainy day.. (and i hear it rains a lot over there :D )
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] ArcByTools v1.1 20120219

Postby TIG » Fri Apr 06, 2012 11:02 am

I understand about setting the segment length...
BUT what variables do you want to 'control'?
e.g.

Radius:
Segment Length:
Number of Segments:
[then the Chord Length varies]

or

Chord Length:
Segment Length:
Number of Segments:
[then the Radius varies]

or

Chord Offset from Center:
Segment Length:
Number of Segments:
[then the Radius and Chord Length varies]

OR perhaps all possibilities would be good?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ArcByTools v1.1 20120219

Postby EarthMover » Fri Apr 06, 2012 3:53 pm

Nice work TIG! This is not relevant to this plugin perhaps, but I've always been wondering if there were a way to make an arc tool that would draw arcs segmented by distance increments solely. If it were set to say, 6" a 10 linear foot arc would have 20 segments and a 20 LF arc would have 40 segments and so on. Would be great for rationing the segmentation as relative to the size of the arc. Just wondering.
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] ArcByTools v1.1 20120219

Postby jeff hammond » Fri Apr 06, 2012 4:55 pm

TIG wrote:I understand about setting the segment length...
BUT what variables do you want to 'control'?

OR perhaps all possibilities would be good?


yes, i think having an entire 'arc calculator' would be really neat.. it might have to have a 'choose from list' type of interface instead of needing to remember all the variations (eg- tig.arcal) for the console?

the configuration i'm requesting is radius, height, sector length:


archeight.jpg



it's that last segment (red) which is hard to get into proper position by any method i've tried so far..
thanks!


edit-- oh, and I realize sketchup won't see this as an 'arc' because the last segment is at a different angle... 'curve' would be fine

edit2-- also, the way I have the dc set up is if the last arc segment ends up being very short, it instead makes it longer than the other segments. (say the segment length is set to 20cm.. if the last on ends up being less than 2cm (or whatever) then the last segment would end up ~22cm.

you probably have a different idea on how that should be. it's just an attempt to avoids having two vertices very close together.
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] ArcByTools v1.1 20120219

Postby TIG » Fri Apr 06, 2012 5:38 pm

I'm on to it... I'll get back after the hols...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ArcByTools v1.2 20120412

Postby TIG » Thu Apr 12, 2012 12:01 pm

Here's v1.2 viewtopic.php?p=365402#p365402
Draw submenu added.
Several Extra ArcBy... functions added...
    'Radius+Length'
    'SweptAngle+Length'
    'Radius+ChordLength'
    'Radius+SegmentLength'
    'SweptAngle+SegmentLength'
    'ChordX+ChordY+SegmentLength'
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ArcByTools v1.2 20120412

Postby EarthMover » Thu Apr 12, 2012 12:34 pm

Great!! Went through all of them and they all seemed to be working fine on my end. It would great if the arcs could be placed interactively. If perhaps after entering the parameters the first click of the mouse would set them down and establish centerpoint, then dragging the mouse would rotate the arc around the centerpoint until the second click establishes position. Just a thought.
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] ArcByTools v1.2 20120412

Postby jeff hammond » Sat Apr 14, 2012 6:08 pm

TIG wrote:Here's v1.2 viewtopic.php?p=365402#p365402
Draw submenu added.
Several Extra ArcBy... functions added...
    'Radius+Length'
    'SweptAngle+Length'
    'Radius+ChordLength'
    'Radius+SegmentLength'
    'SweptAngle+SegmentLength'
    'ChordX+ChordY+SegmentLength'


Nice!
thanks!

i'll be trying this out today.
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] ArcByTools v1.2 20120412

Postby pilou » Sat Apr 14, 2012 6:18 pm

Near the perfection from the flaw! :)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] ArcByTools v1.2 20120412

Postby drfarkos » Wed Feb 06, 2013 4:08 pm

Sorry for stupid question, is your plugin meant to appear in Draw menu? I placed it in plugins folder inside Sketchup package, but do not see it.
0

drfarkos 
 

Re: [Plugin] ArcByTools v1.2 20120412

Postby TIG » Wed Feb 06, 2013 5:45 pm

It does appear as a submenu under the Draw menu.
It is compatible with PC/MAC Free/Pro and versions 7/8...
So this looks like you have mis-installed it...

I see you are on a MAC.
What 'plugins' folder did you place the .rb file into ?
It should have been the
Macintosh HD/Application Support/Google SketchUp 8/SketchUp/plugins
folder...
Also ensure you have FULL read/write permissions for that folder.
Perhaps you need to do a little reading on MAC-specific issues with plugin installation ?
Why not get Thomthom's 'Simple Plugins Installer' from the SCF Plugins Index linked in the menu above... Once this has been installed it adds a toolset to the Plugins menu that automatically installs tools in their four main forms as either an RB or RBS file & extracted file-sets from RBZ or ZIP archives... It ensure the correct files are put into the correct folders, avoiding any user generated issues...
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: alexsandrov, gabriellyfilgueiras and 48 guests

Visit our sponsors: