Save a PShape on Hard Drive (please help)

hello all,

I am generating an PShape from a CSG (with JCSG) and wanted to ask whether I can save the PShape in one go.

like (pseudo code)

PShape myShape;

Any ideas?

(too long for an mcve)

Didn’t find anything here: Reference /

What I tried

What I tried is to save a CSG instead PShape: (see link below) (didn’t work)


  else if (key=='s') {

    // make PShape from cubes
    make_csgResult(); // one CORE function
    // save union as stl
    try {
    catch (IOException ex) {
  } // else if

  else if (key=='l') {
    //load shape into Processing
    csgResult = loadShape(sketchPath("sample.obj"));
    // change state 
    stateProgram = STATE_SHOW_PSHAPE;



For more information about what I mean with making a PShape from CSG :

see java - Is it possible to use jcsg library with Processing? - Stack Overflow

Thanks to all!

Warm regards,


if you just want the mesh

a PShape save function is something that has been talked about alot in the past but due to the nature of the PShape it’s a complex beast to wrangle.

note: the library talked about in that tweet is here and can be imported via sketch. I don’t know the details of the PShape you are creating and what properties you need to export so it’s difficult to offer anything more. Best of luck.

1 Like