[Plugin] 3D Parametric Shapes - makes placeable components
-
Plugin and text revised 3 Dec 2014
v2.5 (late Nov 2014) changes the drawn shapes from groups to components, and allows the user to place them at any pickable point, not just insert them at the world origin.
v2.51 (1 Dec 2014) corrects internal version number labelling in jwm_shapes_loader.rb and jwm_shapes.rb files to match external version number
v2.5.2 (1 Dec 2014) corrects error introduced in parametric.rb where a typo in the Module name stopped plugin from loading.
v2.5.3
Fixed name errors in modules that broke Torus, Dome and Sphere which relied on mesh_additions.rb.John McClenahan 2014 and Trimble Navigation Ltd Sketchup Team 2014
Purpose
This plugin enables Sketchup users to draw and subsequently edit a range of common
geometric shapes by specifying in a dialogue box their size and (where relevant) the number of segments to use when drawing shapes based on circles, polygons, or helix.The plugin installs a 3D Shapes sub-menu in the standard Sketchup Draw menu, with a selection of shapes chosen from a sub-sub-menu:
-
Box
-
Cylinder
-
Cone
-
Torus
-
Tube
-
Prism
-
Pyramid
-
Dome
-
Sphere
-
Helix
-
Helical Ramp
-
Helical Ramp with Sides
Edit the parameters to the desired size and (where relevant) number of segments or sides to use, and click [OK]. The shape is then drawn located at the axis origin [0,0,0] as a Group.
The drawn shape can be undone in one operation using Ctrl+Z or Alt+Backspace keyboard
shortcut, or using the Edit/Undo menu. Once undone, it can be re-done by using the menu
Edit/Redo… Shapes, or Ctrl+Y immediately, before issuing any other command.When any previously drawn 3D Shape is selected, a right-click Context menu (Edit…Shapes)
allows the user to change any of its defining parameters using a pop-up dialogue.The plugin uses two other Ruby scripts – parametric.rb and mesh_additions.rb – which are
included in the .rbz plugin file and automatically installed along with the shapes.rb file.It has only been tested by me on Windows 7 Pro and Sketchup 8, 2013, 2014 and 2015 but will probably work on earlier versions of Sketchup, on Windows XP or later. I have no way of testing it on a Mac.
Language is English only.
What's new?
My additions extend the original Trimble Sketchup Team plugin to provide:
• FOUR additional shapes – Sphere, Helix, Helical Ramp, and Helical Ramp with Sides
• User selection of the number of segments to use when drawing shapes based on a circle,
not just a fixed default (usually 24 in the original plugin)
• Drawing a Pyramid with any number of sides in its base polygon, not just a square base
• Default sizes remembered from the previous use of that shape in the same Sketchup session
• Initial default sizes on first use of a shape are selected according to the model units and unit format, usually one unit for length, height, width, depth or radius (using feet, inches or metres) or 10 units for millimetre and centimetre units (10 mm or 10 cm)
• The initial default number of segments to draw is set at 16 for most shapes, and 4 per 90 degrees for Dome or Sphere. It can be changed by the user (and will be remembered for
the duration of the Sketchup session)Helical shapes will be drawn upwards from the origin (by default, with end height higher than start height), or downwards by setting the start height higher than the end height.
Helical shapes can be made left handed by setting No. of rotations to a negative value.
Helical shapes can be drawn starting at any specified start anglefrom the x-axis.
The helical ramp further adds to the helix, and draws an (optionally tapering) helical ramp surface, with ramp starting width, ending width, start and end height parameters.
[To make a permanent change to the initial default number of segments, edit the shapes.rb
file default_parameters method for each shape Class, and change the line @@segments = 16 to your desired default.]The code to draw the Helix is adapted from DrawHelix13.rb by Peter Brown (2004) and DrawHelix14.rb by Jim Foltz (ca 2010), which was an update of Peter Brown's plugin.
Installation
In Sketchup v8 M2 or later (including Sketchup 2013, 2014 and 2015) both free and pro versions the plugin is installed in the normal way via the Window/Preferences/Extensions menu [Install Extension] – see http://help.sketchup.com/en/article/38583. I have also submitted the plugin to Extensions Warehouse. When accepted there, it should be possible to install it directly from the Window/Extensions Warehouse menu in SU 2013 or 2014 (now compatible with SU2014).It can then be activated or de-activated from the Window/Preferences/Extensions menu by
ticking or un-ticking the box beside the plugin name. Shapes Tool.If you are using an older version of Sketchup, change the file extension of the plugin from .rbz to .zip, and extract the contents to the Sketchup Plugins folder (see the help article above for the default plugin folder location on Windows or Mac.)
Download the latest version from the Plugin Store at
http://sketchucation.com/pluginstore?pln=jwm_shapes -
-
Cool!
And if you want complete your plug with a parametric modeling try the free SolveSpace?
You can import the result in SKetchup with OBJ by TIG or STL format by Didier Bur(that can be also a new task to program this for Sketchup!
-
post removed
-
Thank you very much for this update.
You may add a dynamic insertion point? -
Post removed
-
I just did a Men in Black mind wipe on 2 posts here.
Please remember what you are allowed post in public.
-
Thanks
-
I've just updated the plugin to extend it to draw a Helix, and to work in SU2014.
The helix will be drawn upwards from the origin (by default, with positive Pitch), or downwards by setting the Pitch to a negative value.
The helix can be made left handed by setting No. of rotations to a negative value.
The helix can be drawn starting at any specified start angle from the x-axis
The revised plugin will be available on the new Extension Warehouse as soon as it has been accepted and updated there - awaiting only some SU team updates to mesh_additions.rb and parametric.rb, which I am not able to make.
Please see tne first post in this thread for download of the updated version 1.5.
John McC
-
Hi John,
We can add this to the PluginStore if you want.
We can also add you to the Plugin Authors group to access their dedicated forum.
-
Sounds good to have it added to the Plugin Store. What if anything further do I have to do before you can do that?
And what is the relationship between the Plugin Store and the new Trimble Sketchup Extension Warehouse? I've made a further Pull request for them to update the original with this and a wide range of other changes I made earlier, but it's been a few weeks since the release of the 2014 version of SU, and my updates to this plugin haven't yet made it to the new Warehouse.
Should it appear in both? One or the other only? I'd welcome your advice.
As to joining the Plugin Authors group, I'd be very pleased, but I'm only very sporadically active in writing (or usually, adapting others') plugins.
-
@johnwmcc said:
Sounds good to have it added to the Plugin Store. What if anything further do I have to do before you can do that?
I'll look after the first upload
@johnwmcc said:
And what is the relationship between the Plugin Store and the new Trimble Sketchup Extension Warehouse?
There's none as far as I am aware?
@johnwmcc said:
Should it appear in both? One or the other only? I'd welcome your advice.
That's entirely up to you. There's no harm in hosting in both.
@johnwmcc said:
As to joining the Plugin Authors group, I'd be very pleased, but I'm only very sporadically active in writing (or usually, adapting others') plugins.
That's no problem. You can pop in as you see fit.
-
Nice. I'll wait till in Plug-in store.
-
I've added a further Shape - Helical Ramp.
The helical ramp further adds to the helix, and draws an (optionally tapering) helical ramp surface, with new ramp starting width and ending width parameters.
See first post in this forum for an updated v2.1 which includes the Helical Ramp.
-
Cool, and what about the famous teapot?
-
Wonderful plugin, thanks, great to have instant primitives, plus helices!
-
@majid said:
:thumb: Cool, and what about the famous teapot?
http://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=24079
-
Added Helical Ramp with Sides shape, with parameter for slope of sides from horizontal. Changed helical parameters to ask for start and end height, instead of pitch. Minor bug fixes.
-
Minor update (to v2.2.7) - changed module name from CommunityExtensions to JWM in all four .rb files in .rbz archive to avoid potential conflict with SketchUp Extension Warehouse version.
-
It gives load error msg in my pc.
Error Loading File C:/Users/emre özel/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/jwm_shapes/shapes.rb
Error: cannot load such file -- C:/Users/emre özel/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/jwm_shapes/parametric.rb
C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:45:inrequire' C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:45:in
require'
C:/Users/emre özel/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/jwm_shapes/shapes.rb:8:in<top (required)>' C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/extensions.rb:197:in
require'
C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/extensions.rb:197:inload' C:/Users/emre özel/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/jwm_shapes.rb:24:in
register_extension'
C:/Users/emre özel/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/jwm_shapes.rb:24:in<module:Shapes>' C:/Users/emre özel/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/jwm_shapes.rb:12:in
module:JWM'
C:/Users/emre özel/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/jwm_shapes.rb:11:in `<top (required)>' -
I'm afraid I don't quite know why this happens, or even definitely how to fix it, though I have a couple of suggestions to try.
It seems from the Ruby console dialogue that you included, that the plugin loader (Plugins/shapes.rb) isn't finding the file parametric.rb where it expects to, in the Plugins/jwm_shapes subfolder.
How did you install the Plugin? If through the Window/Preferences/Extensions/Install Extension button, it ought to put the files where they belong.
Please look and see what files/folders you have in your Plugins folder
"C:/Users/emre özel/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/"You should have one file from this plugin (jwm_shapes.rb) and one folder (jwm_shapes). The folder should contain the following files:
CHANGELOG.txt
extension_info.txt
mesh_additions.rb
parametric.rb
shapes.png
shapes.rb
shapes_icon.png
(and maybe shapes 221.rb)If those files aren't there, the installation hasn't worked properly.
If you manually unzipped the .rbz file, you may not have checked the option to preserve the folder structure.
To fix it, you might try (a) installing the plugin through the 'official' route - open SU, then go to Window/Preferences/Extensions [Install Extension] and select the downloaded jwm_shapes.rbz file to install.
or (b) change the extension of the downloaded file from .rbz to .zip, Extract the files in it (preserving the folder structure), to get the files and folder identified above, then copy the one file shapes.rb, and then the folder and contents jwm_shapes, into the Plugins folder.
I've just double checked that downloading the .rbz file from the top of this post, and using the official SU Extension installer works for me.
I don't think this a problem specifically to do with this one plugin. You could try downloading another plugin, and trying to install that.
If none of this works, try the Sketchup Extensions forum.
Best wishes
John McC
Advertisement