bjnortier / shapesmith.deprecated

Open source HTML5 3D modelling
http://www.shapesmith.net
Other
160 stars 25 forks source link

ability to load openscad code #64

Open ghost opened 12 years ago

ghost commented 12 years ago

It would be nice to have an ability to laod openscad code in.

I suggest this because i have a large library of openscad files that i would like to try to integrate into shape-smith.

if you can think of a more elegant way of doing this please let me know.

It woudl also allow the ability to build a model from "parts". Thos ebeing external openscad files. This is like XReferencing in AutoCAD.

bjnortier commented 12 years ago

I thought I had an issue for this already.

Yes, definitely a VERY useful addition to import from & export to OpenSCAD - there are a lot of existing OpenSCAD designs that could be re-used.

Shapesmith won't be able to support OpenSCAD variables yet, so it will have be a snapshot, but in the longer term this could be supported as well.

ghost commented 12 years ago

what do you mean snapshot ? I presumed that open cascade is built on top of openSCAD and so would easily be able to load it without massive work ?

bjnortier commented 12 years ago

OpenSCAD is build on top of CGAL, which is a completely different geometry kernel to OpenCASCADE. So no, it will not be simple.

OpenSCAD has a language, with variables, iterators, and other gubbins. A parser would have be be written so convert it to a Shapesmith structure. Since Shapesmith has no variables, loops etc., or scripting engine (yet), the import will potentially be a one-way snapshot and variables will be discarded.

OpenSCAD (like CGAL) is also GPL v2, so re-using any code in Shapesmith will not be possible

5263 commented 12 years ago

I you only need a snapshot in the means of a static object. You could use FreeCAD to convert (SCAD/CSG) Files to OCC BREP Files 5263/FreeCAD@df017149c510b56a0b6f357671d6653ebc52d3a4

5263 commented 12 years ago

Many existing OpenSCAD Models have a lot of coincident faces and edges. They render fine in CGAL but they trigger a lot of bugs in OpenCASCADE when booing booleans. I could even trigger crash bugs with such geometry.

If you find a way to implement minkowski, glide, hull and subdiv with OpenCASCADE please tell me. 5263/FreeCAD#29

ghost commented 12 years ago

i am now looking at the OpenCASCADE kernel of how it works. i need to do generative modelling basically. I am an architect designing biomimicry based buildings. I can drop OpenSCAD and only use OpenCASCADE as long as it has the ability to run scripts to generate the models. Does anyone know if it has this ability ?

5263 commented 12 years ago

Hi gedw99, if you need to fully script OpenCASCADE you should have a look at http://www.pythonocc.org/ If you want to do traditional architectual design you probably interessested in FreeCAD https://sourceforge.net/apps/mediawiki/free-cad/ which is based on OpenCASCADE and has a special Arch Workbench/Module But in constrast to Shapesmith those are not web based, but stand-alone applications.

ghost commented 12 years ago

i want to script the model generation, and also use shapesmith to visualise them. Thats the goal.

ghost commented 12 years ago

i also found this. Its kind of nice it seems, but not sure how stable and good community yet

ghost commented 12 years ago

http://code.google.com/p/openshapefactory/wiki/UsersReadthisFirst

It looks pretty nice. It would be amazing if we would do something like this with ShapeSmith. Basically allow the ability to writ to JavaScript based scripts to generate models that are still truly STEP based.

bjnortier commented 12 years ago

Looks like a OpenCASCADE version of OpenSCAD.

There is no scripting support in Shapesmith yet, but it is certainly possible to write a simple script that outputs Shapesmith JSON and import that. The format is quite simple - essentially a hierarchy of objects. If you need some help with trying this out, I had planned to write a blog post about it, and could do that in the next few days

ghost commented 12 years ago

thanks.

i presumed that anything that can talk to openCASCADE can then represent it in the web GUI of smapesmith ? Since they use the same way of describing a model ..

Or have i missed a trick here ?

5263 commented 12 years ago

there is a tricky part. Displaying and working on a 'shape' with OCC operations should work out of the box. The problems start when you want to modify anything. For example ehen creating a cube in opencascade the resulting shape will have 6 faces, 12 edges and 8 vertexes. But the information that this is cuve is only implicitly avaialable. You would have to test for edge length and angles to test if this is a cube. Therefore the interoperability on the level of 'shapes' (BREP files) is limited.

ghost commented 12 years ago

we really should discuss all this on skype. gedw99 is my skype name. if you have time i would love to chat

5263 commented 12 years ago

I'm sorry im not using skype. And i don't have much time now.

ghost commented 12 years ago

ok another time i hope

On 26 June 2012 22:08, 5263 reply@reply.github.com wrote:

I'm sorry im not using skype. And i don't have much time now.


Reply to this email directly or view it on GitHub: https://github.com/bjnortier/shapesmith/issues/64#issuecomment-6586389

bjnortier commented 12 years ago

It's somewhat equivalent to drawing something in photoshop and saving it as PNG. Yes you can import it into another application, but the history of how you arrived at the result is a higher level of abstraction and not saved in the PNG.

The OpenCASCADE BREP format stores the faces, edges etc. of the shape, but not the operations performed to arrive at the result. That is application specific. There are also multiple ways to arrive at the same result and trying to deduce the higher-level (application-specific) description from the OCC would be impossible for non-trivial models.

ghost commented 12 years ago

ok i get it. it reminds me of when i worked in CGI - In the video editting world that is called an edit list. It allows you to edit.