Hacker News new | past | comments | ask | show | jobs | submit login
Csg.js: Constructive Solid Geometry, with rotatable 3D models (evanw.github.com)
186 points by danso on Dec 6, 2011 | hide | past | favorite | 17 comments



It's very interesting to see the mesh operations able to be done client side now, and this is pretty lean. One of the biggest problems with doing CAD on the internet is the mesh pipeline issue where you're constantly throwing a ton of polys back and forth to the server.

Check out http://TinkerCAD.com or http://ShapeSmith.net to see server-side WebGL renders CAD operations. This could make such programs a lot faster for sure.

The only issue is that CSG style CAD on meshes is pretty basic compared to the now standard "Boundary Representation" of a STEP file - which is like the style SolidWorks uses. I don't know how easy it would be to make BREP.js, but I'm still loving that this was actually made.


I think ESOLID is an OK candidate for conversion to "BREP.js" at this point:

http://research.cs.tamu.edu/keyser/geom/esolid/index.htm

http://gamma.cs.unc.edu/ESOLID/

http://research.cs.tamu.edu/keyser/geom/esolid/releases/vers...

http://diyhpl.us/cgit/lolcad/plain/esolid/esolid.py

Except for the licensing issues- nobody has been able to get John Keyser to respond about what the license is. It was written under an NSF grant, so it's probably public domain? I wrote a partial cython wrapper around esolid in lolcad.git if anyone wants to look at that.

OpenCASCADE would be another option, except the code base is awful and sprawling and huge. It's hard to separate out the important libraries, like BRepAlgoTool versus BRepAlgoAPI versus BRepApplePie, it's endless.


> It was written under an NSF grant, so it's probably public domain?

Unfortunately, you can't assume that in general. There are a few specific NSF programs that require open-source licensing of any software produced (e.g. http://nsf.gov/funding/pgm_summ.jsp?pims_id=5174), but it's not a usual requirement. In fact lots of NSF-funded stuff eventually ends up in spinoff companies selling proprietary software, and the NSF even dedicates a smallish portion of its budget specifically to funding those kinds of spinoff efforts (via http://www.nsf.gov/eng/iip/sbir/).


Hey Brian! So you think ESOLID would be good for general BREP operations tool, or are you saying it could replace OpenCASCADE. I really want to see more resources for this stuff - who are working these problems?


Nope, it's not a replacement for OpenCASCADE. It solves "only" one problem: boolean operations on BREPs and NURBs. OpenCASCADE will be replaced over time. At this point, the FOSS community desperately needs this and it would be hugely disruptive. I would love to get more hands on deck for working on this sort of BREP library, any takers?


Curious, why does the FOSS need this, and why would it be hugely disruptive?


Because openCASCADE is the only open source solid modelling kernel approaching the same league as the Parasolid / ACIS / Inventor / Rhino kernels. Imagine the possibilities if more people had easy access to this level of reliable geometry manipulation. You could use it on the web, for REPRAP type stuff, all kinds of things. Innovation in CAD and therefore in construction and manufacturing could happen a lot faster if you could code agile languages against a good clean and •simple• API for very little start-up cost. Simple is the key word here, I don't see why there can't be a high level API which requires the same level of understanding of solid modelling as using the software through the UI.

EDIT: I was dissing openCASCADE before, didn't mean to.


Another GPL CSG library is carve (http://code.google.com/p/carve/) by Tobias Sargeant.

I have just finished wrapping this for use server-side within node.js. It will be interesting to see how it fares against csg.js.


carve looks like another mesh library to me.

See http://code.google.com/p/carve/source/browse/src/intersect.c...


Heres what I managed to put together in about half an hour (paste it into the last example): http://pastebin.com/raw.php?i=gaEKT6Z2

I like it, just wish you could define the dimensions of a square or should I say a rectangle.


Now I wanna go port POV-Ray to javascript! It looks like it'd be pretty simple to add a few more basic shapes (cones, toruses), and then you'd just need a parser for the POV-Ray language. Still need code to handle textures and transmission media effects, though.


Submitted this yesterday but no one cared. http://badassjs.com/post/13788484076/csg-js-constructive-sol...


Read the guidelines: "Please submit the original source. If a blog post reports on something they found on another site, submit the latter."


Blogs often provide perspective and analysis on projects not gained from direct links.


Sometimes, but in this case, your blog post didn't say much that wasn't already a part of the original.


In addition to navyrain's comment, there's also a large amount of randomness in what percolates to the top of HN. Many, many stories are submitted each hour, and unless a few people immediately say "Oh, cool" and upvote it, the story gets buried.


I realize that.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: