shape data from json or xml file

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

shape data from json or xml file

fractorr
I am wanting to generate blocks of various shapes and sizes with holes through them in various locations.  I currently have all the data for the shapes, sizes and hole location in a json file.  Is there any way to use this in OpenSCAD so I don't have to have a separate file for each shape / size combination?  Between the various shapes and sizes I have over 200 combinations.  It would save me a lot of time be be able to reuse the json file I already have.  If not is there another way to store and use structured data to generate the blocks?
Reply | Threaded
Open this post in threaded view
|

Re: shape data from json or xml file

nophead
It would be easy to import json in Python and spit out openscad, if you speak Python that is.

On 7 December 2015 at 17:17, fractorr <[hidden email]> wrote:
I am wanting to generate blocks of various shapes and sizes with holes
through them in various locations.  I currently have all the data for the
shapes, sizes and hole location in a json file.  Is there any way to use
this in OpenSCAD so I don't have to have a separate file for each shape /
size combination?  Between the various shapes and sizes I have over 200
combinations.  It would save me a lot of time be be able to reuse the json
file I already have.  If not is there another way to store and use
structured data to generate the blocks?




--
View this message in context: http://forum.openscad.org/shape-data-from-json-or-xml-file-tp15014.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: shape data from json or xml file

fractorr
ah, right. I guess if I just make a library with the various drawing functions and then I can then generate a separate scad file for each shape / size combination that just uses my library.
tp3
Reply | Threaded
Open this post in threaded view
|

Re: shape data from json or xml file

tp3
On 12/07/2015 08:09 PM, fractorr wrote:
> ah, right. I guess if I just make a library with the various drawing
> functions and then I can then generate a separate scad file for each shape /
> size combination that just uses my library.
>
Depending on the actual objects, you could also have a look at
BOLTS and see how it's done there. Or maybe even integrate :-).

http://www.bolts-library.org/en/index.html

ciao,
  Torsten.



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: shape data from json or xml file

fractorr
I like the BOLT idea, going to look into it.
Reply | Threaded
Open this post in threaded view
|

Re: shape data from json or xml file

jdawgaz
try python module solidpython



--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Arduino developer

The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime. 
- Anonymous

If writing good code requires very little comments, then writing really excellent code requires no comments at all!
- Ken Thompson


On Mon, Dec 7, 2015 at 1:23 PM, fractorr <[hidden email]> wrote:
I like the BOLT idea, going to look into it.




--
View this message in context: http://forum.openscad.org/shape-data-from-json-or-xml-file-tp15014p15023.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: shape data from json or xml file

fractorr
In reply to this post by tp3
I am REALLY liking OpenSCAD. I went with the BOLTS type method.  I have 12 modules that accept various parameters for generating shapes.  With those 12 modules I can generate over 1,400 different OpenSCAD files.  I created a script file to generate all the possible OpenSCAD files with the various parameters for each module.   I then used the command line export option to batch export them to stl and png files.  This ability saved me countless hours of work.  
Reply | Threaded
Open this post in threaded view
|

Re: shape data from json or xml file

jdawgaz
for those of you looking into BOLTS.
I installed it, and tried it out. My bolts have no threads.
Are my bolts supposed to come out with no threads?




--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Arduino developer

The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime. 
- Anonymous

If writing good code requires very little comments, then writing really excellent code requires no comments at all!
- Ken Thompson


On Fri, Jan 15, 2016 at 4:05 PM, fractorr <[hidden email]> wrote:
I am REALLY liking OpenSCAD. I went with the BOLTS type method.  I have 12
modules that accept various parameters for generating shapes.  With those 12
modules I can generate over 1,400 different OpenSCAD files.  I created a
script file to generate all the possible OpenSCAD files with the various
parameters for each module.   I then used the command line export option to
batch export them to stl and png files.  This ability saved me countless
hours of work.




--
View this message in context: http://forum.openscad.org/shape-data-from-json-or-xml-file-tp15014p15721.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org