[Plugin] PushPull & Group

[Plugin] PushPull & Group

Postby kyyu » Tue May 04, 2010 9:09 am

Hello all,

I've been lurking here a few months soaking up the info, to learn to write plugins. Though I would give something back, starting with this one. My background is wanting to learn cnc. And I found the phlatboyz, who use sketchup and their phlatscript plugin to generate cnc gcode directly from sketchup. Lots of the interest is making models and puzzles out of sheet foam. That's how I started using sketchup. So my 1st few plugins, I wrote to make drawing easier. So here is the plugin:

Name: Push/Pull & Group
Version: 1.0
SU Version: 7.0
Date: 05-04-2010

Purpose: This plugin helps with the drawing of 3D models & puzzles for 1/4" sheet stock.
Description: *As Tool: Push/Pull and group(optional), all with one click of the mouse.
*Or Select multiple parts and right click context menu
Usage:
# Automatic face picker - just hover mouse over face (I found it useful for selecting faces to delete also)
# Left mouse button => perform the Push/Pull & Group
# Right mouse button => toggle group or don't group (check for message on status bar)
# Hold down Shift Key => add to selection
# Hold down Contol Key => reverse the direction of Push/Pull
# If you change height (default=0.25"), the value is remember for the entire sketchup session.
# VCB will only except decimal inch values.
# Can be used from right click context menu, also.

Credits: I learned alot buy studying TBD's Rotix plugin. Thanks you, for making it!


You can see it in action in the following video where I build a F15 display puzzle in 3D from a dxf plans. At about 3 minutes, I use it to mouse over and delete faces. And about 5 minute mark, I use it to push/pull & group. I have since added the feature to simply select all the parts and use context menu to push/pull. You also see another plugin used to rotate with keystroke's. And recently, I did write a plugin to delete all interior faces. If there is any interest, I could release those as well.

http://www.youtube.com/watch?v=5NZ2Ea5-7LU
[rclub24 has embeded the video, 2 post down. Thanks.]

ky_PushPull and Group.rb


-Kwok
0
Last edited by kyyu on Tue May 04, 2010 1:44 pm, edited 1 time in total.

kyyu 
 

Re: [Plugin] PushPull & Group

Postby TIG » Tue May 04, 2010 10:10 am

Thanks for sharing you code - interesting ideas...

On a side note I see you used a make-face tool that seemed to take forever...
Have you tried drawing a large rectangle around all of the shapes drawn flat on the ground ?
Select all and then the shapes should all face separately using 'intersect' - it should be much quicker. Finally erase the four outer edges of the rectangle...
Capture.PNG
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] PushPull & Group

Postby Rich O Brien » Tue May 04, 2010 12:41 pm

Hi Kwok,

Interesting idea and well implemented, will we see metric inclusion at some stage? Anyway here's how to embed video



[flash=800,600] - Here i've inserted the size of the displaying video i need

Then i changed this, http://www.youtube.com/watch?v=5NZ2Ea5-7LU

to this, http://www.youtube.com/watch/v/5NZ2Ea5-7LU

and finally this, [/flash]


Code: Select all
[flash=800,600]http://www.youtube.com/watch/v/5NZ2Ea5-7LU[/flash]

or
Code: Select all
[flash=800,600]http://www.youtube.com/watch/v/insert code here[/flash]
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] PushPull & Group

Postby kyyu » Tue May 04, 2010 2:19 pm

TIG, I wouldn't have though of that in a million years. It will sure come in handy. It does take a long time to make faces, but also the video recording slowed it down alot. 2 or 3 time slower, I think. I did try you method on that dxf data and there is unforeseen problems. Dragging a large rectangle around all the parts, the face did not form. But did form on one of the small parts. :shock: I suspect the data is not 100% flat. Anyway, I've grown to hate importing dxfs, as there are always problems.

rclub24, thanks for the lesson on embedding. As far as the metric question, It's not just metric. The VCB input can't do much of anything right now, like even fractions which I am used to. I had assumed the conversion was built into the VCB, like in all the standard sketchup tools. But seems not. If anyone has the VCB code or can direct me to an example, I would be happy to put that in.

-Kwok
0

kyyu 
 

Re: [Plugin] PushPull & Group

Postby kyyu » Tue May 04, 2010 9:42 pm

TIG,

I was able to get it to work your way, by leaving the drawing full size instead of scaling it down to 1/4" slots. Got no clue what the difference is. I drew a rectangle and got a face covering everything. But it's still very slow, even with the intersection method. So it might just be a large number of edges (~5800) and my old pentium 4 computer.

-Kwok
0

kyyu 
 

Re: [Plugin] PushPull & Group

Postby TIG » Tue May 04, 2010 9:55 pm

It's best to do all of your stuff 'full-size', then scale down as needed... Very small faces don't form well in SUp/OpenGL woth FollowMe/PushPull etc :geek:
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: Carto, Google Bot and 12 guests

Visit our sponsors: