4 ms·
>> Most parametric CAD operations are single-threaded; however, the open-source project SolveSpace [solvespace.com], which uses NURBS (nonuniform rational basis
by phkahler 5y ago
>> Most parametric CAD operations are single-threaded; however, the open-source project SolveSpace [solvespace.com], which uses NURBS (nonuniform rational basis splines), has some parallel operations.
Current Solvespace maintainer here if you have questions on that. I did most of the work on making NURBS boolean operations use OpenMP for parallel operations. The code is highly functional, so that was mostly adding the appropriate #pragmas, but some things needed fixes, and some required tricky critical sections.
https://solvespace.com/ https://solvespace.com/
- wlesieutre 5y ago3.0 is out, congrats on the release! I'd built that myself to try it out earlier this year, IIRC the previous stable build was 5 years old. Guessing I didn't have the OpenMP version from my build, so this should be a performance boost. Unrelated to parallelism, is there a way to lock the vertical axis for orbit, what blender calls "turntable" style rather than "trackball"? Coming from an AutoCAD and Blender background, I'm a lot more comfortable in that mode.
- phkahler 5y ago>> Guessing I didn't have the OpenMP version from my build, so this should be a performance boost. The performance in 3.0 is dramatically better, not just from the OpenMP. We still have a lot of code that doesn't scale well because it's O(n^2) but what is there is much faster. There's also a post-3.0 improvement already in one slow area, and we hope to get Eigen in there to speed up the constraint solver. >> is there a way to lock the vertical axis for orbit, what blender calls "turntable" style rather than "trackball"? Oh man I forget. You might want to comment on this pull request: https://github.com/solvespace/solvespace/pull/956 https://github.com/solvespace/solvespace/pull/956 We obviously can't implement every option under the sun, but I think turntable is more asked for than the one implemented in the PR (which I haven't even had time to test properly).
- wlesieutre 5y agoNever mind, I found it! Turntable already exists, it's in the second block of checkboxes on the config screen, between "enable automatic line constraints" and "edit newly added dimensions." I think that issue is looking for a toggle like Apple's "natural scroll direction" where it's a question of whether you want the metaphor that pushing your scroll wheel is pushing the content up and down or moving the scroll bar grip which makes the content go the opposite direction.
- pasabagi 5y agoHey, I just downloaded 3.0 and, wow, the performance is really fantastic! It's a really welcome change - I was starting to dread making complex models because I'd have to make them with another program, at which point I would be continually frustrated by the other program's inferior UI. Anyway, solvespace is the first CAD program where I've actually enjoyed myself while designing things, rather than just viewing it as necessary work for a project. So, thanks for all the great work you guys are doing, it's much appreciated.
- bsder 5y agoHow are you handling the fact that it seems like none of the computational geometry algorithms parallelize? Even something as fundamental as line segment intersection doesn't seem to have any good parallel algorithms.
- phkahler 5y ago>> How are you handling the fact that it seems like none of the computational geometry algorithms parallelize? >> Even something as fundamental as line segment intersection doesn't seem to have any good parallel algorithms. We don't need parallel algorithms at the lowest level. A NURBS model consists of a large number of surfaces and trim curves. You'll be hard pressed to find "standard" algorithms for NURBS boolean operations, but jwesthues (creator of solvespace) chose a fairly good process for handling them. To combine 2 NURBS shells we compute intersections of each curve from A against each surface from B as one step in the process. Finding all those intersections can be done in parallel. Each step in the boolean process can similarly be done in parallel at either the curve or surface level. We also do triangle mesh creation in parallel now, as each surface patch is triangulated separately it was easy to run them in parallel. This was a huge win for things like a torus where there are many surface patches with compound curvature and lots of triangles. We had one nasty bug where dragging some geometry around would start to distort a couple surfaces. Turns out there is a function to intersect a ray with a NURBS surface that recursively subdivides the surface. The recursive subdivision was altering the weights of the original surface control points and then putting them back. Running that on multiple threads at once could lead to corruption. I don't recall how I tracked that down, but the fix was to simply make a copy of the surface and discard it when done rather than changing the original. This whole ray-surface intersection thing is another example of an algorithm that doesn't really benefit from parallelization for a single call, but there's no reason we can't go up a level and have multiple threads calling that function with different ray/surface combination. I was really pleased that most of the complicated code in Solvespace is written in a functional style - meaning it doesn't mutate data. Another part of the NURBS boolean process is to create a BSP-tree for each surface, which is then discarded after the operation is complete. Once again, that can be done in parallel over all the surfaces even though it'd be hard to create a single BSP-tree using parallel code.
- helltone 5y agoPhilosophical question but why do we still use nurbs instead of, for example, subdivision surfaces? Is that mostly because users want to export to nurbs after editing?
- phkahler 5y ago>> Philosophical question but why do we still use nurbs instead of, for example, subdivision surfaces? Subdivision surfaces are a generalization of B-spline surfaces that predate them. History aside, sub-d surfaces can not exactly represent circles, cylinders, or torri. When you're designing real objects - rotating machines in particular - you want perfect circles. Round wheels and bearings. Trimmed NURBS (which result from itersections) are also easy to model features like chamfers, where again subdivision surfaces may fall down. Pixars creased subdivision surfaces probably do a bit better for things like chamfers. Nurbs are a better fit for modeling the kind of surfaces created by traditional machining operations. You wanna make movies? Use subdivision surfaces. Wanna design mechanical devices? Use NURBS. I'd like to see something better, but the industry isn't likely to change. Open source is IMHO the way to go with any fundamentally new representation.
- baybal2 5y agoWhat do you think of non-history based CADs using direct constraint solving? Can they even hypothetically match history based ones on functionality? As I understand history is a "hack" for low capabilities of 3D constraint solvers, which are limited in shapes they can express by what the solver can express.
- phkahler 5y ago>> What do you think of non-history based CADs using direct constraint solving? Can they even hypothetically match history based ones on functionality? I may not be the right one to ask. jwesthues wrote solvespace originally for his own reasons, I think partly to experiment with better ways of solving constrained sketches particularly during user interactions (dragging). I'm not sure about the history aspect of these programs. The group structure of a solvespace model is not really as necessary as it may seem. I don't think the capabilities of the constraint solver are even close to being fully utilized. >> As I understand history is a "hack" for low capabilities of 3D constraint solvers, which are limited in shapes they can express by what the solver can express. We could in theory apply the constraint solver to any set of points and lines - Vertexes and skeletal structures in Blender for example. It gets tricky to make predefined geometry with only some specific degrees of freedom. You're basically using automatic constraints to define the non-movable parts of an object, but leaving out just the right constraints to allow the user to move/stretch/bend the thing in an intuitive way. Again, we're just scratching the surface now with extrude/revolve/helix operations. Extrude-along a path is a long sought feature that I plan to implement. It will be like chaining multiple extrude or revolve segments (with uniform cross section) in a single group. The solver will be maintaining that cross section while allowing the user to drag an awful lot of stuff around. Most other CAD has the feature but they seem to want you to define a path ahead of time and then just create the geometry to follow it. We can do better.
- therein 5y agoI love Solvespace. It really changed the way that I perceive CAD when I got into designing 3d printed parts that needed to fit together.
- phkahler 5y ago>> I love Solvespace. It really changed the way that I perceive CAD when I got into designing 3d printed parts that needed to fit together. The next version should be able to link STL files into your models - complete with boolean operations. The linking code exists on one of my branches, but I still need to work out which verticies get point entities created for building geometry on. I know how to do it, just not efficiently yet.
- FullyFunctional 5y agoI admittedly know very little about CAD internals, but I design models for 3D printing and STL seems so ... awful ... yet as the lowest common denominator it has a tremendous support everywhere. What are the alternatives? I assume Solvespace uses something better natively, but you still have to export to STL to go through a slicer to get G code? It really seems like a better job could be done without both STL and G code.
- zokier 5y ago> What are the alternatives? The main alternatives are IGES and STEP files. STEP is an ISO standard CAD interchange format, and the most modern of the bunch.
- phkahler 5y agoSTEP is a huge standard. Solvespace can export it because it only needs a small portion of the standard. I'm guessing the slicers used for 3D printing have avoided it due to the complexity, but it would be nice to hand them actual curved surfaces and spit out G-code with arcs if not splines.
- digdugdirk 5y agoAny thoughts/recommendations on how to get started in the software development side of things coming from a mechanical engineering background?
- phkahler 5y ago>> Any thoughts/recommendations on how to get started in the software development side of things coming from a mechanical engineering background? That's an interesting question. I know a guy who was (is) an ME. He worked in the auto industry calibrating ABS and traction control systems. That's an area where torques/forces/dynamics are required, but no real software background. He would either come up with new ideas, or try to track down bugs in the algorithms - he had access to the code since we were all at the same company. He moved on to fixing problems (the software team had a lot of things to do so weren't as responsive as he wanted?) and even implementing features. When I met him he was a solid embedded software engineer and I was a bit surprised to hear his path to get there. So I guess find some niche that has overlap between what you know and what you want to do. Then gradually leverage that as you improve (and prove to others) your capability in the "other" area. How you find that overlap is up to you. For one guy it meant calibrating stability control systems was the start. I've come to think the most flexible place to branch out from is product testing or manufacturing. You can learn a lot about a lot of different aspects of things there. Just don't let yourself stagnate.
- mjheying 5y agoI have a BS & MS in Mechanical Engineering, but I have spent the last 15+ years in Software. I first got my start learning to code on the side, but eventually made my way into Product Management. I would look for software engineering companies in the ME space think CAD, PLM, FEA type software companies and look for jobs in PM or even customer success and pre-sales engineering. Some of the best PM's that I've hired come from the customer success groups.
- glouwbug 5y agoRead up on Walter Bright
- 5y ago
- WillAdams 5y agoOnce thing I've always wanted in Solvespace is the ability to type up a file using a description like to OpenSCAD, then open that file in Solvespace --- is that on the radar?
- phkahler 5y ago>> Once thing I've always wanted in Solvespace is the ability to type up a file using a description like to OpenSCAD, then open that file in Solvespace --- is that on the radar? Not really? The thought went though my head, but I've never looked at OpenSCAD close enough to even say how complex their interpreter is. Then there's the question of how much of that could reasonably be created with the NURBS subsystem in Solvespace. IF you're OK with the STL output from OpenSCAD, our next release should include the ability to link those files into an assembly. Maybe that will help. It won't solve the problem of people wanting to write scripts and output STEP files.
- WillAdams 5y agoThe problem is, STL won't work for me --- I've been working on wood joinery, and I keep coming up with designs which between their geometry, and the tooling which should be used to cut them out, 3D CAM tools simply won't cut them out w/ the accuracy necessary for a good fit.