Shop OBEX P1 Docs P2 Docs Learn Events
Building 3D Models for DipTrace (and other programs) — Parallax Forums

Building 3D Models for DipTrace (and other programs)

JonnyMacJonnyMac Posts: 9,107
edited 2014-04-17 17:48 in General Discussion
I'm now hooked on having 3d models for all the components of my DipTrace projects -- like most, I just see things differently when I can rotate a model of my PCB in 3D space. Where I struggled was modeling with Wings3D which is recommended by the DipTrace folks.

To cut to the chase, I came across the suggestion to use a program called OpenSCAD (Open S-CAD) which is a modeler for programmers. Instead of dragging things around with a mouse, one writes C-like description code. For example, I'm helping a friend with a Propeller-based camera controller that has a separate HMI board with an LCD and lighted buttons. I couldn't get my head around modeling the button in Wings3D, but after 15 minutes of YouTube tutorials on OpenSCAD, I was able to create a dimensionally accurate button -- this is what that code looks like:
// Lighted push-button
// Digikey 563-1240-ND

// base
//
translate([0, 0, 6])
{
  intersection()
  {
    cube([9.9, 9.9, 12], true);
    rotate([0, 0, 45]) cube([12, 12, 12], true);
  }
}

// support
//
translate([0, 0, 12]) cube([7, 7, 7], true);

// button
//
translate([0, 0, 23-9/2]) cube([8.6, 8.6, 9], true);


I've attached a screen-shot from the DipTrace 3D view. I built the LCD in OpenSCAD as well -- this is the code.
// 4x20 backlit LCD
// Digikey 73-1249-ND

// base pcb
//
translate([0, 0, 0.8]) // half pcb thickness
{
  difference() 
  {
    cube([98.5, 61, 1.6], true);
    translate([ 46.25,  27.5, -1.5]) cylinder(3, 1.4, 1.4);
    translate([ 46.25, -27.5, -1.5]) cylinder(3, 1.4, 1.4);
    translate([-46.25,  27.5, -1.5]) cylinder(3, 1.4, 1.4);
    translate([-46.25, -27.5, -1.5]) cylinder(3, 1.4, 1.4);
  }
}

// frame/glass
//
translate([0, 0, 9.5/2+1.6])
{
  difference() 
  {
    cube([92.2, 37.6, 9.5], true);
    translate([0, 0, 8.5]) cube([76, 25.2, 9.5], true);
  }
}


As was pointed out in the Kicad tutorial that led me to OpenSCAD, the STL export from OpenSCAD crashes Wings3D which I use for finishing and final VRML export. I'm using a program called AccuTrans3D to open and resave the STL. This gets loaded into Wings3D for finishing (add color, bevel edges) and final export for use in DipTrace, Kicad, etc.
1024 x 640 - 57K

Comments

  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-03-13 11:02
    BTW... OpenSCAD dimensional units are millimeters, so it's very easy to pull values right out of a data sheet.
  • LeonLeon Posts: 7,620
    edited 2014-03-14 04:03
    The Pulsonix PCB software I use can import STEP models for all parts. I think that there are many 3D design packages that can produce such models.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-03-14 19:36
    Jon,

    I am using OpenScad for a while now. For me it is way easier to 'program' a 3d model then build it with graphical tools. That scripting language is easy yet quite powerful.

    I import the stl direct into my printer software and had not had any problems there. The printing itself is another issue. not easy with bigger things.

    The nice thing is that you can use parameters and sub routines. Fun to play with.

    Enjoy!

    Mike
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-03-14 20:10
    Mike,

    I'm just scratching the surface but have seen that it really looks like it's going to be a lot of fun. For the most part, I will be creating models for DipTrace so that I can get an idea of what my PCB will look like, or I can show the person that I'm creating the PCB for (as in this case).

    About two weeks ago I needed a small piece of plastic to fit snuggly over three 5mm LEDs that were mounted to a PCB; the purpose of the plastic was to hold a bundle of fiber optic cables to be lit by the LED. Luckily, Rick Galinson (the guy who built the Propeller-powered paintball mini-gun) is a good friend. I popped over to his house, described what I needed, and about 10 minutes later he machined one, then sent the other to his 3D printer (big pro job he uses for build movie and tv props) while we went to get a bite to eat. I often need a little tchotchke that I cannot fabricate myself; I think with OpenSCAD I'll be able to create what I need.

    And it's not as if I need another excuse to write code.... ;)
  • RoadsterRoadster Posts: 209
    edited 2014-03-15 11:04
    meshconv.exe can be uses to fix the stl file so it will import correctly in to Wings3D
    http://www.cs.princeton.edu/~min/meshconv/
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-03-15 11:19
    I saw that, but it's a command line utility hence a bit inconvenient vis-a-vis workflow. I did download it, though, and will give it a go.
  • RoadsterRoadster Posts: 209
    edited 2014-03-16 05:32
    I had some fun making some components with OpenScad, I will show you when I have all the components done.
    BTW I came across this site last night that has free 3d components and I thought I would pass it along, all you need to do is register for free, use the search download your selected format
    http://www.3dcontentcentral.com
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-03-16 08:42
    I've downloaded a few models from that site -- in fact, the headers on the board in the attached image came from there. At some point I will go in and modify the colors.

    I've also found that some manufacturers have models. On that board is a Hirose uSD socket, and that model came from Hirose.
    900 x 640 - 314K
  • LeonLeon Posts: 7,620
    edited 2014-03-16 08:52
    Hirose has those STEP models I mentioned.
  • RoadsterRoadster Posts: 209
    edited 2014-03-16 11:56
    Well I'm not finished but I made the radial resisters and the headers in the back of the board, I'm currently working on a breadboard model.
    898 x 795 - 146K
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-03-16 21:20
    I made an RCA jack pattern with slotted holes -- easier to mount. It's attached in case you think you might find it useful.
  • RoadsterRoadster Posts: 209
    edited 2014-03-17 04:00
    Here is an update with the breadboard area, thanks for the rca jack JonnyMac.
    596 x 679 - 84K
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-04-17 17:48
    I'm not sure why I missed an earlier suggestion, but a few days ago I tried FreeCAD (www.freecadweb.org) and am really liking it. It's freeware which means one should save early and save often, but it's easy to use and I'm now using it to create 3D models for my DipTrace projects. At the moment I'm working on a new audio player and decided to use the SMD 3.5mm jack that can be found on the Propeller BoE and Activity Boards.

    There is no longer a need to pull the model into Wings3D to add colors (as I had to do with OpenSCAD models); that can be done in FreeCAD. The only extra step is having to open and re-save the VRML file with AccuTrans so that it displays properly in DipTrace. Small step and it works.
    1024 x 640 - 56K
    1024 x 640 - 45K
Sign In or Register to comment.