Posts Tagged ‘ freecad

Exporting usable CAD data from Maya

It’s that time of year again:  Time to help my father build a new aluminum boat.  It was an enjoyable process last year:  Based on a napkin sketch with some dimensions and angles he gave me, I modeled a boat out of NURBS in Maya, and through a lot of hoop-jumping, got him some useable data:

The biggest hurdle was getting him ‘the usable data’. The process of making the boat in Maya is discussed above.  But these were the export steps:

  • Export the mesh from Maya as obj.
  • Use online converter to go from obj -> pdf.
  • Then, my father gave the pdf to a buddy who traced it in CAD, gave it dimensions, then provided that to the plasma-cutter (as a DWG).
  • Ugh.

That process was super clunky.  I’ve been using Maya since… 1998(?) and never once needed to export anything CAD related, so this was all new territory.  To make this work I need a way to generate the CAD data myself, add dimensions to it, and export out as a DWG.  There must be a better way!

Turns out there is (and probably even a super-moar-better way than what I’m about to describe, if you know CAD better than I do, which wouldn’t be much of a stretch).  In the back of my head I remembered that Maya has a DXF exporter.  I don’t think I’ve ever once used it…

Part 1: Get CAD Software & Configure

Since this process is (currently) a once-a-year thing, I didn’t want to drop a bunch of cash (any really) to get some newfangled CAD software.  I’d read a lot about FreeCAD on the interwebs, it was available for Mac, so I installed it.

Fumbling around however, I realized it neither could import DXF, or export DWG, by default.

To get the DXF importer\exporter working, I followed the instructions here.

I never could actually get the DWG export working from the software, even following the instructions here.  However, that links to a standalone “Teigha File Converter” that will batch convert a directory of DXF files to DWG.  Good enough.

Also, this data needed to be in inches, so I changed the FreeCAD prefs as such.

Part 2: Export usable CAD data from Maya

I started by exporting the unrolled mesh as DXF from Maya:  There are zero options available.  But FreeCAD happily imported it.  Immediately, problems:  Missing triangles (you must exported triangulated mesh, can’t have quads\n-gons).  As a check, I exported this same data out as DXF, and reimported it:  Empty.  I don’t think FreeCAD likes to deal with polygonal mesh.

Next, I tried exporting the unrolled NURBS surfaces as DXF:  Those came in as empty groups in FreeCAD…

Finally, I converted the trimmed NURBS to their perimeter curves, and exported the curves:  Success!  This is what is important to know:

Export NURBS Curves from Maya as usable CAD data.

Polygonal Mesh = highly questionable.  NURBS Surfaces = no go.  Note I also tested locators & ‘distanceDimShape’ nodes:  They don’t export at all.

Once I had the boat’s unrolled\flattened curves in FreeCAD, I started adding draft dimensions.  Where I encountered my next problems:

  1. The scale was off by a factor of 10:  Even though Maya was set to inches, and FreeCAD was set to inches, everything was 10x as small in FreeCAD.  I noticed this is the same issue when I 3d print in cm:  Even though I have Maya in cm, and my slicer (Simplify3D) is in cm, they come in 10x smaller.  The fix?  Scale everything up in Maya 10x before export.
  2. From the top view in FreeCAD, all the curves looked just like Maya.  But when I went into a perspective view, the curves were actually going shooting up & down in space quite a bit:  Not on a flat plane.  But they are in a flat plane in Maya.  What’s going on?  Long story short:  In Maya after you do the 10x scale up, be sure to ‘freeze transformations’ on all the curves.  In addition to the scale, I had many other translate and rotate values on the curves to get them flat on the ground plate.  It appears that FreeCAD hates this.  But once everything was frozen, the curves showed up a-ok, from all angles.

Note:  Maya uses the Autodesk ‘DirectConnect’ file translators to export (and import) DXF data.  See the docs on the 2016 version in this pdf.

Part 3 : Add Draft Dimensions

Since I was told that this needed to be provided to the plasma cutter in inches, in FreeCAD’s ‘General -> Units’ prefs, I’d set them to “US customary (in/lb)”.  Next, via FreeCAD’s ‘Draft’ toolbox, I used the ‘Dimension’ tool to provide width & height values for all the curves.  This is where I ran into the next (and as of this authoring, unresolved) issue:  FreeCAD seems to auto-change the what unit is displayed in the dimension based on the length of the part being measured.  For example, I want all the dimensions to be in inches.  But they’d report inches, feet, and yards, depending on the length of the part.  After posting this issue to the forums, I learned that if you switch the units to “Imperial decimal (in\lb)” the dimensions will always be in inch.  Problem solved.  Thanks forum peoples!

Part 4 : Export

From FreeCAD, I export all the curves and dimensions as DXF, then using the Teigha File Converter, convert that to DWG.

And…. done?  Still need confirm from the plasma cutter the DWG is valid (I have no way of testing myself), but overall, a far less clunky data-export-pipeline than last time :)

3D Printing McMaster-Carr Files

I, like many others, love McMaster-Carr.  I purchased a number of items from them during my C-Bot build:  Their shipping & customer service is always great.

While I always saw the icon, it never clicked, and it wasn’t until I was listening to a 3D Printing Today podcast (Episode 100, specifically) that I connected the dots:  You can 3D print the stuff they sell, since they have CAD files for so much of what they offer.  I was listening to the podcast at work, so when I got home I decided to try it for myself.  So easy.  On a side-note I’m not too concerned they’re going to loose much business over this:  Not sure what practical use most people will have for a 3d-printed plastic bolt…

First (if you don’t have software that can import STEP files and export STL’s), install Freecad.  I did this all on my Mac, but they have Windows & Linux options as well.

Second, go find something in McMaster-Carr to print.  Like this super-chunky Metric screw for example.  When you’re browsing their offerings, you’ll know you can get the CAD file if there’s a little green “CAD crosshair” icon, and you then click on the “Product Details” next to it:

mcmaster-carr printable

In that window there’ll be a “Save” button, and next to it a drop-down for file formats:  Choose ‘3-D STEP’, and hit the button:

mcmaster-carr download

Next, in Freecad, ‘File -> Open’ and browse to the STEP file you just downloaded.  You’ll see something like this:

freecad

Under ‘Labels & Attributes’ on the left, select the object (probably a bunch of random letters and numbers).   Then access ‘File -> Export’ and change ‘Files of type’ to Mesh formats.  Make sure the name ends in .stl, and export it.

Finally open the stl in your slicer of choice (in my case, Simplify3D), and get it ready for print:

s3d

1 hr 15 min later:

bolt

A double-sized version is printed via the C-Bot:

  • .6mm E3D-v6 Volcano nozzle.
  • 300 micron layer height printed @ 60mm/sec.
  • MakerGeeks “Royal Purple” PLA printed @ 220 deg.

Never realized it was that simple!

PS: If you’re not listening to the ‘3D-Printing Today’ podcast, you really should be.  A lot of great info in there every time.