SOB Sketchup Plugin

Standard PCB templates and project cases

SOB Sketchup Plugin

Postby tayken » Thu Feb 16, 2012 4:22 pm

Hi y'all!

Finally done with the Sketchup script, I had a couple of show stoppers and had to rethink & rewrite some of my code, but totally worth it!

Currently I don't have a dialog box, you have to manually edit the top part of the code for some dimension information. Tried to add as much comment as possible, for any questions, please feel free to ask. I used meters as dimensions because I remember that the scale was in meters for board files.

I'm attaching the code in a zip file. Unzip it under plugins folder of your Sketchup. Also here is a picture for you.

Feel free to torture the program, I tried to test it as much as I can but there may be bugs, you have been warned! :)
Attachments
SOB.png
SOB-ruby.zip
(2.44 KiB) Downloaded 234 times
User avatar
tayken
Developer
Developer
 
Posts: 1512
Joined: Sat Dec 12, 2009 10:58 am
Location: Tokyo, Japan

Re: SOB Sketchup Plugin

Postby tayken » Sat Feb 18, 2012 1:43 pm

I wanted to implement another side style to this design, the interlocking style was hard to assemble for press fit parts so here is a new style. With this, you fit 2 parallel side pieces with their tabs looking down on the bottom piece, then fit the other 2 with their tabs up and put the top piece. I call this the stacked style, check out the pictures to what I mean.

That required some changes in the code. The old style remains, and there is a new parameter which chooses the side style. 0 is for no side pieces (slots remain), 1 for interlocking style (shown in the previous message) and 2 for stacked style. As usual, zipped code is attached.
Attachments
SOB-design2.png
Stacked style, isometric(ish) view
SOB-design2-side.png
Stacked style, side view
SOB-ruby.zip
(2.8 KiB) Downloaded 228 times
User avatar
tayken
Developer
Developer
 
Posts: 1512
Joined: Sat Dec 12, 2009 10:58 am
Location: Tokyo, Japan

Re: SOB Sketchup Plugin

Postby dsm » Sat Feb 18, 2012 3:13 pm

comments

Tayken,

I like your type 2 stacked style treatment of the interface between the side acrylic and end acrylic.
I can see how your type 2 stacked style would be easier to assemble.
I also like how your type 2 stacked style avoids the narrow (and fragile) "ears" on your type 1 interlocking style.

I did have one observation worth mentioning derived from the thin laser-cut enclosure examples that I built (link).
For thin enclosures with a USB connector, using two tabs on the USB end acrylic may lead to a very thin and fragile
acrylic section near the USB connector. For thin enclosures [1], using one wide tab in the end acrylic of smaller cases or
a wide center tab in the end acrylic of larger cases may reduce this problem.

For my thin DP6037-size enclosure examples (8.5 mm interior and 11.5 mm exterior),
I considered using two 10 mm tabs in the end acrylic...
    5.0 mm above-the-board space - (3.95 mm height-of-mini-USB-connector + 0.4 mm margin) = 0.65 mm
But I decided to used one 20 mm wide tab in the end acrylic instead...
    0.65 mm (see above) + 1.5 mm tab-length = 2.15 mm
Note that even 2.15 mm is less that the 2x acrylic thickness suggested for the edge-to-slot specification
(which should probably also apply to the edge-to-USB-opening dimension).

Thanks for your time.

dsm

[1] Obviously increasing the above-the-board space also works, but since I am interested in relatively thin cases...
Last edited by dsm on Sun Feb 19, 2012 7:16 pm, edited 1 time in total.
dsm
Full Member
Full Member
 
Posts: 216
Joined: Sun Jul 10, 2011 3:04 pm

Re: SOB Sketchup Plugin

Postby ian » Sun Feb 19, 2012 6:37 pm

Thank you Tayken, this was kinda the missing piece. I'll take a look at this when I get back and we'll get some test cuts from Seeed for you and I. Maybe we can talk about it more tonight? :)
User avatar
ian
Crew
Crew
 
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am

Re: SOB Sketchup Plugin

Postby tayken » Sun Feb 19, 2012 11:33 pm

ian wrote:Thank you Tayken, this was kinda the missing piece. I'll take a look at this when I get back and we'll get some test cuts from Seeed for you and I. Maybe we can talk about it more tonight? :)

Sketchup does not support exporting to dxf files out of the box + circles and arch segments are shown as a couple of edges. For laser cutting we will need dxf files that are adjusted for the laser width. Yep, tonight is good, I can bring my CAD laptop. :)
User avatar
tayken
Developer
Developer
 
Posts: 1512
Joined: Sat Dec 12, 2009 10:58 am
Location: Tokyo, Japan

Re: SOB Sketchup Plugin

Postby tayken » Mon Feb 20, 2012 11:05 am

On my way back home, I had a little time to think about stuff. We discussed the shortcomings of Sketchup with Ian tonight, to summarize them:
- It does not have a direct dxf export support. This can be solved with 3rd party plugins.
- All circles and arcs are shown as line segments, which is not good for manufacturing. Instead of 1 step to cut a circle, the cutter might cut 1 line segment, then move to some other hole (they tend to do that when you export stuff) then go back which wastes valuable time, thus money. This is a big shortcoming for me.

The solution I've been thinking about is using another open source tool: Inkscape. Current script is good for visualizing things in 3D, it is not a waste of time but we still have to adjust edges and line lengths for taking laser width into account (which the current Sketchup plugin does not do). So most of the algorithm can be used for drawing in Inkscape (and this time taking laser width into account). People can see their designs in 3D with Sketchup, then add holes to their design, get these holes location and add them to the dxf files created by Inkscape and use the file for manufacturing. It might sound a little weird but this way we cover both programs disadvantages.

I guess I'll have to sleep on this idea and think a little more but in the meantime, please share what you think.
User avatar
tayken
Developer
Developer
 
Posts: 1512
Joined: Sat Dec 12, 2009 10:58 am
Location: Tokyo, Japan

Re: SOB Sketchup Plugin

Postby dsm » Mon Feb 20, 2012 2:24 pm

other CAD choices

tayken,

I would probably start out by explicitly listing your decision criteria such as
  • free
  • 2D versus 3D requirements
  • certain technical features ~ curves, transparency, layers, rulers, ...
  • import/export file formats (e.g. DXF, STL, JPG, etc.)
  • cross-platform support
  • open or closed source
  • parametric, scripting, plug-in capability
  • training materials available
  • support via libraries, component warehouses, plug-ins, other programs (e.g. Google Earth)
  • multiple language support
  • ...
In addition to Google SketchUp, Autodesk 123D, and Inkscape.org Inkscape, I suggest you look into
PTC Creo Elements/Direct Modeling Express 4.0 at (link). I have a friend who uses the full version of
PTC Creo Elements/Direct Modeling (formerly CoCreate) to build systems with thousands of mechanical parts.

Although creating data to drive a laser-cutter is essentially a 2D operation, using a 3D program allows you to visualize how your parts come together. I've been designing enclosures in 3D using Autodesk Inventor Pro 2012 (provided by the TechShop) and then redesigning parts in 2D using Corel CorelDraw (purchased cheaply off eBay) (because the TechShop has a good "printer" driver for this combination of program and laser-cutter). In other words, I personally follow a really poor workflow. Sigh...

Thanks for your time.

dsm
dsm
Full Member
Full Member
 
Posts: 216
Joined: Sun Jul 10, 2011 3:04 pm

Re: SOB Sketchup Plugin

Postby arakis » Wed Feb 22, 2012 5:25 am

I am getting this error when starting sketchup with your script in the plugins folder

Error Loading File SOB.rb
undefined method `alpha=' for nil:NilClass
best regards FIlip.
arakis
Crew
Crew
 
Posts: 1044
Joined: Wed May 25, 2011 11:15 am
Location: Belgrade, Serbia

Re: SOB Sketchup Plugin

Postby arakis » Wed Feb 22, 2012 7:53 am

Here is a plug in we can try out, it exports Sketchup models into DXF files, and it converts SU segmented circles and arc to real circles and arc.

Original thread of the plugin author
http://forums.sketchucation.com/viewtopic.php?t=40773
Attachments
dxf_export.rar
(3.05 KiB) Downloaded 242 times
best regards FIlip.
arakis
Crew
Crew
 
Posts: 1044
Joined: Wed May 25, 2011 11:15 am
Location: Belgrade, Serbia

Re: SOB Sketchup Plugin

Postby tayken » Wed Feb 22, 2012 10:07 am

arakis wrote:I am getting this error when starting sketchup with your script in the plugins folder

Error Loading File SOB.rb
undefined method `alpha=' for nil:NilClass

Hmm, which version of Sketchup are you using? I just tested it on v8. Also I create a folder under Plugins folder and access it from there, had problems with some sketches before if they were directly under Plugins folder.

arakis wrote:Here is a plug in we can try out, it exports Sketchup models into DXF files, and it converts SU segmented circles and arc to real circles and arc.

Wow, thanks! I will try it out when I get the time. :)
User avatar
tayken
Developer
Developer
 
Posts: 1512
Joined: Sat Dec 12, 2009 10:58 am
Location: Tokyo, Japan

Re: SOB Sketchup Plugin

Postby arakis » Wed Feb 22, 2012 10:54 am

Thanks, got it to work, though it would load up on SU start...once I loadd it through the console it wolet fine, Excelent work
best regards FIlip.
arakis
Crew
Crew
 
Posts: 1044
Joined: Wed May 25, 2011 11:15 am
Location: Belgrade, Serbia


Return to Sick of Beige