Played around a little to make a simple mechanical drawing for folks making planks and other accessories. There are ways to import OpenSCAD into FreeCad, for example, but that looks too hard (for me). Next approach was to make the XY plane projection in the SCAD file, then export that as a DXF. This worked pretty well (you have to export using the GUI menu after rendering).
I was planning to use something like QCAD or LibreCAD to make the dimensions, but decided it would be easier to just use KiCad (I think). For one, some of the key features you’d need specified (like Pin 1 of the connectors) isn’t specified in SCAD. So added a couple layers User.1 and User.2 to the board stack and made a first attempt, to see how it works.
It’s not too bad, although there are still some shortcomings about dimensions in KiCad, especially the lack of bulk editing of certain parameters (like # decimals of precision). Some can me bulk edited, like font size and style.
But then I realized, you guys are about to make a new, final, case design. That would render this whole exercise pointless. So for now, I’m just going to toss this out there as a concept and once the dust has settled a “final” envelope drawing can be wrapped up.
BTW, I think it would be helpful to put a reference point in the OpenSCAD file that corresponds to a reference in the KiCad file. I did some eyeballing trying to line the imported DXF file up with the PCB design, so it’s not going to be perfect.
I feel like something is mirrored or 90 degrees. T he programming header should be opposite the 10P, and the bootloader button should more or less be centered under the “top” of the display.
You’re correct. I didn’t realize the rotation until I imported the top DXF and realized I had to rotate it. The bottom DXF I didn’t go back and rotate. I think I’ll do the rotations and offsets in OpenScad so that it exactly matches KiCad and there is no need to move / rotate. Right now I was indexing off the holes which seems like reasonable datum.
Okay, so I figured out the desired link between SCAD and KiCad designs. More on that later. I was fat, dumb, and happy, not necessarily in that order. Then I decided to do just “one last thing”… add the side views to show the USB and AUX connector details, and I got confused.
The side projections I was making in SCAD just didn’t match what I was holding in my hand. Then it finally hit me, maybe the enclosure I have is an older or newer version than the SCAD file I’m using.
BusPirate5REV10-v0.scad
BusPirate5REV8-v10.scad
I had assumed my enclosure was the rev10-v0 flavor, based only on the fact that I remember using rev 10 when building firmware. In hindsight, that was probably a faulty conclusion.
My enclosure is a semi-translucent white color. The conflicting feature that jumps out at me are the sidewalls of the enclosure. The walls of the physical enclosure in my hand are flat, with chamfers on the top and bottom. The SCAD design (both rev10-v0 and rev8-v10) appears to have flat sides, but recessed. I say “appear” because there’s a chance I’m doing something wrong in SCAD.
Doh! I think this has come up before. It is an OpenSCAD version or BOSLII version issue. Early on someone asked me to fix it for their (older) version of OpenSCAD and I sad no, which I rarely do.
I am just now coming to the same realization. I think I have the correct versions, but maybe I’m doing some initialization wrong. I’m working on that right now.
Openscad is great, I like the reproducibility and manageability of parametric modeling. When you add in big libraries like BOSL stuff gets brittle though.
I was wrong, the correct file is BusPirate5REV8-v10.scad. The next version is with the loose nuts in the bottom, it was just a prototype.
Found it. There was a change to BOSL2 on 27 Jun 2022 in commit 8373b2db3813ffed3a40d808da58dcb0dd138e84 which changed the behavior of the diff("mask") command. One should no longer use the "mask" argument. Based on my testing, this is the exact commit where the Bus Pirate SCAD file “breaks”. Here is an issue I found which led me down this path. It might be important to check this conclusion because I am not familiar with BOSL2.
But, it is simple to fix. Just removing the two instances of this diff() command to not have any arguments, things work as expected with the latest versions of both OpenSCAD and BOSL2.
Also I downloaded the even latest bleeding edge OpenScad 2024.10 and it works as well. Some folks might be using the 2024 versions because they recently made an update that results in really fast rendering.
Okay, pushed a repo with the mechanical envelope drawing code and notes about how to implement it. There are a few different ways to do it, none is perfect.
In the process of doing this, I found one very slight mismatch between the center of the push button switch and the center of the enclosure hole.
When you’ve wrapped up the final enclosure, give me a heads up and I’ll do any tweaking to the mechanical dimension layers, and regenerate the XY projections as necessary.