[Plugin] 3d Shapes Tool (was: Pyramid Tool)

[Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby Macs » Thu May 08, 2008 2:57 pm

Updated Version, now "3D shapes Tool"

1.0
shape: cone
shape: sphere
shape: rotated pyramid

1.1
+ shape: dodecahedron
+ shape: icosahedron
+ CTRL key to toggle between center or base first vertex.
+ varius minor improvement

Old starting post below:
Hello,
During my experiments with ruby programming for SU I've produced
this tool for drawing pyramids based on rotated rectangle tool.
Maybe it's useful to someone...

usage:
Menu->Draw->Rotated Pyramid

I think it's easy to use, but suggestions are welcome.


Note: that this is an OLD script, probably unsuitable for >v8 without some Ruby editing - why not look for SketchUp's own newer and more comprehensive Shapes tool at EW...

0
Last edited by Macs on Thu Jun 05, 2008 12:17 pm, edited 3 times in total.

Macs 
 

Re: Pyramid Tool

Postby juju » Thu May 08, 2008 3:37 pm

Hi Macs! Welcome to SCF, thanks for your contribution.

Please do the mods (and browsers) a favour, change the title to read: [Plugin] Pyramid Tool.

It makes it a lot easier to identify threads with plugins, as per the posting guidelines.
0
Save the Earth, it's the only planet with chocolate.
User avatar
juju 
Premium Member
Premium Member
 

Re: [Plugin] Pyramid Tool

Postby tomot » Thu May 08, 2008 9:10 pm

Thanks Macs, I have been looking for a code snippit for finding 3d mid points
and other points that work in all planes.
thanks also for not hiding the code, ala encryption.
0

tomot 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Pyramid Tool

Postby Macs » Fri May 09, 2008 8:51 am

Sorry for the title.. :) now it's correct.

@tomot: it's nothing, this is just my first experiment.. I'm happy if it could be of some help to others programmers.
0

Macs 
 

Re: [Plugin] Pyramid Tool

Postby JClements » Fri May 09, 2008 7:06 pm

Good job and thanks!
0
John
Illustrator
Beaverton, Oregon
User avatar
JClements 
Premium Member
Premium Member
 

Re: [Plugin] Pyramid Tool

Postby CPhillips » Mon May 12, 2008 6:07 am

Macs wrote:Hello,
During my experiments with ruby programming for SU I've produced
this tool for drawing pyramids based on rotated rectangle tool.
Maybe it's useful to someone...

usage:
Menu->Draw->Rotated Pyramid

I think it's easy to use, but suggestions are welcome.


Nice job! I think modeling tools like this are sorely missing from the basic Sketchup functionality.

Do you have any interest in expanding this to support other shapes? If so I would give you any support you need and I could provide a good head start on some of the other shapes (box, cylinder, cone, sphere, capsule).

Chris
0

CPhillips 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Pyramid Tool

Postby Macs » Wed May 14, 2008 4:28 pm

I've done some more work on it, completed a cone tool
and added a toolbar. I'm progressing with work, soon a new release
with more 3d shapes.

Well it's a sort of toolbar for newbies :)
who don't know how to draw more complex shapes in few steps.
I'm sure expert modelist know well how draw these shapes,
perhaps it will help when there are many to draw.
0

Macs 
 

Re: [Plugin] Pyramid Tool

Postby urgen » Wed May 14, 2008 6:31 pm

Macs wrote:I've done some more work on it, completed a cone tool
and added a toolbar. I'm progressing with work, soon a new release
with more 3d shapes.

Well it's a sort of toolbar for newbies :)
who don't know how to draw more complex shapes in few steps.
I'm sure expert modelist know well how draw these shapes,
perhaps it will help when there are many to draw.

...Marcs, it is very good and useful idea! :thumb: I thought of it and wished to ask about it Chris :? ... Success to you... It is necessary not only to beginners... really ! ;)
0
--pupil forever...------
User avatar
urgen 
 

Re: [Plugin] Pyramid Tool

Postby Gaieus » Thu May 15, 2008 10:15 am

Macs,

Before you invest much time in this project, have a look at shapes.rb (by @Last) downloadable from Didier's site here:
http://www.crai.archi.fr/RubyLibraryDep ... o_page.htm

It will create an item in the Draw menu.

I'm glad however that there are more and more ruby scripter around soo keep up the good work! :thumb:
0
User avatar
Gaieus 
 

Re: [Plugin] Pyramid Tool

Postby Macs » Thu May 15, 2008 4:36 pm

I've seen that script, mine is a little different, but it was useful to learn from it.
0

Macs 
 

Re: [Plugin] Pyramid Tool

Postby Gaieus » Thu May 15, 2008 4:39 pm

OK then, I just wanted to let you know... ;)
0
User avatar
Gaieus 
 

Re: [Plugin] Pyramid Tool

Postby urgen » Thu May 15, 2008 10:40 pm

////MMMMM :roll: ...... shapes rb.- table skript :? ... SK-FIZ (shapes)-it only drawing tool, but it

does not work with the keyboard... :? Let's make that the keyboard there worked! It will

be excellent and very useful tool! :D :bounce:
0
--pupil forever...------
User avatar
urgen 
 

Re: [Plugin] Pyramid Tool

Postby CPhillips » Fri May 16, 2008 7:47 am

In case you haven't seen it. Here is a demo of the shapes that are in the Solids toolbar of SketchyPhysics. It should probably be split out as a separate plugin. But I have too many plugins as is.

2

CPhillips 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Pyramid Tool

Postby Macs » Fri May 16, 2008 10:51 am

Ok! This is almost identical at what i'm coding... :lol:
I've missed this in SketchyPhysics.

I've seen there is some difference in how the shapes are drawn,
and I've inserted support for VCB input.

however here there is the new script, now "3D Shapes Tool"
0

Macs 
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby CPhillips » Fri May 16, 2008 8:33 pm

:ecstatic:

Looks like you are doing great. But feel free to copy anything you want out of SketchySolids. It is also based on the rotated rectangle code.
0

CPhillips 
PluginStore Author
PluginStore Author
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby urgen » Fri May 16, 2008 9:42 pm

...:thumb: :thumb: :thumb: don,t stop this work ,please! :D
0
--pupil forever...------
User avatar
urgen 
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby JClements » Sat May 17, 2008 3:00 am

Macs, nice work.

Is there any way to allow the tools to respond to a User Defined Axis?
0
John
Illustrator
Beaverton, Oregon
User avatar
JClements 
Premium Member
Premium Member
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby CPhillips » Sun May 18, 2008 10:20 am

Loving the plugin dude!

Suggestion. Once you place the shape it is hard to set the height. You need to have something to infer the height and if nothing is available it is frustrating. My solution was to add a construction line to the center of the shape after the second click.




Try adding the following line to the the ConeTool::increment_state() function.

Code: Select all
def increment_state
   @moved = false
   @state += 1            
    case @state
    when 1
      @ip1.copy! @ip
      Sketchup::set_status_text "Click to set the radius"
      Sketchup::set_status_text "Radius", SB_VCB_LABEL
      Sketchup::set_status_text "Move mouse", SB_VCB_VALUE
    when 2
        @ip1.clear
###################       
        Sketchup.active_model.entities.add_cline(@pts[0],@normal)
###################       
        Sketchup::set_status_text "Click to set the height"
        Sketchup::set_status_text "Height", SB_VCB_LABEL
        Sketchup::set_status_text "Move mouse", SB_VCB_VALUE
    when 3
        self.create_geometry
    end

end


Getting rid of the cline and having it work right with undo is a bit tricky, but if you are interested I can walk you through it.

Chris
0
Last edited by CPhillips on Sun May 18, 2008 11:08 am, edited 1 time in total.

CPhillips 
PluginStore Author
PluginStore Author
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby Jim » Sun May 18, 2008 10:58 am

Hi Macs,

Thank you for working on this. :thumb: It is a needed and important plugin, don't stop now!
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby dylan » Sun May 18, 2008 9:09 pm

This is really nice macs and very useful.

Thanks :thumb:
0

dylan 
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby Macs » Tue May 20, 2008 8:42 am

CPhillips wrote:Loving the plugin dude!

Suggestion. Once you place the shape it is hard to set the height. You need to have something to infer the height and if nothing is available it is frustrating. My solution was to add a construction line to the center of the shape after the second click.
[CUT]

Chris


Strange.. on my system my tool works differently :(
when you do the second click with the cone tool it goes up
and down with the height without being locked on the surface.
I have to review the code to see if I made some mistrake invocking
some method without "self.".

thank you for the suggestion on the costruction line, I'll think about it.
0

Macs 
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby CPhillips » Wed May 21, 2008 6:57 am

Strange.. on my system my tool works differently :(
when you do the second click with the cone tool it goes up
and down with the height without being locked on the surface.
I have to review the code to see if I made some mistrake invocking
some method without "self.".

thank you for the suggestion on the costruction line, I'll think about it.


I figured this out. In my case I build a lot of shapes on a big floor plane. When I draw a cone it infers the height from the floor. I don't think this is a flaw in your plugin. But the construction line is still useful in many cases.
0

CPhillips 
PluginStore Author
PluginStore Author
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby urgen » Wed May 21, 2008 8:16 am

....Please wait ....will be OK! ;) :D ..
0
--pupil forever...------
User avatar
urgen 
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby Macs » Wed May 21, 2008 8:18 am

You are right!
I've adde the construction line feature ( ripped from your tool :D )
It will be available in the next release, thank you.
0

Macs 
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby urgen » Wed May 21, 2008 8:32 am

Scripts is ready ;) , problems of translation(russian-english) :roflmao:
0
--pupil forever...------
User avatar
urgen 
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby urgen » Wed May 21, 2008 12:20 pm

...This is both very interesting and useful topic :thumb: …I wonder why the founders of SKETCH-UP haven’t done the 3d shapes (primitives) earlier :? …If we have raised such an issue and this caused that much interest, we have to finish it up… :!: I am not a script man, although many people say I would be capable of doing that quite a bit…unfortunately, quite poor knowledge of English and the tough schedule do not let me study RUBY in more details…I had a choice to make here: to draw or to write…I have chosen the 1st one…However, I do get the processes in scripts and can freely apply some changes for my personal convenience in my usage but not more than that…I quite like the style of painting the figures in SketchyPhysics ( Chris, I really appreciate it!) and the MACS style too… I have selected the files responsible for SHAPES building (from SketchyPhysics) and have made a decision to turn for help to one amazing Russian man Sahi (you possibly remember his name from the script “building a house”). In a few hours I got a response you can see below… :D …This is a Russian version and not everything works ideally, but much respect for his talent…he does not know English, but still manages to write English RUBI (imagine yourself writing RUBI in Russian or Chinese, which you do not know!!)… ..The many people the many minds, but the last thing I want is him to be remoted from the forum….thank you Sahi one more time! :ecstatic: .....all the parameters of the letters are ascribed with the help of the keyboards…very convenient! :thumb: ...MACS, I think that would be useful for you…And Chris---a comfortable supplementary for your SketchyPhysics. ;)
0
--pupil forever...------
User avatar
urgen 
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby CPhillips » Thu May 22, 2008 1:53 am

Thanks for doing that Urgen. But I recommend this only be used for reference. There is still a fair amount of physics stuff in there. And it that could conflict with future versions of SketchyPhysics.
0

CPhillips 
PluginStore Author
PluginStore Author
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby CPhillips » Thu May 22, 2008 2:01 am

I noticed you have the same problem I did when creating spheres. I was never able to figure out why they were sometimes reversed. I wound up doing my own sphere routine.

What other shapes do you plan to support?
0

CPhillips 
PluginStore Author
PluginStore Author
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby sahi » Thu May 22, 2008 12:14 pm

Corrected some errors
arazdel-13.jpg

SketchyPhysics_1.zip
0

sahi 
PluginStore Author
PluginStore Author
 

Re: [Plugin] 3d Shapes Tool (was: Pyramid Tool)

Postby lapx » Thu May 22, 2008 1:46 pm

Can parametric tool be added this. After or during adding shape you can change radius or height parameters. VCB stuff you know. Now this would be fantastic!!! :fro:
0

lapx 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: No registered users and 17 guests

Visit our sponsors: