24 ms·
That's nice. It looks so simple in Python. I notice that for convex hulls, they just use a wrapper around QHull. Doing convex hulls well is quite hard. If y
by Animats 12y ago
That's nice. It looks so simple in Python.
I notice that for convex hulls, they just use a wrapper around QHull. Doing convex hulls well is quite hard. If you intend to use them for collision detection, they must really be convex. The slightest concavity will cause the algorithm to stall at a local minimum. There's also the question of whether faces should be triangular or polygonal. If they're triangular, the convex hull of a cube has coplanar faces, which is bad. If they're polygonal, the polygon will not have perfectly flat faces due to finite precision and may have false convexity. A good compromise, supported in QHull, is to specify a minimum angle for edges. If you require, say, 1 degree of bend at each edge, most of the annoying corner cases go away.
The next step after that intro is constructive solid geometry, where you have union and intersection operations. 3D CAD systems use those heavily. This used to be considered very hard to do. Now you can do it in the browser: http://evanw.github.io/csg.js/ http://evanw.github.io/csg.js/
- santaclaus 12y agoI have yet to see a 100% bulletproof CSG system, unfortunately. The open source packages (Carve, Cork, and others) and the implementations in all commercial packages I have tried will work 99% of the time, but fail horribly on the remaining 1%. This makes their use in automated pipelines tricky. With that said, the solutions out there today are way better than those available even five years ago.
- Animats 12y agoIt's hardest for CSG systems that can't say no. If you use Autodesk Inventor, there are some geometries where the fillet generator just gives up and says the geometry is too complex to fillet. Because it's a user-driven program, it has that option. But a machining simulator does not. Those are programs which simulate what happens as a tool cuts through a part, starting with the geometry of the blank and subtracting every cut. For 2.5D machining (tool always approaches material from straight down), the simulator can use a height field, and that works fine. But the general 3D case, where the tool can come in from any direction, seems to be beyond the state of the art in CSG to get perfectly. I've had both InventorCam and SprutCam blow up. If you spend $22,000 for a copy of HyperCam, it seems to work much better. https://www.youtube.com/watch?v=RnIvhlKT7SY https://www.youtube.com/watch?v=RnIvhlKT7SY Now that's a triumph of CSG.