10
$\begingroup$

Blender has 3d printing tools as well as STL exporter. That is good for both hobby 3d printers which all use programs which use STL (eg. Repetier-Host) as an interchangeable format as well as professional 3d printers such as the ones by Solidscape, the users of which mostly use the Rhinoceros (Rhino) program which imports STL files exported by Blender just fine. This is also true for 4 axis CNCs.

However, getting something from Blender to be (2D) CNC milled/laser cut doesn't seem as easy. From personal experience from using services of both, common programs such services use for CNC milling and laser cutting is AutoCAD and CorelDraw. They ask formats which these programs can open. Blender can export to DXF, STL and many other formats. For some reason with the formats these programs ask, either Blender exports incomplete data or wrong/different data, because both these programs import them as wires, no surface data is preserved.

I've had this issue both with CorelDraw and AutoCAD, with different services, and both had to take my model file and modify them in their own programs by creating surfaces from those lines, a time consuming process. I have to pay extra to get the model "cleaned up" and in worst case the CNC milling/laser cutting service provider will refuse to do that and tell me to send them proper drawings, and rightfully so.

And this is not a limitation of these programs, a DXF exported by another program (for example Pepakura Designer) imports fine. So I hope we can find a solution here, I believe an answer would benefit many people who might be forced to use another program to design their milled/cut parts right now like I do.

Example Blender model (.blend is attached): http://www.pasteall.org/blend/42404

enter image description here

Now, let's look at what formats these programs can import and how they import them.

1) AutoCAD (version 2013 and 2015 tested)

From the formats Blender exports it only imports DXF. Blender can export DXF, however when it is imported only lines are imported, no polygon (surface) data.

enter image description here

2) CorelDraw (version X5 tested)

From the formats Blender exports it also only imports DXF. Same issue as with AutoCAD:

enter image description here

3) Rhinoceros (version 4.0 tested)

Being a 3D program, imports OBJ, STL, DXF, X, etc. Imports even the DXF exported from Blender just fine. Sadly, most CNC service providers I've come across don't use Rhino, mostly jewelers do.

enter image description here

I have not been able to test other programs yet such as Solidworks.

You can say since there is at least one program which imports the data, then it is not a Blender issue and shouldn't be asked. I disagree for the following reasons:

1) As I've mentioned, AutoCad as well as CorelDraw import polygonal data from other programs such as Pepakura Designer just fine. This is enough proof that Blender is at least partially to blame, or at least it can export the data differently like Pepakura does so these programs will import it correctly.

2) I believe it is important to make Blender a practical tool for designers CNC milling or laser cutting their designs. Regardless which tool is to blame, it is best for Blender to offer Blender users some way/workaround/pipeline of getting their designs as a usable file.

How can we go around finding a solution here? Since both these popular programs (Corel, AutoCAD) only import DXF, I see the only solutions being:

1) Finding a way to export DXF data so they will import it properly.

2) Finding a 3rd party tool (free or open source preferred) that will convert an intermediate file format exported from Blender to DXF which these programs will import properly.

For the record, when selecting different options in the Blender DXF exporter ("POLYLINE", "POLYFACE", "3DFACE"), nothing changes when importing in these tools.

Also for the record, if you wonder why use a 3D editor like Blender for cutting in 2D CNC, the answer is simple: 2D CNC is not just used for 2D cutouts, or more accurately the 2D cutouts might be 2D pieces that assemble together to make a 3D object like a computer case. Here's the actual model this 2D cutout was taken from: enter image description here

It had to be made in 3D to make measurements and make sure everything is in correct position and fits with the rest of the project pieces.

$\endgroup$
  • 3
    $\begingroup$ While it may not provide the export formats you are looking for I expect you will be interested in the Blender CAM project. If the g-codes it makes are not helpful, it is still a place of contact for other blender users that use blender for CAD/CAM. Also if the DXF exporter does not export correctly you should report it as a bug and help testing, so that it can be improved. $\endgroup$ – sambler Jun 18 '16 at 14:11
  • $\begingroup$ These services don't take g-code from the customer. And I don't know whether Blender's DXF exporter is buggy and what it is doing wrong, I'm asking. $\endgroup$ – Leo Ervin Jun 18 '16 at 15:33
  • $\begingroup$ You appear to have access to the other apps that export correctly. Make a simple test object in each and compare the exported file. $\endgroup$ – sambler Jun 19 '16 at 5:50
  • $\begingroup$ Compare the exported files? I'm not a programmer, I can't just check contents of a file with a DXF format reference on hand and figure something out. Nor can I debug Blender every time there is some issue, most users can't, you seem to think otherwise with your suggestions. $\endgroup$ – Leo Ervin Jun 19 '16 at 8:14
  • 1
    $\begingroup$ You should find this article interesting. $\endgroup$ – sambler Jun 23 '16 at 12:58
3
$\begingroup$

I've only had some tangential contact with the area I am not much into CNC milling myself but I think your problem comes mainly from the fact that, to the extent of my knowledge, 2D (as you mentioned) CNC milling requires bidimensional contour information of your object, that means a a 2D representation instead of the 3D object itself.

That would mean representing elevations, plans or sections of said object for export, and that is probably why they mostly use Corel (and AutoCAD to a lesser extent) as their main software.

They are illustration-type 2D layout or CAD programs because they require 2D polyline, spline or bezier curve based information to generate a path the machine drills can fallow.

Now Blender being primarily a mesh based subdivision modeling tool is particularly unsuited for this type of work. Not only is blender bad at producing 2D representations of it's objects; mesh based 3D models are particularly unsuited for extracting that type of information from them to begin with.

Mesh models being made entirely of triangles can only export polygonized straight-segment-based representations of it's geometry, not smooth curves. That is generally the role of CAD based 3D modeling software which generally used ACIS solid Modeling or NURBS based geometry engines to create it's shapes.

Possible Solution

If you plan on making primarily "extrusion based" geometry like like plates or or cut sheet based geometry, like the one in your image, maybe you can start using a bezier-curve based modeling technique instead, more suited and simpler for this type of geometry.

This will also have the added benefit of producing clean curve based geometry and you wont have to worry about triangulation or filling the caps.

You can then use some of the solutions in this answer to export it as SVG based curve. I believe Corel will be able to correctly import SVG vector drawings and produce real contours from it.

As sad as this may seem, it unfortunately still feels like a hacky workaround with inadequate tools.

Alternatives

As a side note I believe a NURBS or Solid modeling based software would be a lot better suited for this type of work, like FreeCAD or OpenCAD or if you don't mind commercial applications MoI is a really good alternative and a relatively cheap one considering the high price of the other available tools out there.

$\endgroup$
  • $\begingroup$ I have to respectfully disagree that Blender is not meant for this kind of work. Few reasons: 1) 2D CNC machines can make 3D objects that are made up of 2D cutouts. Even the above sample is a 2D cutout from one sheet of a 3D case for a professional equipment, designed in 3d in Blender. I obviously want to see how it looks in 3D so using Blender rather than a 2d tool makes more sense. 2) It might be true that NURBS based modellers are easier to use for this, but that does not mean polygonal modellers aren't suited. As mentioned, 4 axis CNCs and 3d printers use STL files which use polygons. $\endgroup$ – Leo Ervin Jun 18 '16 at 7:29
  • $\begingroup$ Continued: the suggestion to use curves in Blender isn't practical because 1) curves lack many operations and modifiers you can perform on meshes and 2) my models are already made of polygons and it took me hours to model each. As for the other tools you suggest to use, well I think suggesting another tool to use for the actual modelling besides Blender is not really an answer for blender.stackexchange. $\endgroup$ – Leo Ervin Jun 18 '16 at 7:35
  • 1
    $\begingroup$ @LeoErvin I stand behind this answer. +1 from me. Blender is not for CAD work - I don't know how many times I have to tell people, it only brings trouble. Yes, you can stubbornly try to make CAD work inside Blender, it is the same like trying to cut a steak with a spoon - wrong tool. The correct tool to use is FreeCad and alike. If you need you can always export into Blender for rendering if you need.. If you pay someone he/she could make you a working exporter, but as it is now it is no use. $\endgroup$ – Jaroslav Jerryno Novotny Jun 19 '16 at 21:03
  • $\begingroup$ @Jerryno Completely useless comment. You make statements, not arguments. You stand behind arguments I've addressed. Either make your own arguments, or respond to my responses to the arguments you support. Or don't post, nobody cares about mere opinions and statements. On top of that, good job decreasing the Blender user base with your baseless opinion you "don't know how many times you have to tell people". And were you the one who made an answer and deleted it? $\endgroup$ – Leo Ervin Jun 19 '16 at 21:18
  • 1
    $\begingroup$ @LeoErvin And also no, I am not decreasing the Blender CAD user base. Blender itself is decreasing the user base by having no suitable tools for CAD tasks. If Blender had those tools and I was lying, not speaking the truth, then yes - I would be falsely decreasing the Blender CAD user base by negative propaganda. $\endgroup$ – Jaroslav Jerryno Novotny Jun 20 '16 at 7:46
0
$\begingroup$

If you look at the specification for G-Code, then you will most likely be able to accomplish most of your work with very minimal commands eg. "G90" & "G1".

Your main problem is that most milling centers will not assume that your code is correct, and for good reason should not. One of the biggest reasons for this that you must realize is, parts on a mill anyway have points that the base material must be fixed by mechanical methods to keep it down on the milling table, and to assume that your code is remotely trustworthy would also need to require that your code would avoid running their tooling into these mechanical fixturing devices.

There are many factors why milling centers can not just trust code, but the above is the main one.

You may be able to provide your fixturing within your model to show where this will happen, and some sort of "post" (visual preview of the tool path) to provide the confidence to the machining center that you have taken the appropriate precautions.

There are also other "M" Codes that would be best for the Machining Center to apply on your behalf, as they could be unique to both the machine and the tooling being used (eg. Whether your End Mill should be turning Clock-Wise, or Counter-Clock-Wise). There are also safe RPM limits to run any particular end mill, so the machining center will no doubt want to control this as well.

You will no doubt need to make clear what "you" are considering your "Z-Zero" location. It is fully acceptable for this to be commonly the top of a spoil board material, or at the top of the blank material. This could be worked out with the preferred method of your machining center.

There are also different methods to set where a home position can be (0,0,0), and different G-Codes to deal with that as well that should also be applied by your machining center.

One other main consideration is the tooling.

Milling is primarily done on the center-line of your end-mill. This means that you will have to accommodate for its radius from center. If you are using a flat mill, this will probably be the easiest (but there are many shapes of tools - So you must know them, and how to accommodate for them).

Beyond this. G-Code itself is pretty simple.

G90 (<-- Set the positioning mode to Absolute)

(<-- Your Coordinate offsets should be set by the milling center here -->)

(Assuming your "Z-Zero" point is at the bottom of your blank material)

G1 0,0,10 F100 (<-- Puts the machine to X:0 Y:0 Z:10)

M3 S24000 (Usually starts the machine to Spin Counter-Clock-Wise @ 24,000 RPM)

G1 5,5,0 F100 G1

10,5,0 F200 G1 10,5,10 F200 M5 (Stops the spindle)

The above code just cut a 5 unit wide slot in your material at full depth.

You could write that pretty easy by querying position (vertex locations) in Blender. But you have to know what your milling center will accept.

$\endgroup$
  • $\begingroup$ G-Code is out of the question, for the reasons you mentioned. Only options seems to be DXF, or whatever other format you'll suggest. So er, thanks for the clarifications, but this is not really an answer now, is it? $\endgroup$ – Leo Ervin Jun 20 '16 at 21:17
  • $\begingroup$ It is an answer if you were able to do the coordination, if that sounds like too much effort on your part, then I think your next best step would be to recreate from "Blender">>"Python" a .lsp (LISP file) file that would re-build your geometry in AutoCAD. The API is pretty available and hasn't changed enough over the last decade to be concerned with it not working. $\endgroup$ – Rick Riggs Jun 21 '16 at 0:25
  • $\begingroup$ @LeoErvin, I seem to remember having to send something out of house for a particular project before my company incorporated CNC milling in-house. They allowed for me to export from Blender using the .STL file format. I did some looking and I believe that Delcam uses an ArtCAM package that pretty much autoDetects the 3D part, and bases it tool paths from there with whatever sorcery like algorithms they use. Anyway, It might be worth while getting in touch with them to see if there are any customers of theirs that you could reach out to to get your blends milled - Hope it helps. $\endgroup$ – Rick Riggs Jun 21 '16 at 6:01
  • $\begingroup$ @LeoErvin, Art CAM's Website. It seems that they can take both STL & OBJ so right out of the gate you have some Blender options. It also takes some Image options, so for parts that are basically 2D such as your examples, I believe that your machining center can just specify the thickness of material to make certain they get all the way through it in terms of depth, but would allow you to render an orthographic 2D image file. $\endgroup$ – Rick Riggs Jun 21 '16 at 6:11
  • $\begingroup$ How is it an answer if like I said G-Code is not an option. What coordination? And as I have said I'm not a programmer to write a FreeCAD exporter or rewrite the DXF exporter either. $\endgroup$ – Leo Ervin Jun 21 '16 at 13:48
0
$\begingroup$

There is a gcode plugin for Blender to work with HAASBOT alike CNC machines

There's also grashopper but not sure if that would fit your needs.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.