OpenSCAD Parametric Packaging Script v2

OpenSCAD Parametric Packaging Script v2

Description

This Openscad Script Will Generate A 2 Part Fit Together Packaging For A Device Of User Selectable Size. Any Amount Of Various Shaped Cutouts, Support Posts, Engraved Text And Logos Can Be Easily Placed On Any Face Using Special Array Variables. Check Out The Instructions Below As Well As The Examples And Comments In The Code For More Information On How To Use Them. Author: Mark Gaffney Version: 2.6C (Versions D E & F Are Slight Modifications For A Specific Item Without Proper Controls But These Will Be Included In V2.7) Date: 2013-04-04 Todo: Add User Controllable Flanges And Interlocking Lip Features Warning: Some Combinations Of Values, Shapes And Locations Etc. May Lead To An Invalid Or Non-Manifold Shape Beign Created, Preventing You From Exporting A .Stl If This Happens Try To Remove Or Change Some Of The Features Or Values Until You Get A Valid Shape And Then Add Them Back Gradually Until You Find The Offending Item, Then Change It So It Doesn'T Cause A Problem Note: This Thing Uses Harlandmii'S"Write.Scad" Module Http://Www.Thingiverse.Com/Thing:16193 Which You Will Need To Have Downloaded And Located In The Directory If You Want To Run This On Your Pc The Version I Had Did Not Properly Implement Spacing On 'Writecube', A Modified Version That Implements This Is Included Here... Generating Text Can Be Very Slow! When Generating A Stacked Layout It May Look Like The Top Is Taller Than It Should Be, This Seems To Be A Visualisation Bug In Openscad, If You Create A .Stl It Will Be Perfect Changes From Previous Versions: V2.6C - Implemented Ability To Choose Box Shape I.E. "Cuboid","Rounded4Sides", "Rounded6Sides", "Chamfered6Sides" - Ensured "Box_Type" Module Is Used In Generation Of Each Box_Half V2.6B - Investigated And Fixed Some Top Lip Mis Alignment V2.6 - Implements Loading External Objects (Such As .Stl Files) To Place On Faces - Implemented Overlooked Translation Of Text On Faces From Previous Version - Fixed Box_T In Make_Cutouts V2.5 (Aka Cutouts_On_Faces_For_Loop-V0_2.Scad) - Implement Tolerancing Of Connection Between 2 Halves Using Lip_Fit - Implement Text On Faces - Complete Documentation V2.4 (Aka Cutouts_On_Faces_For_Loop-V0_4.Scad) - User Provides Device Dimensions And Internal Clearance(S), Packaging Dimensions Are Calculated Based On This - Preparations To Allow For Different Wall_T In X,Y,Z - Implement Posts - Mouse Ears Work Properly - 2 Halves In "Beside" Layout Joined By Union V2.3 2013-03-23 (Aka Cutouts_On_Faces_For_Loop-V0_3.Scad) - Fixed Calls To Make_Box And Half_Box Modules - Added Ability To Handle "Holes" Array For Making Cutouts To Make_Box And Half_Box Modules - Added Module For Rounded Cuboid - Fixed Errors On Rounded Cuboid Cutouts'S Use Of A_Bit - Fixed Translate Errors For Making Lips On Box - Ensured All Parts Generate On Z=0 - Gave Top (Greenish) And Bottom (Reddish) Different Colours For Ease Of Identification - Rotated Top In "Beside" Layout To More Intuitive Orientation - Added Box Cross Module And Included In Hull Calculations To Ensure Box Sizes Are Exact Even With Low Side Count - Added Box_Type Module To Allow Choice Of Different Shaped Boxes Or Automatically Swap Them Based On The Current Variables - Added Mouse_Ears Module Note: In Stacked Mode You May Notice The Red Half Looks Like It Is The Full Length, This Appears To Be A Visualisation Bug In Openscad, The Part Is Generated Correctly V2.2 2013-03-22 (Aka Cutouts_On_Faces_For_Loop-V0_2.Scad) Based On My Own Structure - New Format [Face_Name, Shape_Name, Shape_Position[X_Pos,Y_Pos,X_Offs,Y_Offs,Rotate,Align], Shape_Size[Depth,,,]] - - Face_Name ("N", "S", "E", "W", "T", "B") - - Shape_Name ("Square", "Rectangle" , "Round_Rect", "Cylinder", "Ellipse" , "Cone") - - Shape_Position[X_Pos,Y_Pos,X_Offs,Y_Offs,Rotate,Align=("Inside" Or "Outside")] - - - "Square" Shape_Size[Depth, Length_Breadth] - - - "Rectangle" Shape_Size[Depth, Length, Breadth] - - - "Round_Rect" Shape_Size[Depth, Length, Breadth, Corner_Radius, Corner_Sides] - - - "Cylinder" Shape_Size[Depth, Radius ,Sides] - - - "Ellipse" Shape_Size[Depth, Radius_Length, Radius_Breadth, Sides] - - - "Cone" Shape_Size[[Depth, Radius_Bottom, Radius_Top ,Sides] - Pos_X And Pos_Y Are Chosen To Align With Views Taken From The North, Top Or East Faces Towards The Origin So That They Are Aligned With [-X,+Z], [+X,+Y] & [+Y,+Z] Respectively - Rotation Is Clockwise About The Plane Of The North, Top Or East Faces As Lookign Towards The Origin This Means They Are Anticlockwise For The Opposite Faces(I.E. Same Convention As Above) - These 2 Conventiosn Are Chosen To Make It Easier To Position Cutouts That Align With Oppsite Sides. E.G. A Box That Fits Around A Rotated Ellipse Pipe V2.1 2013-03-22 (Aka Cutouts_On_Faces_For_Loop-V0_1.Scad) - Based On Kitlaan'S Array Structure, Supporting Cones And Rectangles - From Kitlaan'S Customisable Electronic Device Packaging Http://Www.Thingiverse.Com/Thing:8607 - - Rect [ X-Offset, Y-Offset, X-Width, Y-Width, Corner-Radius, Corner-Sides, Depth, Rotate ] - - Cylinder [ X-Offset, Y-Offset, Inner-Radius, Outer-Radius, Sides, Depth, Rotate ]

Statistics

Likes

186

Downloads

0

Category

Electronics