Unable to open .dxf file

I am trying to save a sketch output as a dsx file. Am using this because I am looking to save a sketch using 3D bezier curves. Although the file appears to be saving, it will not open properly using Adobe Illustrator or an Autodesk viewer that I was able to download (I don’t have CAD). Also, tried with this example from Processing.org and got same result. Sketch opens but not with the screen content.

import processing.dxf.*;
boolean record;
void setup() {
size(500, 500, P3D);
void draw() {
if (record) {
beginRaw(DXF, “output.dxf”);
// Do all your drawing here
if (record) {
record = false;
void keyPressed() {
// Use a key press so that it doesn’t make a million files
if (key == ‘r’) {
record = true;
When I do open it with Illustrator, this is what I see:

Not even sure what this is?

In addition I am getting the following error in the console, even though the sketch seems to run,
TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2019-12-29 08:53:36.385 java[762:12250] WARNING: NSWindow drag regions should only be invalidated on the Main Thread! This will throw an exception in the future.

I know there was a thread on this is the past, but ticket was closed; don’t know if it is related to my dfx issue or not. If anyone can advise on how to save a sketch using 3D bezier curves and how that sketch can be opened, would appreciate it. Running 10.14.3 MacOS Mojave.
Thanks for your help on this.

you mean dxf, right? I edited your title.

what do you see when you open it with text editor?

The error you are getting in the console is a general problem with Processing 3 on macOS. This happens every time you specify a renderer (P3D in your case) in size or fullScreen.

Yes, right dxf. Thanks!

I see the same thing.

Maybe try to run a test sketch with simple lines. And see if that works. Maybe bezier isn’t implemented in the export

Yes, did it with a few lines,
vertex (10,24);
vertex (100,23);
vertex (100,180);
//bezierVertex (mouseX,mouseY, 400, 400,mouseX,mouseY,350,200,200);

but output was the same - just a print-out of coordinates or something, no graphic. Any other ideas for saving 3D custom shapes?

How does it look like in text editor? Or if you open dxf with processing?