Processing: saveShape() for PShape

Created on 30 May 2017  路  5Comments  路  Source: processing/processing

It would be nice if there was a way to save a PShape that has been created/changed. I mean you already have a load shape (https://processing.org/reference/loadShape_.html) but, a load function goes hand in hand with a save function and you only have on!

enhancement

Most helpful comment

SVG currently only does 2D; there'd have to be a 3D .obj exporter as well (eventually). Then you've got to work out whether the shape is 2D or 3D. Currently PShape::is3D just gets set by the PGraphicsOpenGL method createShapeFamily/createShapeGroup based on whether the PGraphics itself is 2D or 3D, which isn't ideal, although the user could call set3D(false) themselves.

All 5 comments

PS, I realize that there is no obvious file format to save a PShape as but, where creative!
(well I hope you are)

@Ttacodude7729 I am sure patches for this are welcome... you find PShape.java here, and the derived PShapeSVG.java file here.

@gohai What file is the return value coming from for the loadShape function (here on line 11525) Thanks! 馃憤

Reference:

SVG currently only does 2D; there'd have to be a 3D .obj exporter as well (eventually). Then you've got to work out whether the shape is 2D or 3D. Currently PShape::is3D just gets set by the PGraphicsOpenGL method createShapeFamily/createShapeGroup based on whether the PGraphics itself is 2D or 3D, which isn't ideal, although the user could call set3D(false) themselves.

Was this page helpful?
0 / 5 - 0 ratings